* [bug#34643] WireGuard tools and kernel support
@ 2019-02-25 1:12 Leo Famulari
2019-02-25 1:15 ` [bug#34643] [PATCH 1/2] gnu: Add WireGuard Leo Famulari
0 siblings, 1 reply; 4+ messages in thread
From: Leo Famulari @ 2019-02-25 1:12 UTC (permalink / raw)
To: 34643
[-- Attachment #1: Type: text/plain, Size: 474 bytes --]
Here are patches that add the WireGuard [0] userspace tools and a Linux
kernel patch that can be used to build WireGuard support into the kernel.
When building linux-libre with the WireGuard patch, WireGuard is built
as a module that will be loaded on demand.
The second patch in the series is just for demonstration and personal
use until WireGuard is added to the official kernel tree; I don't think
we need to add it to Guix.
Feedback?
[0] https://www.wireguard.com/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [bug#34643] [PATCH 1/2] gnu: Add WireGuard.
2019-02-25 1:12 [bug#34643] WireGuard tools and kernel support Leo Famulari
@ 2019-02-25 1:15 ` Leo Famulari
2019-02-25 1:15 ` [bug#34643] [PATCH 2/2] gnu: Add linux-libre with WireGuard Leo Famulari
2019-03-02 0:33 ` bug#34643: [PATCH 1/2] gnu: Add WireGuard Leo Famulari
0 siblings, 2 replies; 4+ messages in thread
From: Leo Famulari @ 2019-02-25 1:15 UTC (permalink / raw)
To: 34643
* gnu/packages/linux.scm (wireguard): New variable.
---
gnu/packages/linux.scm | 50 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 6463510eeb..983e335e30 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -19,7 +19,7 @@
;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com>
;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
-;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2017, 2018, 2019 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
@@ -5132,3 +5132,51 @@ the correct permissions and ownership, and then pack them up, or one would
have to construct the archives directly, without using the archiver.")
(home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
(license license:gpl3+)))
+
+(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"))
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure) ; No ./configure script
+ (add-after 'unpack 'make-patch
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((output (assoc-ref outputs "kernel-patch"))
+ (patch-file (string-append output "/wireguard.patch"))
+ (patch-builder "./contrib/kernel-tree/create-patch.sh"))
+ (mkdir-p output)
+ ;; XXX Do this in Scheme?
+ (zero? (system (string-append "bash " patch-builder " > " patch-file)))
+ #t)))
+ (add-after 'make-patch 'chdir
+ (lambda _
+ (chdir "src/tools")
+ #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)))
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [bug#34643] [PATCH 2/2] gnu: Add linux-libre with WireGuard.
2019-02-25 1:15 ` [bug#34643] [PATCH 1/2] gnu: Add WireGuard Leo Famulari
@ 2019-02-25 1:15 ` Leo Famulari
2019-03-02 0:33 ` bug#34643: [PATCH 1/2] gnu: Add WireGuard Leo Famulari
1 sibling, 0 replies; 4+ messages in thread
From: Leo Famulari @ 2019-02-25 1:15 UTC (permalink / raw)
To: 34643
This is a demonstration patch. We don't need to actually include it in Guix.
* gnu/packages/linux.scm (linux-libre-with-wireguard): New variable.
---
gnu/packages/linux.scm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 983e335e30..816c920e48 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -5180,3 +5180,20 @@ 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)))
+
+(define-public linux-libre-with-wireguard
+ (package
+ (inherit linux-libre)
+ (name "linux-libre-with-wireguard")
+ (native-inputs
+ `(("wireguard-patch" ,wireguard "kernel-patch")
+ ,@(package-native-inputs linux-libre)))
+ (arguments
+ (substitute-keyword-arguments (package-arguments linux-libre)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-before 'patch-source-shebangs 'add-wireguard
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let* ((wireguard-patch (string-append (assoc-ref inputs "wireguard-patch")
+ "/wireguard.patch")))
+ (invoke "patch" "-p1" "-i" wireguard-patch))))))))))
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#34643: [PATCH 1/2] gnu: Add WireGuard.
2019-02-25 1:15 ` [bug#34643] [PATCH 1/2] gnu: Add WireGuard Leo Famulari
2019-02-25 1:15 ` [bug#34643] [PATCH 2/2] gnu: Add linux-libre with WireGuard Leo Famulari
@ 2019-03-02 0:33 ` Leo Famulari
1 sibling, 0 replies; 4+ messages in thread
From: Leo Famulari @ 2019-03-02 0:33 UTC (permalink / raw)
To: 34643-done
[-- Attachment #1: Type: text/plain, Size: 203 bytes --]
On Sun, Feb 24, 2019 at 08:15:02PM -0500, Leo Famulari wrote:
> * gnu/packages/linux.scm (wireguard): New variable.
I pushed a modified version of this patch as
7a0479bb7b8535acad2bf36c7a0b0498a1313422
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-03-02 0:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-25 1:12 [bug#34643] WireGuard tools and kernel support Leo Famulari
2019-02-25 1:15 ` [bug#34643] [PATCH 1/2] gnu: Add WireGuard Leo Famulari
2019-02-25 1:15 ` [bug#34643] [PATCH 2/2] gnu: Add linux-libre with WireGuard Leo Famulari
2019-03-02 0:33 ` bug#34643: [PATCH 1/2] gnu: Add WireGuard Leo Famulari
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.