>From efb3e50fe4c86b1bf25fee50a481b45d28c5ff45 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Mon, 18 Apr 2016 17:00:44 +0200 Subject: [PATCH] gnu: powertop: Patch absolute file names. * gnu/packages/linux.scm (powertop)[inputs]: Add kmod. [arguments]: Patch absolute file names. --- gnu/packages/linux.scm | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index a26e641..9efbe22 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -1203,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 handles it. + (("/usr/bin/hcitool") "hcitool") ;XXX:not packaged yet + (("/usr/bin/xset") "xset") + (("/usr/sbin/hciconfig") "hciconfig")) ;XXX:not packaged yet + #t)))))) (inputs - `(("zlib" ,zlib) - ("pciutils" ,pciutils) + `(("kmod" ,kmod) + ("libnl" ,libnl) ("ncurses" ,ncurses) - ("libnl" ,libnl))) + ("pciutils" ,pciutils) + ("zlib" ,zlib))) (native-inputs `(("pkg-config" ,pkg-config))) (home-page "https://01.org/powertop/") -- 2.8.0.rc3