summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ee70f3322ced12d97e2b696ff566f3be24ad854d (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
# Maintainer: Bruce Zhang
pkgname=rtl88x2ce-dkms
_name=rtl88x2ce
pkgver=5.7.3_35403
_allver="${pkgver}_COEX20190531-0e0e.20191028"
_dver="${pkgver}.20191028_COEX20190531-0e0e"
pkgrel=4
pkgdesc="Realtek RTL88x2CE Driver (DKMS)"
arch=('x86_64' 'i686')
url="https://github.com/XAIOThaifeng/realtek-linux/blob/master/RTL8822CE"
license=('GPL')
depends=('dkms' 'bc')
optdepends=('linux-headers' 'linux-zen-headers')
provides=('rtl88x2ce')
source=(
	"$pkgname-$pkgver.src.7z::https://github.com/XAIOThaifeng/realtek-linux/blob/master/RTL8822CE/RTL8822CE_WiFi_linux_v$_allver.7z?raw=true"
	dkms.conf
	rtw88_blacklist.conf
)
sha1sums=('a798b10d4f2c962c246f2c1bc695314e2b15e7b3'
          '7aa512c830c044506581158cca931da411017ad0'
          '18ecc64076501d396a2fabf4f1f31d3d1945b874')

prepare() {
	cd "$srcdir/RTL8822CE_WiFi_linux_v$_allver/driver"
	tar zxf "rtl88x2CE_WiFi_linux_v$_dver.tar.gz"
	cd "$srcdir/RTL8822CE_WiFi_linux_v$_allver/driver/rtl88x2CE_WiFi_linux_v$_dver"

	# Enable SoftAP
	# sed -i '/^\/\*#define CONFIG_IOCTL_CFG80211/c\#define CONFIG_IOCTL_CFG80211' include/autoconf.h
	# sed -i 's|\/\*\#define RTW_USE_CFG80211_STA_EVENT\*\/|\#define RTW_USE_CFG80211_STA_EVENT|' include/autoconf.h

	# Enable WOWLAN
	sed -i '/^CONFIG_WOWLAN/c\CONFIG_WOWLAN = y' Makefile

	# Enable wifi monitor
	sed -i '/^CONFIG_WIFI_MONITOR/c\CONFIG_WIFI_MONITOR = y' Makefile

	# Disable debug
	sed -i '/^CONFIG_RTW_DEBUG/c\CONFIG_RTW_DEBUG = n' Makefile
}

package() {
	cd "$srcdir/RTL8822CE_WiFi_linux_v$_allver/driver/rtl88x2CE_WiFi_linux_v$_dver"
	mkdir -p "$pkgdir/usr/src/$_name-$pkgver"
	cp -pr * "$pkgdir/usr/src/$_name-$pkgver"
	install -Dm644 "$srcdir/dkms.conf" "$pkgdir/usr/src/$_name-$pkgver/dkms.conf"
	install -Dm644 "$srcdir/rtw88_blacklist.conf" "$pkgdir/usr/lib/modprobe.d/rtw88_blacklist.conf"
	sed -e "s/#MODULE_VERSION#/$pkgver/" -i "$pkgdir/usr/src/$_name-$pkgver/dkms.conf"
}