blob: edde151aa4249c38ca8429bfe2aa22990241a278 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
# wireguard version
_ver=1.0.20200330
_rel=0
# kernel version
_kver=5.4.29
_krel=0
_kpkgver="$_kver-r$_krel"
# for custom kernels set $FLAVOR
_extra_flavors=
if [ -z "$FLAVOR" ]; then
_flavor=lts
case $CARCH in
x86|x86_64) _extra_flavors="virt";;
esac
else
_flavor=$FLAVOR
fi
_kpkg=linux-$_flavor
pkgname=wireguard-$_flavor
pkgver=$_kver
pkgrel=$(( $_rel + $_krel))
pkgdesc="Next generation secure network tunnel: kernel modules for $_flavor"
arch="all !armhf"
url="https://www.wireguard.com"
license="GPL-2.0"
depends="linux-$_flavor=$_kpkgver"
makedepends="
libmnl-dev
linux-$_flavor-dev=$_kpkgver
linux-firmware-none
"
install_if="wireguard-tools-wg linux-$_flavor=$_kpkgver"
options="!check"
source="https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-$_ver.tar.xz
hack-5.4.29.patch
"
builddir="$srcdir"/wireguard-linux-compat-$_ver
for f in $_extra_flavors; do
makedepends="$makedepends linux-$f-dev=$_kpkgver"
subpackages="$subpackages wireguard-$f:_extra"
done
prepare() {
default_prepare
if [ -z "$FLAVOR" ]; then
( . "$startdir"/../../main/linux-$_flavor/APKBUILD
[ "$_kver" != "$pkgver" ] && die "please update _kver to $pkgver"
[ "$_krel" != "$pkgrel" ] && die "please update _krel to $pkgrel"
return 0
)
fi
local flavor=
for flavor in $_flavor $_extra_flavors; do
cp -r "$builddir" "$srcdir"/$flavor
done
}
build() {
unset LDFLAGS
local flavor= kabi=
for flavor in $_flavor $_extra_flavors; do
kabi="$_kver-$_krel-$flavor"
make -C "$srcdir/$flavor"/src \
KERNELDIR=/lib/modules/$kabi/build module
done
}
package() {
local kabi="$_kver-$_krel-$_flavor"
install -Dm644 "$srcdir"/$_flavor/src/wireguard.ko \
"$pkgdir/lib/modules/$kabi/extra/wireguard.ko"
}
_extra() {
flavor=${subpkgname##*-}
depends="linux-$flavor=$_kpkgver"
install_if="wireguard-tools-wg linux-$flavor=$_kpkgver"
pkgdesc="Next generation secure network tunnel: kernel modules for $flavor"
local kabi="$_kver-$_krel-$flavor"
install -Dm644 "$srcdir"/virt/src/wireguard.ko \
"$subpkgdir/lib/modules/$kabi/extra/wireguard.ko"
}
sha512sums="b133f530f9e7a38b837c119fb5defa3af702cdcf2407f847a078a94a92598216074e7bbd26d27c86a998a79480ba10a99825debf20aff94de80a943892fa856b wireguard-linux-compat-1.0.20200330.tar.xz
927825a584b5e8cbe5e3a17c3b29c2c06f8a9444a32dccfb3a24d21c0486d598a30456f7e132c5b83d98c9e018b6e682f29915e90bfa96c115831e1785565f1c hack-5.4.29.patch"
|