From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Lirzin Subject: [PATCH] gnu: powertop: Patch absolute file names. Date: Mon, 18 Apr 2016 23:01:41 +0200 Message-ID: <1461013301-13196-1-git-send-email-mthl@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asGIw-0004ku-Im for guix-devel@gnu.org; Mon, 18 Apr 2016 17:01:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asGIr-0001qm-JH for guix-devel@gnu.org; Mon, 18 Apr 2016 17:01:58 -0400 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * 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 =C2=A9 2016 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2016 Alex Kost ;;; Copyright =C2=A9 2016 Raymond Nicholson +;;; Copyright =C2=A9 2016 Mathieu Lirzin ;;; ;;; This file is part of GNU Guix. ;;; @@ -1202,11 +1203,29 @@ devices. It replaces 'iwconfig', which is deprec= ated.") (base32 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8")))) (build-system gnu-build-system) + (arguments + '(#:phases + (modify-phases %standard-phases + ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cp= p 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 usin= g + ;; relative file names avoids adding extra inputs. Whe= n 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/") --=20 2.7.3