summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2019-05-05 00:09:43 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2019-05-05 00:10:44 +0200
commitc8e214e80d3bc4d6e63d2be1648fd2ac05eebc1a (patch)
treeb8e77ac926db1e60f6b1bdb792f97e647f852c60 /gnu
parent4d3990c9f38fd66037a2682367a8e36617ed5099 (diff)
downloadguix-c8e214e80d3bc4d6e63d2be1648fd2ac05eebc1a.tar.gz
gnu: wgetpaste: Make all dependencies explicit.
* gnu/packages/wget.scm (wgetpaste)[arguments]: Replace limited
‘use-inputs’ phase with a ‘wrap-program’ one.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/wget.scm25
1 files changed, 17 insertions, 8 deletions
diff --git a/gnu/packages/wget.scm b/gnu/packages/wget.scm
index b503b6fc0b..93a40c487a 100644
--- a/gnu/packages/wget.scm
+++ b/gnu/packages/wget.scm
@@ -89,17 +89,13 @@ in downloaded documents to relative links.")
           "1hh9svyypqcvdg5mjxyyfzpdzhylhf7s7xq5dzglnm4injx3i3ak"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:phases
+     '(#:modules ((guix build gnu-build-system)
+                  (guix build utils)
+                  (srfi srfi-1))
+       #:phases
        (modify-phases %standard-phases
          (delete 'configure)
          (delete 'build)
-         (add-before 'install 'use-inputs
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let* ((wget (assoc-ref inputs "wget")))
-               (substitute* "wgetpaste"
-                 (("(LC_ALL=C) wget" _ prefix)
-                  (format "~a ~a/bin/wget" prefix wget)))
-               #t)))
          (replace 'install
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
@@ -107,6 +103,19 @@ in downloaded documents to relative links.")
                     (zsh (string-append out "/share/zsh/site-functions")))
                (install-file "wgetpaste" bin)
                (install-file "_wgetpaste" zsh)
+               #t)))
+         (add-after 'install 'wrap-program
+           ;; /bin/wgetpaste prides itself on relying only on the following
+           ;; inputs, and doesn't need to execute arbitrary commands, so
+           ;; override PATH completely to detect any new dependencies early.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (wrap-program (string-append out "/bin/wgetpaste")
+                 `("PATH" ":" =
+                   ,(delete-duplicates
+                     (map (lambda (command) (dirname (which command)))
+                          (list "bash" "mktemp" "sed" "sort" "tee" "tr"
+                                "wget")))))
                #t))))
        #:tests? #f))                    ; no test target
     (inputs