From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] gnu: powertop: Patch absolute file names. Date: Mon, 25 Apr 2016 23:48:46 +0200 Message-ID: <8760v5bbr5.fsf@gnu.org> References: <1461013301-13196-1-git-send-email-mthl@gnu.org> <20160421003400.GA18423@debian-netbook> <87lh47z2sj.fsf@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]:51257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auoNE-0006SX-Jm for guix-devel@gnu.org; Mon, 25 Apr 2016 17:48:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1auoND-0005VU-NY for guix-devel@gnu.org; Mon, 25 Apr 2016 17:48:56 -0400 In-Reply-To: <87lh47z2sj.fsf@gnu.org> (Mathieu Lirzin's message of "Thu, 21 Apr 2016 12:14:52 +0200") 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: Mathieu Lirzin Cc: guix-devel@gnu.org Mathieu Lirzin skribis: > Efraim Flashner writes: > >> On Mon, Apr 18, 2016 at 11:01:41PM +0200, Mathieu Lirzin wrote: >> >>> + (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/modprob= e")) >>> + ;; These programs are only needed to calibrate, so us= ing >>> + ;; relative file names avoids adding extra inputs. W= hen they >>> + ;; are missing powertop gracefully handle it. >>> + (("/usr/bin/xset") "xset") >>> + (("/usr/sbin/hciconfig") "hciconfig") ;XXX:not packag= ed yet >>> + (("/usr/bin/hcitool") "hcitool")) ;XXX:not packag= ed yet >> >> hci* programs are part of the bluez package. According to apt-file, >> debian has xset as part of x11-xserver-utils. > > Thank you for taking to search this. :) I don't intend to package > "bluez" since I have no use of Bluetooth, and xset is already packaged > in Guix. Those programs are called when doing =E2=80=98powertop --calibr= ate=E2=80=99 > like this: > > if(!system("DISPLAY=3D:0 /usr/bin/xset dpms force off")) > printf("System is not available\n"); >=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 > So IMO adding them as explicit inputs will not make sense since those > =E2=80=98system=E2=80=99 calls are meant as feature tests. WDYT? Agreed. It=E2=80=99s OK to have them searched in $PATH as needed, so the p= atch above is OK (without =E2=80=9CXXX=E2=80=9D comments even.) Thanks, Ludo=E2=80=99.