gnu: rbw: Install scripts.

* gnu/packages/rust-apps.scm (rbw)[outputs]: Add scripts output.
[arguments]: Add a phase to install the scripts and wrap them.
[inputs]: Add coreutils-minimal, findutils, grep, perl, sed.

Change-Id: I99c6ddc67c50498cb3a2700cdfb4e3651ac17739
This commit is contained in:
Efraim Flashner 2023-12-21 10:30:50 +02:00
parent 1b0adb6ae9
commit d7c40f0572
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -1999,6 +1999,7 @@ (define-public rbw
(package
(name "rbw")
(version "1.8.3")
(outputs '("out" "scripts"))
(source
(origin
(method url-fetch)
@ -2083,11 +2084,32 @@ (define-public rbw
(mkdir-p (string-append share "/elvish/lib"))
(with-output-to-file
(string-append share "/elvish/lib/rbw")
(lambda _ (invoke rbw "gen-completions" "elvish")))))))))
(lambda _ (invoke rbw "gen-completions" "elvish"))))))
(add-after 'install 'install-scripts
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(scripts (assoc-ref outputs "scripts")))
(for-each (lambda (file)
(install-file file (string-append scripts "/bin")))
(find-files "bin"))
(for-each (lambda (file)
(wrap-script file
;; TODO: Do we want to wrap these with more programs?
;; pass git fzf libsecret xclip rofi
`("PATH" prefix
(,(string-append out "/bin")
,(dirname (search-input-file inputs "/bin/grep"))
,(dirname (search-input-file inputs "/bin/sed"))
,(dirname (search-input-file inputs "/bin/perl"))
,(dirname (search-input-file inputs "/bin/xargs"))
,(dirname (search-input-file inputs "/bin/sort"))))))
(find-files (string-append scripts "/bin")))))))))
(native-inputs
(cons* perl (if (%current-target-system)
(list this-package)
'())))
(inputs
(list coreutils-minimal findutils grep perl sed))
(home-page "https://git.tozt.net/rbw")
(synopsis "Unofficial Bitwarden CLI")
(description "This package is an unofficial command line client for