gnu: tlp: Add required x86-energy-perf-policy input dependency.

* gnu/packages/linux.scm (tlp)
[inputs]: Add system specific x86-energy-perf-policy dependency.
[arguments]<#:phases>['wrap]:
Adjust bin-directory procedure to return #f on missing input,
a guard against system specific input dependencies.
Filter only strings in the path list. Reformat for-each block.
Add x86-energy-perf-policy in bin-directory input-name list.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Stefan Stefanović 2019-04-20 16:13:37 +02:00 committed by Ludovic Courtès
parent 71bd55cb2a
commit cf342a8598
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 33 additions and 20 deletions

View File

@ -4601,10 +4601,19 @@ interface in sysfs, which can be accomplished with the included udev rules.")
("sed" ,sed) ("sed" ,sed)
("usbutils" ,usbutils) ("usbutils" ,usbutils)
("util-linux" ,util-linux) ("util-linux" ,util-linux)
("wireless-tools" ,wireless-tools))) ("wireless-tools" ,wireless-tools)
,@(if (let ((system (or (%current-target-system)
(%current-system))))
(or (string-prefix? "i686-" system)
(string-prefix? "x86_64-" system)))
`(("x86-energy-perf-policy" ,x86-energy-perf-policy))
'())))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:phases `(#:modules ((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1))
#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(delete 'configure) ; no configure script (delete 'configure) ; no configure script
(add-before 'build 'setenv (add-before 'build 'setenv
@ -4642,30 +4651,34 @@ interface in sysfs, which can be accomplished with the included udev rules.")
(let* ((bin (string-append (assoc-ref outputs "out") "/bin")) (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
(bin-files (find-files bin ".*"))) (bin-files (find-files bin ".*")))
(define (bin-directory input-name) (define (bin-directory input-name)
(string-append (assoc-ref inputs input-name) "/bin")) (let ((p (assoc-ref inputs input-name)))
(and p (string-append p "/bin"))))
(define (sbin-directory input-name) (define (sbin-directory input-name)
(string-append (assoc-ref inputs input-name) "/sbin")) (string-append (assoc-ref inputs input-name) "/sbin"))
(for-each (lambda (program) (for-each (lambda (program)
(wrap-program program (wrap-program program
`("PATH" ":" prefix `("PATH" ":" prefix
,(append ,(append
(map bin-directory '("bash" (filter-map bin-directory
"coreutils" '("bash"
"dbus" "coreutils"
"eudev" "dbus"
"grep" "eudev"
"inetutils" "grep"
"kmod" "inetutils"
"perl" "kmod"
"sed" "perl"
"usbutils" "sed"
"util-linux")) "usbutils"
(map sbin-directory '("ethtool" "util-linux"
"hdparm" "x86-energy-perf-policy"))
"iw" (filter-map sbin-directory
"pciutils" '("ethtool"
"rfkill" "hdparm"
"wireless-tools")))))) "iw"
"pciutils"
"rfkill"
"wireless-tools"))))))
bin-files) bin-files)
#t)))))) #t))))))
(home-page "http://linrunner.de/en/tlp/tlp.html") (home-page "http://linrunner.de/en/tlp/tlp.html")