From d7c40f057213a8035bb5dd2f8ffa49faa7078f71 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Thu, 21 Dec 2023 10:30:50 +0200 Subject: [PATCH] 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 --- gnu/packages/rust-apps.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index 0be3b2b08d..4454178624 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -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