guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#68675] [PATCH v2] gnu: Add dhcpcd.


From: Ludovic Courtès
Subject: [bug#68675] [PATCH v2] gnu: Add dhcpcd.
Date: Mon, 12 Feb 2024 22:32:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Hi,

soeren@soeren-tempel.net skribis:

> From: Sören Tempel <soeren@soeren-tempel.net>
>
> * gnu/packages/admin.scm (dhcpcd): new procedure.
>
> Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>

Overall LGTM modulo minor stylistic issues:

> +      #:configure-flags #~(list "--enable-ipv6"
> +                                "--enable-privsep"
> +                                "--privsepuser=dhcpcd"
> +                                (string-append "--dbdir=" "/var/db/dhcpcd")
> +                                (string-append "--rundir=" "/var/run/dhcpcd")
> +                                "CC=gcc")

Should be (string-append "CC=" #$(cc-for-target)).

> +                   (add-before 'build 'setenv
> +                     (lambda _
> +                       (setenv "HOST_SH"
> +                               (string-append #$bash-minimal "/bin/sh"))))

Rather (setenv "HOST_SH" (which "sh")).

That way users can still override the shell used by the package.

> +                   (add-after 'install 'wrap-hooks
> +                     (lambda* (#:key inputs outputs #:allow-other-keys)
> +                       (let* ((out (assoc-ref outputs "out"))
> +                              (libexec (string-append out "/libexec"))
> +                              (sed (assoc-ref inputs "sed"))
> +                              (coreutils (assoc-ref inputs "coreutils")))

Rather (search-input-file inputs "/bin/sed") and likewise for coreutils,
and then…

> +                         (wrap-program (string-append libexec
> +                                                      "/dhcpcd-run-hooks")
> +                           `("PATH" ":" suffix
> +                             (,(string-append coreutils "/bin")
> +                              ,(string-append sed "/bin"))))))))))

… use (dirname sed) and (dirname ls), say, to get their /bin directory.

This is more robust than relying on the input label.

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]