PKGBUILD 1.22 KB
Newer Older
1
pkgname=r8168
Luca Giambonini's avatar
Luca Giambonini committed
2
pkgver=8.045.08
Luca Giambonini's avatar
Luca Giambonini committed
3
pkgrel=11
4 5 6
pkgdesc="A kernel module for Realtek 8168 network cards"
url="http://www.realtek.com.tw"
license=("GPL")
7
arch=('x86_64')
Luca Giambonini's avatar
Luca Giambonini committed
8
depends=('glibc' "linux=4.17.12")
Luca Giambonini's avatar
Luca Giambonini committed
9
makedepends=("linux-headers=4.18.3")
Luca Giambonini's avatar
Luca Giambonini committed
10
_extramodules=extramodules-CHAKRA
Luca Giambonini's avatar
Luca Giambonini committed
11 12 13 14 15 16 17 18 19
source=("https://github.com/mtorromeo/r8168/archive/$pkgver/$pkgname-$pkgver.tar.gz"
            linux-4.15.patch)
sha256sums=('18161cb72fc872a9aed194514f7b8fb8b255b6fa6ed3d2dd459700eaad575f31'
            '6434f0d1fcb08e3605a17859d3b8946c65bcf14737e223315b6468b3394c5cd7')

prepare() {
	cd "$pkgname-$pkgver"
	patch -Np1 -i ../linux-4.15.patch
}
20 21

build() {
Luca Giambonini's avatar
Luca Giambonini committed
22 23 24 25 26 27 28
	KERNEL_VERSION=$(</usr/lib/modules/$_extramodules/version)
	msg2 "Kernel = $KERNEL_VERSION"

	cd "$pkgname-$pkgver"
	# avoid using the Makefile directly -- it doesn't understand
	# any kernel but the current.
	make -C /usr/lib/modules/$KERNEL_VERSION/build \
29 30 31
			SUBDIRS="$srcdir/$pkgname-$pkgver/src" \
			EXTRA_CFLAGS="-DCONFIG_R8168_NAPI -DCONFIG_R8168_VLAN" \
			modules
32 33 34
}

package() {
Luca Giambonini's avatar
Luca Giambonini committed
35 36 37 38 39 40
	cd "$pkgname-$pkgver"
	install -Dt "$pkgdir/usr/lib/modules/$_extramodules" -m644 src/*.ko
	find "$pkgdir" -name '*.ko' -exec xz {} +

	echo "blacklist r8169" | \
		install -Dm644 /dev/stdin "$pkgdir/usr/lib/modprobe.d/r8168.conf"
41
}