commit:     11c0cf5d42363856a3b587fbbff7ade95c1a53ea
Author:     Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 30 15:07:43 2020 +0000
Commit:     Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
CommitDate: Thu Jul 30 15:08:17 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11c0cf5d

net-vpn/wireguard-modules: detect other kernels that already have wireguard

With WireGuard being added to gentoo-sources, we now generalize the
detection, so that people use the built-in WireGuard instead of the
hacky compatibility module.

Package-Manager: Portage-3.0.1, Repoman-2.3.23
Signed-off-by: Jason A. Donenfeld <zx2c4 <AT> gentoo.org>

 net-vpn/wireguard-modules/wireguard-modules-1.0.20200729.ebuild | 6 +++---
 net-vpn/wireguard-modules/wireguard-modules-9999.ebuild         | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net-vpn/wireguard-modules/wireguard-modules-1.0.20200729.ebuild 
b/net-vpn/wireguard-modules/wireguard-modules-1.0.20200729.ebuild
index 16df945c1ab..85fe87ad3b4 100644
--- a/net-vpn/wireguard-modules/wireguard-modules-1.0.20200729.ebuild
+++ b/net-vpn/wireguard-modules/wireguard-modules-1.0.20200729.ebuild
@@ -33,13 +33,13 @@ CONFIG_CHECK="NET INET NET_UDP_TUNNEL CRYPTO_ALGAPI"
 pkg_setup() {
        if use module; then
                linux-mod_pkg_setup
-               if kernel_is -ge 5 6 0; then
+               if [[ -f $KERNEL_DIR/include/uapi/linux/wireguard.h ]]; then
                        eerror
-                       eerror "WireGuard has been merged upstream in Linux 
5.6. Therefore,"
+                       eerror "WireGuard has been merged upstream into this 
kernel. Therefore,"
                        eerror "you no longer need this compatibility ebuild. 
Instead, simply"
                        eerror "enable CONFIG_WIREGUARD=y in your kernel 
configuration."
                        eerror
-                       die "Use CONFIG_WIREGUARD=y for kernels >= 5.6, and do 
not use this package."
+                       die "Use CONFIG_WIREGUARD=y for this kernel, and do not 
use this package."
                elif kernel_is -lt 3 10 0; then
                        die "This version of ${PN} requires Linux >= 3.10."
                fi

diff --git a/net-vpn/wireguard-modules/wireguard-modules-9999.ebuild 
b/net-vpn/wireguard-modules/wireguard-modules-9999.ebuild
index 16df945c1ab..85fe87ad3b4 100644
--- a/net-vpn/wireguard-modules/wireguard-modules-9999.ebuild
+++ b/net-vpn/wireguard-modules/wireguard-modules-9999.ebuild
@@ -33,13 +33,13 @@ CONFIG_CHECK="NET INET NET_UDP_TUNNEL CRYPTO_ALGAPI"
 pkg_setup() {
        if use module; then
                linux-mod_pkg_setup
-               if kernel_is -ge 5 6 0; then
+               if [[ -f $KERNEL_DIR/include/uapi/linux/wireguard.h ]]; then
                        eerror
-                       eerror "WireGuard has been merged upstream in Linux 
5.6. Therefore,"
+                       eerror "WireGuard has been merged upstream into this 
kernel. Therefore,"
                        eerror "you no longer need this compatibility ebuild. 
Instead, simply"
                        eerror "enable CONFIG_WIREGUARD=y in your kernel 
configuration."
                        eerror
-                       die "Use CONFIG_WIREGUARD=y for kernels >= 5.6, and do 
not use this package."
+                       die "Use CONFIG_WIREGUARD=y for this kernel, and do not 
use this package."
                elif kernel_is -lt 3 10 0; then
                        die "This version of ${PN} requires Linux >= 3.10."
                fi

Reply via email to