unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Brice Waegeneire <brice@waegenei.re>
To: 41192@debbugs.gnu.org
Subject: [bug#41192] [PATCH 2/2] gnu: wireguard-tools: Fix wg-quick.
Date: Mon, 11 May 2020 20:53:10 +0200	[thread overview]
Message-ID: <20200511185310.24537-2-brice@waegenei.re> (raw)
In-Reply-To: <20200511184312.21587-1-brice@waegenei.re>

* gnu/packages/vpn.scm (wireguard-tools)[arguments]: Add phase
'wrap-wg-quick'.
[inputs]: Add 'openresolv', 'iproute' and 'iptables'.
---
 gnu/packages/vpn.scm | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

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
-- 
2.26.2





  parent reply	other threads:[~2020-05-11 18:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 18:43 [bug#41192] [PATCH 0/2] wireguard-tools: Fix wg-quick Brice Waegeneire
2020-05-11 18:53 ` [bug#41192] [PATCH 1/2] gnu: Add openresolv Brice Waegeneire
2020-05-11 19:52   ` Leo Famulari
2020-05-12 20:34     ` Brice Waegeneire
2020-05-11 18:53 ` Brice Waegeneire [this message]
2020-05-11 19:58   ` [bug#41192] [PATCH 2/2] gnu: wireguard-tools: Fix wg-quick Leo Famulari
2020-05-12 20:57     ` Brice Waegeneire
2020-05-12 21:01 ` [bug#41192] [PATCH v2 0/2] " Brice Waegeneire
2020-05-12 21:01   ` [bug#41192] [PATCH v2 1/2] gnu: Add openresolv Brice Waegeneire
2020-05-12 21:01   ` [bug#41192] [PATCH v2 2/2] gnu: wireguard-tools: Fix wg-quick Brice Waegeneire
2020-05-12 21:28   ` [bug#41192] [PATCH v2 0/2] " Leo Famulari
2020-05-13  9:28     ` bug#41192: " Brice Waegeneire

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=20200511185310.24537-2-brice@waegenei.re \
    --to=brice@waegenei.re \
    --cc=41192@debbugs.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).