guix-commits
[Top][All Lists]
Advanced

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

01/01: gnu: Add WireGuard.


From: guix-commits
Subject: 01/01: gnu: Add WireGuard.
Date: Fri, 1 Mar 2019 19:31:38 -0500 (EST)

lfam pushed a commit to branch master
in repository guix.

commit 7a0479bb7b8535acad2bf36c7a0b0498a1313422
Author: Leo Famulari <address@hidden>
Date:   Fri Mar 1 19:30:51 2019 -0500

    gnu: Add WireGuard.
    
    * gnu/packages/vpn.scm (wireguard): New variable.
---
 gnu/packages/vpn.scm | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index e135fde..f15b111 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2017 Julien Lepiller <address@hidden>
 ;;; Copyright © 2018 Pierre Langlois <address@hidden>
 ;;; Copyright © 2018 Meiyo Peng <address@hidden>
+;;; Copyright © 2019 Leo Famulari <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -449,3 +450,68 @@ The peer-to-peer VPN implements a Layer 2 (Ethernet) 
network between the peers
     ;; This project contains a bundled lwIP. lwIP is also released under the
     ;; 3-clause BSD license.
     (license license:bsd-3)))
+
+(define-public wireguard
+  (package
+    (name "wireguard")
+    (version "0.0.20190123")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://git.zx2c4.com/WireGuard/snapshot/";
+                                  "WireGuard-" version ".tar.xz"))
+              (sha256
+               (base32
+                "16yzzy4i0z2zslmyr3kppkvkrxryzwdil6v270w9w5mg65v3rlgd"))))
+    (build-system gnu-build-system)
+    (outputs '("out" ; The WireGuard userspace tools
+               "kernel-patch")) ; A patch to build Linux with WireGuard support
+    (arguments
+     `(#:make-flags
+       (list "CC=gcc"
+             "WITH_BASHCOMPLETION=yes"
+             ;; Build and install the helper script wg-quick(8).
+             "WITH_WGQUICK=yes"
+             (string-append "PREFIX=" (assoc-ref %outputs "out"))
+             (string-append "SYSCONFDIR=" (assoc-ref %outputs "out") "/etc"))
+       #:modules ((guix build gnu-build-system)
+                  (guix build utils)
+                  (ice-9 popen)
+                  (ice-9 textual-ports))
+       #:phases
+       (modify-phases %standard-phases
+         ;; There is no ./configure script.
+         (delete 'configure)
+         ;; Until WireGuard is added to the upstream Linux kernel, it is
+         ;; distributed as a kernel patch generated by this script.
+         (add-after 'patch-source-shebangs 'make-patch
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((output (string-append (assoc-ref outputs "kernel-patch")
+                                           "/wireguard.patch"))
+                    (patch-builder "./contrib/kernel-tree/create-patch.sh")
+                    (port (open-input-pipe patch-builder))
+                    (str (get-string-all port)))
+               (close-pipe port)
+               (mkdir-p (dirname output))
+               (call-with-output-file output
+                 (lambda (port)
+                   (format port "~a" str))))
+               #t))
+         (add-after 'make-patch 'chdir
+           (lambda _
+             (chdir "src/tools")
+             #t))
+         ;; Otherwise the 'install-license-file' phase installs nothing.
+         ;; <https://bugs.gnu.org/34703>
+         (add-after 'install 'reset-cwd
+           (lambda _
+             (chdir "../..")
+             #t)))))
+    (inputs
+     `(("libmnl" ,libmnl)))
+    (home-page "https://www.wireguard.com/";)
+    (synopsis "Tools for configuring WireGuard")
+    (description "This package provides the userspace tools for setting and
+retrieving configuration of WireGuard network tunnel interfaces, and a patch
+that can be applied to a Linux kernel source tree in order to build it with
+WireGuard support.")
+    (license license:gpl2)))



reply via email to

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