Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
--- a/PKGBUILD 2018-11-20 07:42:48.076332191 -0500
+++ b/PKGBUILD 2018-11-20 09:40:14.684141902 -0500
@@ -1,10 +1,13 @@
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>
+# Contributer: graysky <graysky AT archlinux DOT us>
pkgdesc="Fast, modern, secure VPN tunnel (kernel module)"
-arch=('i686' 'x86_64')
@@ -12,20 +15,18 @@ makedepends=('linux-headers>=3.10' 'xz')
validpgpkeys=('AB9942E6D4A4CFC3412620A749FC7012A5DE03AE') # Jason A. Donenfeld <>
build() {
- cd "WireGuard-$pkgver/src"
- make module
+ cd "$_pkgname-$pkgver"
+ make -C src/ module
package() {
- cd "WireGuard-$pkgver/src"
- find './' -name '*.ko' -exec xz -0 --force {} \;
- install -Dm644 'wireguard.ko.xz' "$pkgdir/usr/lib/modules/extramodules-ARCH/wireguard.ko.xz"
+ cd "$_pkgname-$pkgver"
+ xz -0 src/wireguard.ko
+ install -Dm644 src/wireguard.ko.xz "$pkgdir/usr/lib/modules/$_extramodules/wireguard.ko.xz"

This comment has been minimized.

Copy link

@Chocobo1 Chocobo1 commented Nov 20, 2018

Thank you for providing this package. The below patch will update the PKGBUILD and also make it more general so users of other kernels (and arches) can build this more easily:

Hi @graysky2, thanks for the patch!
I'm not so familiar with other kernels/arches and also not so sure about the changes you made, mind explaining it a bit or pointing out the critical parts?

BTW, since wireguard is actively updating, I'm also considering making the $pkgver to update itself, like the *-git packages, any comments?


This comment has been minimized.

Copy link
Owner Author

@graysky2 graysky2 commented Nov 20, 2018

@Chocobo1 -

Sure: line 11 and 44 allows one to easily define the location of the kernel's extramodules whereas hard-coding it is more of a pain to edit. This makes it easier to build for custom kernels (different names) and for other architectures (like raspberry pi and other Arch ARM kernels).

For the pkgver var... I would keep it as you have which matches the wireguard-tools package ... since upstream is numbering commits, it's more consistent with a normal release rather than a -git release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment