Message ID | 20200511185310.24537-2-brice@waegenei.re |
---|---|
State | Accepted |
Headers | show |
Series | wireguard-tools: Fix wg-quick | expand |
Context | Check | Description |
---|---|---|
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
On Mon, May 11, 2020 at 08:53:10PM +0200, Brice Waegeneire wrote: > + (add-after 'install 'install-contrib How about calling this phase "install-docs" or "install-contrib-docs"?. > + (wrap-program (string-append out "/bin/wg-quick") > + `("PATH" ":" = ,(append inputs-sbin > + (list coreutils > + "/run/setuid-programs")))) > + #t)))))) Setuid Guix only exists on Guix System, so we should drop this wrapper. It's okay to make users do `sudo wg-quick` or similar. > + (native-inputs > + `(("bash" ,bash))) ; for contrib scripts using /dev/tcp > + (inputs > + `(("resolvconf" ,openresolv) > + ("coreutils" ,coreutils) Is coreutils not already available in the build environment? > + ("bash" ,bash) ; for contrib scripts using /dev/tcp IIUC, we don't need to include Bash in both 'native-inputs' and 'inputs'. If this Bash will be used at run-time (e.g. as a script shebang), we should just use 'inputs'.
On 2020-05-11 19:58, Leo Famulari wrote: > On Mon, May 11, 2020 at 08:53:10PM +0200, Brice Waegeneire wrote: >> + (add-after 'install 'install-contrib > > How about calling this phase "install-docs" or "install-contrib-docs"?. This is a more informative name, renamed. >> + (wrap-program (string-append out "/bin/wg-quick") >> + `("PATH" ":" = ,(append inputs-sbin >> + (list coreutils >> + >> "/run/setuid-programs")))) >> + #t)))))) > > Setuid Guix only exists on Guix System, so we should drop this wrapper. > It's okay to make users do `sudo wg-quick` or similar. Replaced '=' with 'prefix' and dropped "/run/setuid-programs" from the wrapper. >> + (native-inputs >> + `(("bash" ,bash))) ; for contrib scripts using /dev/tcp >> + (inputs >> + `(("resolvconf" ,openresolv) >> + ("coreutils" ,coreutils) > > Is coreutils not already available in the build environment? > >> + ("bash" ,bash) ; for contrib scripts using >> /dev/tcp > > IIUC, we don't need to include Bash in both 'native-inputs' and > 'inputs'. If this Bash will be used at run-time (e.g. as a script > shebang), we should just use 'inputs'. Only kept in inputs.
diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm index ebae1c43f7..1e31f05c98 100644 --- a/gnu/packages/vpn.scm +++ b/gnu/packages/vpn.scm @@ -40,7 +40,9 @@ #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages check) + #:use-module (gnu packages dns) #:use-module (gnu packages autotools) #:use-module (gnu packages compression) #:use-module (gnu packages gettext) @@ -541,7 +543,36 @@ WireGuard was added to Linux 5.6.") #:phases (modify-phases %standard-phases ;; No configure script - (delete 'configure)))) + (delete 'configure) + (add-after 'install 'install-contrib + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (copy-recursively "contrib/" + (string-append out "/share/doc/wireguard-tools")) + #t))) + (add-after 'install 'wrap-wg-quick + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (inputs-sbin (map (lambda (input) + (string-append (assoc-ref inputs input) "/sbin")) + (list "resolvconf" "iproute" "procps" + "iptables"))) + (coreutils (string-append (assoc-ref inputs "coreutils") + "/bin"))) + (wrap-program (string-append out "/bin/wg-quick") + `("PATH" ":" = ,(append inputs-sbin + (list coreutils + "/run/setuid-programs")))) + #t)))))) + (native-inputs + `(("bash" ,bash))) ; for contrib scripts using /dev/tcp + (inputs + `(("resolvconf" ,openresolv) + ("coreutils" ,coreutils) + ("bash" ,bash) ; for contrib scripts using /dev/tcp + ("procps" ,procps) + ("iproute" ,iproute) + ("iptables" ,iptables))) (home-page "https://www.wireguard.com/") (synopsis "Tools for configuring WireGuard tunnels") (description