unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: powertop: Patch absolute file names.
@ 2016-04-18 21:01 Mathieu Lirzin
  2016-04-19  6:19 ` Ricardo Wurmus
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Mathieu Lirzin @ 2016-04-18 21:01 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/linux.scm (powertop)[inputs]: Add kmod.
[arguments]: Patch absolute file names.  Before that launching powertop
was failing because 'modprobe' was not found.
---
 gnu/packages/linux.scm | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index d554ecc..88afa8e 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2016 Tobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>
 ;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
 ;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
+;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1202,11 +1203,29 @@ devices.  It replaces 'iwconfig', which is deprecated.")
         (base32
          "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
     (build-system gnu-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
+         ;; allow calibrating the network interface in GuixSD.
+         (add-after 'unpack 'patch-absolute-file-names
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((kmod (assoc-ref inputs "kmod")))
+               (substitute* (find-files "src" ".*\\.cpp" )
+                 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
+                 ;; These programs are only needed to calibrate, so using
+                 ;; relative file names avoids adding extra inputs.  When they
+                 ;; are missing powertop gracefully handle it.
+                 (("/usr/bin/xset") "xset")
+                 (("/usr/sbin/hciconfig") "hciconfig") ;XXX:not packaged yet
+                 (("/usr/bin/hcitool") "hcitool"))     ;XXX:not packaged yet
+               #t))))))
     (inputs
-     `(("zlib" ,zlib)
-       ("pciutils" ,pciutils)
+     `(("kmod" ,kmod)
        ("ncurses" ,ncurses)
-       ("libnl" ,libnl)))
+       ("pciutils" ,pciutils)
+       ("libnl" ,libnl)
+       ("zlib" ,zlib)))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (home-page "https://01.org/powertop/")
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-04-25 21:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-18 21:01 [PATCH] gnu: powertop: Patch absolute file names Mathieu Lirzin
2016-04-19  6:19 ` Ricardo Wurmus
2016-04-19  9:29   ` Mathieu Lirzin
2016-04-21  0:34 ` Efraim Flashner
2016-04-21 10:14   ` Mathieu Lirzin
2016-04-25 21:48     ` Ludovic Courtès
2016-04-23  3:41 ` Mark H Weaver
2016-04-23 12:12   ` Mathieu Lirzin
2016-04-25 21:52     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).