| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 |
|
| 24 | (define-module (gnu packages shellutils)
|
| 25 | #:use-module (gnu packages base)
|
| 26 | #:use-module (gnu packages golang)
|
| 27 | #:use-module (gnu packages python)
|
| 28 | #:use-module (guix licenses)
|
| 29 | #:use-module (guix packages)
|
| 30 | #:use-module (guix download)
|
| 31 | #:use-module (guix git-download)
|
| 32 | #:use-module (gnu packages autotools)
|
| 33 | #:use-module (gnu packages ncurses)
|
| 34 | #:use-module (gnu packages readline)
|
| 35 | #:use-module (gnu packages pkg-config)
|
| 36 | #:use-module (guix utils)
|
| 37 | #:use-module (guix build-system gnu)
|
| 38 | #:use-module (guix build-system go)
|
| 39 | #:use-module (guix build-system python))
|
| 40 |
|
| 41 | (define-public envstore
|
| 42 | (package
|
| 43 | (name "envstore")
|
| 44 | (version "2.1")
|
| 45 | (source
|
| 46 | (origin
|
| 47 | (method url-fetch)
|
| 48 | (uri (string-append "https://finalrewind.org/projects/"
|
| 49 | name "/" name "-" version ".tar.bz2"))
|
| 50 | (sha256
|
| 51 | (base32 "1x97lxad80m5blhdfanl5v2qzjwcgbij2i23701bn8mpyxsrqszi"))))
|
| 52 | (build-system gnu-build-system)
|
| 53 | (arguments
|
| 54 | `(#:test-target "test"
|
| 55 | #:make-flags (list "CC=gcc"
|
| 56 | (string-append "PREFIX=" (assoc-ref %outputs "out")))
|
| 57 | #:phases
|
| 58 | (modify-phases %standard-phases
|
| 59 | (delete 'configure))))
|
| 60 | (home-page "https://finalrewind.org/projects/envstore/")
|
| 61 | (synopsis "Save and restore environment variables")
|
| 62 | (description "Envstore is a program for sharing environment variables
|
| 63 | between various shells or commands.")
|
| 64 | (license
|
| 65 | (non-copyleft "http://www.wtfpl.net/txt/copying/"))))
|
| 66 |
|
| 67 | (define-public trash-cli
|
| 68 | (package
|
| 69 | (name "trash-cli")
|
| 70 | (version "0.17.1.14")
|
| 71 | (source
|
| 72 | (origin
|
| 73 | (method url-fetch)
|
| 74 | (uri (pypi-uri "trash-cli" version))
|
| 75 | (sha256
|
| 76 | (base32
|
| 77 | "01q0cl04ljf214z6s3g256gsxx3pqsgaf6ac1zh0vrq5bnhnr85h"))))
|
| 78 | (build-system python-build-system)
|
| 79 | (arguments
|
| 80 | `(#:python ,python-2
|
| 81 | #:tests? #f |
| 82 | #:phases
|
| 83 | (modify-phases %standard-phases
|
| 84 | (add-before 'build 'patch-path-constants
|
| 85 | (lambda* (#:key inputs #:allow-other-keys)
|
| 86 | (let ((libc (assoc-ref inputs "libc"))
|
| 87 | (coreutils (assoc-ref inputs "coreutils")))
|
| 88 | (substitute* "trashcli/list_mount_points.py"
|
| 89 | (("\"/lib/libc.so.6\".*")
|
| 90 | (string-append "\"" libc "/lib/libc.so.6\"\n"))
|
| 91 | (("\"df\"")
|
| 92 | (string-append "\"" coreutils "/bin/df\"")))))))))
|
| 93 | (inputs `(("coreutils" ,coreutils)))
|
| 94 | (home-page "https://github.com/andreafrancia/trash-cli")
|
| 95 | (synopsis "Trash can management tool")
|
| 96 | (description
|
| 97 | "trash-cli is a command line utility for interacting with the
|
| 98 | FreeDesktop.org trash can used by GNOME, KDE, XFCE, and other common desktop
|
| 99 | environments. It can move files to the trash, and remove or list files that
|
| 100 | are already there.")
|
| 101 | (license gpl2+)))
|
| 102 |
|
| 103 | (define-public direnv
|
| 104 | (package
|
| 105 | (name "direnv")
|
| 106 | (version "2.15.2")
|
| 107 | (source
|
| 108 | (origin (method git-fetch)
|
| 109 | (uri (git-reference
|
| 110 | (url "https://github.com/direnv/direnv.git")
|
| 111 | (commit (string-append "v" version))))
|
| 112 | (file-name (git-file-name name version))
|
| 113 | (sha256
|
| 114 | (base32
|
| 115 | "1y18619pmhfl0vrf4w0h75ybkkwgi9wcb7d9kv4n8drg1xp4aw4w"))))
|
| 116 | (build-system go-build-system)
|
| 117 | (arguments
|
| 118 | '(#:import-path "github.com/direnv/direnv"
|
| 119 | #:phases
|
| 120 | (modify-phases %standard-phases
|
| 121 | (add-after 'unpack 'delete-vendor
|
| 122 | (lambda _
|
| 123 | |
| 124 | |
| 125 | (delete-file-recursively "src/github.com/direnv/direnv/vendor")
|
| 126 | #t))
|
| 127 | (replace 'check
|
| 128 | (lambda* (#:key tests? #:allow-other-keys)
|
| 129 | (when tests?
|
| 130 | (setenv "HOME" "/tmp")
|
| 131 | (with-directory-excursion "src/github.com/direnv/direnv"
|
| 132 | |
| 133 | |
| 134 | (make-file-writable "test/scenarios/base/.envrc")
|
| 135 | (invoke "make" "test")
|
| 136 | |
| 137 | |
| 138 | (invoke "make" "clean")))
|
| 139 | #t)))))
|
| 140 | (native-inputs
|
| 141 | `(("go-github-com-burntsushi-toml" ,go-github-com-burntsushi-toml)
|
| 142 | ("go-github-com-direnv-go-dotenv" ,go-github-com-direnv-go-dotenv)
|
| 143 | ("which" ,which)))
|
| 144 | (home-page "https://direnv.net/")
|
| 145 | (synopsis "Environment switcher for the shell")
|
| 146 | (description
|
| 147 | "direnv can hook into the bash, zsh, tcsh, and fish shells to load
|
| 148 | or unload environment variables depending on the current directory. This
|
| 149 | allows project-specific environment variables without using @file{~/.profile}.
|
| 150 |
|
| 151 | Before each prompt, direnv checks for the existence of a @file{.envrc} file in
|
| 152 | the current and parent directories. This file is then used to alter the
|
| 153 | environment variables of the current shell.")
|
| 154 | (license expat)))
|
| 155 |
|
| 156 | (define-public fzy
|
| 157 | (package
|
| 158 | (name "fzy")
|
| 159 | (version "1.0")
|
| 160 | (source
|
| 161 | (origin
|
| 162 | (method git-fetch)
|
| 163 | (uri (git-reference
|
| 164 | (url "https://github.com/jhawthorn/fzy.git")
|
| 165 | (commit version)))
|
| 166 | (file-name (git-file-name name version))
|
| 167 | (sha256
|
| 168 | (base32
|
| 169 | "1gkzdvj73f71388jvym47075l9zw61v6l8wdv2lnc0mns6dxig0k"))))
|
| 170 | (build-system gnu-build-system)
|
| 171 | (arguments
|
| 172 | '(#:make-flags (list "CC=gcc"
|
| 173 | (string-append "PREFIX=" (assoc-ref %outputs "out")))
|
| 174 | #:phases
|
| 175 | (modify-phases %standard-phases
|
| 176 | (delete 'configure))))
|
| 177 | (home-page "https://github.com/jhawthorn/fzy")
|
| 178 | (synopsis "Fast fuzzy text selector for the terminal with an advanced
|
| 179 | scoring algorithm")
|
| 180 | (description
|
| 181 | "Most other fuzzy matchers sort based on the length of a match. fzy tries
|
| 182 | to find the result the user intended. It does this by favouring matches on
|
| 183 | consecutive letters and starts of words. This allows matching using acronyms
|
| 184 | or different parts of the path.
|
| 185 |
|
| 186 | fzy is designed to be used both as an editor plugin and on the command
|
| 187 | line. Rather than clearing the screen, fzy displays its interface directly
|
| 188 | below the current cursor position, scrolling the screen if necessary.")
|
| 189 | (license expat)))
|
| 190 |
|
| 191 | (define-public hstr
|
| 192 | (package
|
| 193 | (name "hstr")
|
| 194 | (version "2.0")
|
| 195 | (source (origin
|
| 196 | (method url-fetch)
|
| 197 | (uri (string-append "https://github.com/dvorka/" name "/archive/"
|
| 198 | version ".tar.gz"))
|
| 199 | (sha256
|
| 200 | (base32
|
| 201 | "0yk2008bl48hv0v3c90ngq4y45h3nxif2ik6s3l7kag1zs5yv4wd"))
|
| 202 | (file-name (string-append name "-" version ".tar.gz"))))
|
| 203 | (build-system gnu-build-system)
|
| 204 | (arguments
|
| 205 | `(#:phases
|
| 206 | (modify-phases %standard-phases
|
| 207 | (add-before 'build 'adjust-ncurses-includes
|
| 208 | (lambda* (#:key make-flags outputs #:allow-other-keys)
|
| 209 | (let ((out (assoc-ref outputs "out")))
|
| 210 | (substitute* "src/include/hstr_curses.h"
|
| 211 | (("ncursesw\\/curses.h") "ncurses.h"))
|
| 212 | (substitute* "src/include/hstr.h"
|
| 213 | (("ncursesw\\/curses.h") "ncurses.h")))
|
| 214 | #t)))))
|
| 215 | (native-inputs
|
| 216 | `(("autoconf" ,autoconf)
|
| 217 | ("automake" ,automake)
|
| 218 | ("pkg-config" ,pkg-config)))
|
| 219 | (inputs
|
| 220 | `(("ncurses" ,ncurses)
|
| 221 | ("readline" ,readline)))
|
| 222 | (synopsis "Navigate and search command history with shell history suggest box")
|
| 223 | (description "HSTR (HiSToRy) is a command-line utility that brings
|
| 224 | improved Bash and Zsh command completion from the history. It aims to make
|
| 225 | completion easier and more efficient than with @kbd{Ctrl-R}. It allows you to
|
| 226 | easily view, navigate, and search your command history with suggestion boxes.
|
| 227 | HSTR can also manage your command history (for instance you can remove
|
| 228 | commands that are obsolete or contain a piece of sensitive information) or
|
| 229 | bookmark your favourite commands.")
|
| 230 | (home-page "http://me.mindforger.com/projects/hh.html")
|
| 231 | (license asl2.0)))
|