summary refs log tree commit diff
path: root/gnu/packages/rust-apps.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2023-12-21 10:30:50 +0200
committerEfraim Flashner <efraim@flashner.co.il>2024-02-20 13:56:34 +0200
commitd7c40f057213a8035bb5dd2f8ffa49faa7078f71 (patch)
tree5c8c0352d7070eb9ea95fa5d64635c93516ab835 /gnu/packages/rust-apps.scm
parent1b0adb6ae99e0c466fdccad84023a5943f5435ec (diff)
downloadguix-d7c40f057213a8035bb5dd2f8ffa49faa7078f71.tar.gz
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
Diffstat (limited to 'gnu/packages/rust-apps.scm')
-rw-r--r--gnu/packages/rust-apps.scm24
1 files changed, 23 insertions, 1 deletions
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 @@ runs a command whenever it detects modifications.")
   (package
     (name "rbw")
     (version "1.8.3")
+    (outputs '("out" "scripts"))
     (source
      (origin
        (method url-fetch)
@@ -2083,11 +2084,32 @@ runs a command whenever it detects modifications.")
                (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