shellutils.scm 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2016 Matthew Jordan <matthewjordandevops@yandex.com>
  3. ;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com>
  4. ;;; Copyright © 2016 Christopher Baines <mail@cbaines.net>
  5. ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
  6. ;;;
  7. ;;; This file is part of GNU Guix.
  8. ;;;
  9. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  10. ;;; under the terms of the GNU General Public License as published by
  11. ;;; the Free Software Foundation; either version 3 of the License, or (at
  12. ;;; your option) any later version.
  13. ;;;
  14. ;;; GNU Guix is distributed in the hope that it will be useful, but
  15. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. ;;; GNU General Public License for more details.
  18. ;;;
  19. ;;; You should have received a copy of the GNU General Public License
  20. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  21. (define-module (gnu packages shellutils)
  22. #:use-module (gnu packages base)
  23. #:use-module (gnu packages golang)
  24. #:use-module (gnu packages python)
  25. #:use-module (guix licenses)
  26. #:use-module (guix packages)
  27. #:use-module (guix download)
  28. #:use-module (guix utils)
  29. #:use-module (guix build-system gnu)
  30. #:use-module (guix build-system python))
  31. (define-public envstore
  32. (package
  33. (name "envstore")
  34. (version "2.1")
  35. (source
  36. (origin
  37. (method url-fetch)
  38. (uri (string-append "https://finalrewind.org/projects/"
  39. name "/" name "-" version ".tar.bz2"))
  40. (sha256
  41. (base32 "1x97lxad80m5blhdfanl5v2qzjwcgbij2i23701bn8mpyxsrqszi"))))
  42. (build-system gnu-build-system)
  43. (arguments
  44. `(#:test-target "test"
  45. #:make-flags (list "CC=gcc"
  46. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  47. #:phases
  48. (modify-phases %standard-phases
  49. (delete 'configure))))
  50. (home-page "https://finalrewind.org/projects/envstore/")
  51. (synopsis "Save and restore environment variables")
  52. (description "Envstore is a program for sharing environment variables
  53. between various shells or commands.")
  54. (license
  55. (non-copyleft "http://www.wtfpl.net/txt/copying/"))))
  56. (define-public trash-cli
  57. (package
  58. (name "trash-cli")
  59. (version "0.17.1.14")
  60. (source
  61. (origin
  62. (method url-fetch)
  63. (uri (pypi-uri "trash-cli" version))
  64. (sha256
  65. (base32
  66. "01q0cl04ljf214z6s3g256gsxx3pqsgaf6ac1zh0vrq5bnhnr85h"))))
  67. (build-system python-build-system)
  68. (arguments
  69. `(#:python ,python-2
  70. #:tests? #f ; no tests
  71. #:phases
  72. (modify-phases %standard-phases
  73. (add-before 'build 'patch-path-constants
  74. (lambda* (#:key inputs #:allow-other-keys)
  75. (let ((libc (assoc-ref inputs "libc"))
  76. (coreutils (assoc-ref inputs "coreutils")))
  77. (substitute* "trashcli/list_mount_points.py"
  78. (("\"/lib/libc.so.6\".*")
  79. (string-append "\"" libc "/lib/libc.so.6\"\n"))
  80. (("\"df\"")
  81. (string-append "\"" coreutils "/bin/df\"")))))))))
  82. (inputs `(("coreutils" ,coreutils)))
  83. (home-page "https://github.com/andreafrancia/trash-cli")
  84. (synopsis "Trash can management tool")
  85. (description
  86. "trash-cli is a command line utility for interacting with the
  87. FreeDesktop.org trash can used by GNOME, KDE, XFCE, and other common desktop
  88. environments. It can move files to the trash, and remove or list files that
  89. are already there.")
  90. (license gpl2+)))
  91. (define-public direnv
  92. (package
  93. (name "direnv")
  94. (version "2.11.3")
  95. (source
  96. (origin (method url-fetch)
  97. (uri (string-append "https://github.com/direnv/" name
  98. "/archive/v" version ".tar.gz"))
  99. (file-name (string-append name "-" version ".tar.gz"))
  100. (sha256
  101. (base32
  102. "01mhwzq9ss2qlnn8aahvwsgnspq8hbz0qfknf290aicngwx10d1d"))))
  103. (build-system gnu-build-system)
  104. (arguments
  105. '(#:test-target "test"
  106. #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
  107. #:phases (modify-phases %standard-phases (delete 'configure))))
  108. (native-inputs
  109. `(("go" ,go)
  110. ("which" ,which)))
  111. (home-page "http://direnv.net/")
  112. (synopsis "Environment switcher for the shell")
  113. (description "direnv can hook into bash, zsh, tcsh and fish shell to load
  114. or unload environment variables depending on the current directory. This
  115. allows project-specific environment variables without using the ~/.profile
  116. file.
  117. Before each prompt, direnv checks for the existence of a .envrc file in the
  118. current and parent directories. This file is then used to alter the
  119. environmental variables of the current shell.")
  120. (license expat)))
  121. (define-public fzy
  122. (package
  123. (name "fzy")
  124. (version "0.9")
  125. (source
  126. (origin
  127. (method url-fetch)
  128. (uri (string-append "https://github.com/jhawthorn/fzy/archive/"
  129. version ".tar.gz"))
  130. (file-name (string-append name "-" version ".tar.gz"))
  131. (sha256
  132. (base32
  133. "1xfgxqbkcpi2n4381kj3fq4026qs6by7xhl5gn0fgp3dh232c63j"))))
  134. (build-system gnu-build-system)
  135. (arguments
  136. '(#:make-flags (list "CC=gcc"
  137. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  138. #:phases
  139. (modify-phases %standard-phases
  140. (delete 'configure))))
  141. (home-page "https://github.com/jhawthorn/fzy")
  142. (synopsis "Fast fuzzy text selector for the terminal with an advanced
  143. scoring algorithm")
  144. (description
  145. "Most other fuzzy matchers sort based on the length of a match. fzy tries
  146. to find the result the user intended. It does this by favouring matches on
  147. consecutive letters and starts of words. This allows matching using acronyms
  148. or different parts of the path.
  149. fzy is designed to be used both as an editor plugin and on the command
  150. line. Rather than clearing the screen, fzy displays its interface directly
  151. below the current cursor position, scrolling the screen if necessary.")
  152. (license expat)))