gnu: Add wireguard-linux-compat.

* gnu/packages/vpn.scm (wireguard-linux-compat): New variable.
(wireguard): Deprecate in favor of wireguard-tools.
This commit is contained in:
Leo Famulari 2020-04-03 01:12:00 -04:00
parent 1ba85062c2
commit 336d7644b3
No known key found for this signature in database
GPG key ID: 2646FA30BACA7F08

View file

@ -453,61 +453,47 @@ (define-public badvpn
;; 3-clause BSD license. ;; 3-clause BSD license.
(license license:bsd-3))) (license license:bsd-3)))
(define-public wireguard (define-public wireguard-linux-compat
(package (package
(name "wireguard") (name "wireguard-linux-compat")
(version "0.0.20191219") (version "1.0.20200401")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append "https://git.zx2c4.com/WireGuard/snapshot/" (uri (string-append "https://git.zx2c4.com/wireguard-linux-compat/"
"WireGuard-" version ".tar.xz")) "snapshot/wireguard-linux-compat-" version
".tar.xz"))
(sha256 (sha256
(base32 (base32
"1rxhhf18vnlbxpaxib6y55gbvr5h9dcvl8sn2l5slzz97066zfjs")))) "0ymprz3h4b92wlcqm5k5vmcgap8pjv202bgkdx0axmp12n1lmyvx"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(outputs '("out" ; The WireGuard userspace tools
"kernel-patch")) ; A patch to build Linux with WireGuard support
(arguments (arguments
`(#:tests? #f ; No tests available. `(#:tests? #f ; No test suite
#: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) #:modules ((guix build gnu-build-system)
(guix build utils) (guix build utils)
(ice-9 popen) (ice-9 popen)
(ice-9 textual-ports)) (ice-9 textual-ports))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
;; There is no ./configure script. (delete 'configure) ; No ./configure script
(delete 'configure) (replace 'build
;; 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) (lambda* (#:key outputs #:allow-other-keys)
(let* ((output (string-append (assoc-ref outputs "kernel-patch") (let* ((patch-builder "./kernel-tree-scripts/create-patch.sh")
"/wireguard.patch"))
(patch-builder "./contrib/kernel-tree/create-patch.sh")
(port (open-input-pipe patch-builder)) (port (open-input-pipe patch-builder))
(str (get-string-all port))) (str (get-string-all port)))
(close-pipe port) (close-pipe port)
(mkdir-p (dirname output)) (call-with-output-file "wireguard.patch"
(call-with-output-file output
(lambda (port) (lambda (port)
(format port "~a" str)))) (format port "~a" str))))
#t))))) #t))
(inputs (replace 'install
`(("libmnl" ,libmnl))) (lambda* (#:key outputs #:allow-other-keys)
(home-page "https://www.wireguard.com/") (install-file "wireguard.patch"
(synopsis "Tools for configuring WireGuard") (assoc-ref %outputs "out"))
(description "This package provides the userspace tools for setting and #t)))))
retrieving configuration of WireGuard network tunnel interfaces, and a patch (home-page "https://git.zx2c4.com/wireguard-linux-compat/")
that can be applied to a Linux kernel source tree in order to build it with (synopsis "WireGuard kernel module for Linux 3.10 through 5.5")
WireGuard support.") (description "This is an out-of-tree Linux kernel patch adding WireGuard to
kernel versions 3.10 through 5.5. WireGuard was added to Linux 5.6.")
(license license:gpl2))) (license license:gpl2)))
(define-public wireguard-tools (define-public wireguard-tools
@ -556,6 +542,9 @@ (define-public wireguard-tools
(list license:lgpl2.1+ ; src/netlink.h & contrib/embeddable-wg-library (list license:lgpl2.1+ ; src/netlink.h & contrib/embeddable-wg-library
license:gpl2)))) ; everything else license:gpl2)))) ; everything else
(define-public wireguard
(deprecated-package "wireguard" wireguard-tools))
(define-public xl2tpd (define-public xl2tpd
(package (package
(name "xl2tpd") (name "xl2tpd")