summary refs log tree commit diff
path: root/gnu/packages/vpn.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/vpn.scm')
-rw-r--r--gnu/packages/vpn.scm84
1 files changed, 43 insertions, 41 deletions
diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index becc505b34..a9e20049c6 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2019, 2020 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -34,6 +35,7 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system linux-module)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages admin)
@@ -243,17 +245,17 @@ the user specifically asks to proxy, so the @dfn{VPN} interface no longer
 (define-public openconnect
   (package
    (name "openconnect")
-   (version "8.05")
+   (version "8.08")
    (source (origin
             (method url-fetch)
             (uri (string-append "ftp://ftp.infradead.org/pub/openconnect/"
                                 "openconnect-" version ".tar.gz"))
             (sha256
-             (base32 "14i9q727c2zc9xhzp1a9hz3gzb5lwgsslbhircm84dnbs192jp1k"))))
+             (base32 "1s3rjdazx1n5izpcgz05p1sirm7kf4z3gh26dq2h2j5xmgmk0jxp"))))
    (build-system gnu-build-system)
    (propagated-inputs
     `(("libxml2" ,libxml2)
-      ("gnutls" ,gnutls)
+      ("gnutls" ,gnutls-3.6.13)
       ("zlib" ,zlib)))
    (inputs
     `(("vpnc-scripts" ,vpnc-scripts)))
@@ -453,61 +455,58 @@ The peer-to-peer VPN implements a Layer 2 (Ethernet) network between the peers
     ;; 3-clause BSD license.
     (license license:bsd-3)))
 
-(define-public wireguard
+(define-public wireguard-linux-compat
   (package
-    (name "wireguard")
-    (version "0.0.20191219")
+    (name "wireguard-linux-compat")
+    (version "1.0.20200401")
     (source (origin
               (method url-fetch)
-              (uri (string-append "https://git.zx2c4.com/WireGuard/snapshot/"
-                                  "WireGuard-" version ".tar.xz"))
+              (uri (string-append "https://git.zx2c4.com/wireguard-linux-compat/"
+                                  "snapshot/wireguard-linux-compat-" version
+                                  ".tar.xz"))
               (sha256
                (base32
-                "1rxhhf18vnlbxpaxib6y55gbvr5h9dcvl8sn2l5slzz97066zfjs"))))
-    (build-system gnu-build-system)
-    (outputs '("out" ; The WireGuard userspace tools
-               "kernel-patch")) ; A patch to build Linux with WireGuard support
+                "0ymprz3h4b92wlcqm5k5vmcgap8pjv202bgkdx0axmp12n1lmyvx"))))
+    (build-system linux-module-build-system)
+    (outputs '("out"
+               "kernel-patch"))
     (arguments
-     `(#:tests? #f ; No tests available.
-       #:make-flags
-       (list "CC=gcc"
-             "--directory=src/tools"
-             "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)
+     `(#:tests? #f ; No test suite
+       #:modules ((guix build linux-module-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
+         (add-before 'build 'change-directory
+           (lambda _
+             (chdir "./src")
+             #t))
+         (add-after 'build 'build-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")
+             (let* ((patch-builder "../kernel-tree-scripts/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
+               (call-with-output-file "wireguard.patch"
                  (lambda (port)
                    (format port "~a" str))))
-               #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.")
+               #t))
+         (add-after 'install 'install-patch
+           (lambda* (#:key outputs #:allow-other-keys)
+             (install-file "wireguard.patch"
+                           (assoc-ref %outputs "kernel-patch"))
+             #t))
+         ;; So that 'install-license-files' works...
+         (add-before 'install-license-files 'reset-cwd
+           (lambda _
+             (chdir "..")
+             #t)))))
+    (home-page "https://git.zx2c4.com/wireguard-linux-compat/")
+    (synopsis "WireGuard kernel module for Linux 3.10 through 5.5")
+    (description "This package contains an out-of-tree kernel patch and
+a loadable module adding WireGuard to Linux kernel versions 3.10 through 5.5.
+WireGuard was added to Linux 5.6.")
     (license license:gpl2)))
 
 (define-public wireguard-tools
@@ -556,6 +555,9 @@ public keys and can roam across IP addresses.")
      (list license:lgpl2.1+    ; src/netlink.h & contrib/embeddable-wg-library
            license:gpl2))))    ; everything else
 
+(define-public wireguard
+  (deprecated-package "wireguard" wireguard-tools))
+
 (define-public xl2tpd
   (package
     (name "xl2tpd")