diff options
| author | Oleg Pykhalov <go.wigust@gmail.com> | 2018-04-16 12:18:20 +0300 |
|---|---|---|
| committer | Oleg Pykhalov <go.wigust@gmail.com> | 2018-04-16 12:19:59 +0300 |
| commit | bd95d657c5a87c7b0d408e568adf6f9e73e5cee5 (patch) | |
| tree | ccccc65c67d363453025d2985fefa8248b07f65b | |
| parent | wigust: inxi: Use git procedures for version and file-name. (diff) | |
| download | guix-wigust-bd95d657c5a87c7b0d408e568adf6f9e73e5cee5.tar.gz | |
wigust: inxi: Search for inputs automatically.
* wigust/packages/inxi.scm (inxi): Search for inputs automatically.
| -rw-r--r-- | wigust/packages/inxi.scm | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/wigust/packages/inxi.scm b/wigust/packages/inxi.scm index ae57d15..6b0da17 100644 --- a/wigust/packages/inxi.scm +++ b/wigust/packages/inxi.scm @@ -31,7 +31,8 @@ #:use-module (gnu packages linux) #:use-module (gnu packages xorg) #:use-module (gnu packages gl) - #:use-module (gnu packages admin)) + #:use-module (gnu packages admin) + #:use-module (ice-9 match)) (define-public inxi ;; TODO: Add more inputs. @@ -66,30 +67,27 @@ ("dmidecode" ,dmidecode))) (arguments `(#:modules - ((guix build utils)) + ((guix build utils) + (ice-9 match)) #:builder (begin - (use-modules (guix build utils)) + (use-modules (guix build utils) + (ice-9 match)) (setenv "PATH" (string-append (assoc-ref %build-inputs "tar") "/bin" ":" - (assoc-ref %build-inputs "gzip") "/bin")) + (assoc-ref %build-inputs "gzip") "/bin" ":" + (assoc-ref %build-inputs "bash") "/bin")) (system* "tar" "xvf" (assoc-ref %build-inputs "source")) - ;; Many commands (like glxinfo) better be searched as words. - ;; See SRFI-115. - (with-fluids ((%default-port-encoding #f)) - (substitute* "inxi" - (("/usr/bin/env bash") - (string-append (assoc-ref %build-inputs "bash") "/bin/bash")) - (("xdpyinfo") - (string-append (assoc-ref %build-inputs "xdpyinfo") - "/bin/xdpyinfo")) - (("glxinfo") - (string-append (assoc-ref %build-inputs "mesa-utils") - "/bin/glxinfo")) - (("dmidecode") - (string-append (assoc-ref %build-inputs "dmidecode") - "/bin/dmidecode")))) - (install-file "inxi" (string-append %output "/bin")) + (substitute* "inxi" (("/usr/bin/env bash") (which "bash"))) + (let ((bin (string-append %output "/bin"))) + (install-file "inxi" bin) + (wrap-program (string-append bin "/inxi") + `("PATH" ":" = ("$PATH" + ,@(map (lambda (input) + (string-append + (match input ((name . store) store)) + "/bin")) + %build-inputs))))) (install-file "inxi.1.gz" (string-append %output "/share/doc/man/man1")) #t))) |
