guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: guix-commits
Subject: 03/04: gnu: tlp: Add required x86-energy-perf-policy input dependency.
Date: Mon, 27 May 2019 10:53:06 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit cf342a859820c76ab749db3ac5e630ba09a9ad26
Author: Stefan Stefanović <address@hidden>
Date:   Sat Apr 20 16:13:37 2019 +0200

    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 <address@hidden>
---
 gnu/packages/linux.scm | 53 +++++++++++++++++++++++++++++++-------------------
 1 file changed, 33 insertions(+), 20 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index a801e50..67085f3 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4601,10 +4601,19 @@ interface in sysfs, which can be accomplished with the 
included udev rules.")
               ("sed" ,sed)
               ("usbutils" ,usbutils)
               ("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)
     (arguments
-     `(#:phases
+     `(#:modules ((guix build gnu-build-system)
+                  (guix build utils)
+                  (srfi srfi-1))
+       #:phases
        (modify-phases %standard-phases
          (delete 'configure)            ; no configure script
          (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"))
                     (bin-files (find-files bin ".*")))
                (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)
                  (string-append (assoc-ref inputs input-name) "/sbin"))
                (for-each (lambda (program)
                            (wrap-program program
                              `("PATH" ":" prefix
                                ,(append
-                                 (map bin-directory '("bash"
-                                                      "coreutils"
-                                                      "dbus"
-                                                      "eudev"
-                                                      "grep"
-                                                      "inetutils"
-                                                      "kmod"
-                                                      "perl"
-                                                      "sed"
-                                                      "usbutils"
-                                                      "util-linux"))
-                                 (map sbin-directory '("ethtool"
-                                                       "hdparm"
-                                                       "iw"
-                                                       "pciutils"
-                                                       "rfkill"
-                                                       "wireless-tools"))))))
+                                 (filter-map bin-directory
+                                             '("bash"
+                                               "coreutils"
+                                               "dbus"
+                                               "eudev"
+                                               "grep"
+                                               "inetutils"
+                                               "kmod"
+                                               "perl"
+                                               "sed"
+                                               "usbutils"
+                                               "util-linux"
+                                               "x86-energy-perf-policy"))
+                                 (filter-map sbin-directory
+                                             '("ethtool"
+                                               "hdparm"
+                                               "iw"
+                                               "pciutils"
+                                               "rfkill"
+                                               "wireless-tools"))))))
                          bin-files)
                #t))))))
     (home-page "http://linrunner.de/en/tlp/tlp.html";)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]