From d084e71c0d0f97dccf6a792e6975435de5c0bc38 Mon Sep 17 00:00:00 2001 From: Brice Waegeneire Date: Fri, 8 May 2020 11:36:12 +0200 Subject: gnu: wireguard-tools: Fix wg-quick. * gnu/packages/vpn.scm (wireguard-tools)[arguments]: Add phase 'wrap-wg-quick'. [inputs]: Add 'openresolv', 'iproute' and 'iptables'. --- gnu/packages/vpn.scm | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm index ebae1c43f7..369d3200c1 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,33 @@ WireGuard was added to Linux 5.6.") #:phases (modify-phases %standard-phases ;; No configure script - (delete 'configure)))) + (delete 'configure) + (add-after 'install 'install-contrib-docs + (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" ":" prefix ,(append inputs-sbin + (list coreutils)))) + #t)))))) + (inputs + `(("resolvconf" ,openresolv) + ("coreutils" ,coreutils) + ("bash" ,bash) ; for scripts using /dev/tcp + ("procps" ,procps) + ("iproute" ,iproute) + ("iptables" ,iptables))) (home-page "https://www.wireguard.com/") (synopsis "Tools for configuring WireGuard tunnels") (description -- cgit v1.2.3