[bug#34643,2/2] gnu: Add linux-libre with WireGuard.

Message ID ad303878f387c03921da8c570886ae8308f0ee22.1551057302.git.leo@famulari.name
State Accepted
Headers show
Series [bug#34643,1/2] gnu: Add WireGuard. | expand

Checks

Context Check Description
cbaines/applying patch success Successfully applied
cbaines/applying patch fail Apply failed

Commit Message

Leo Famulari Feb. 25, 2019, 1:15 a.m. UTC
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(+)

Patch

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