unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mathieu Lirzin <mthl@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] gnu: powertop: Patch absolute file names.
Date: Mon, 25 Apr 2016 23:48:46 +0200	[thread overview]
Message-ID: <8760v5bbr5.fsf@gnu.org> (raw)
In-Reply-To: <87lh47z2sj.fsf@gnu.org> (Mathieu Lirzin's message of "Thu, 21 Apr 2016 12:14:52 +0200")

Mathieu Lirzin <mthl@gnu.org> skribis:

> Efraim Flashner <efraim@flashner.co.il> 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/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
>>
>> 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 ‘powertop --calibrate’
> like this:
>
>   if(!system("DISPLAY=:0 /usr/bin/xset dpms force off"))
>     printf("System is not available\n");
>                 
> So IMO adding them as explicit inputs will not make sense since those
> ‘system’ calls are meant as feature tests.  WDYT?

Agreed.  It’s OK to have them searched in $PATH as needed, so the patch
above is OK (without “XXX” comments even.)

Thanks,
Ludo’.

  reply	other threads:[~2016-04-25 21:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2016-04-23  3:41 ` Mark H Weaver
2016-04-23 12:12   ` Mathieu Lirzin
2016-04-25 21:52     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8760v5bbr5.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=mthl@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).