summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a6ac6c370a92c201be3cc85122b5779f81f5f762 (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
# Maintainer: xx777 <zenmchen at gmail dot com>

_pkgbase=rtl8xxxu
pkgname=rtl8xxxu-dkms-git
pkgver=r27.972686d
pkgrel=1
pkgdesc="Driver for Realtek 802.11n USB wireless chips"
arch=('any')
url="https://github.com/a5a5aa555oo/rtl8xxxu"
license=('GPL2')
depends=('dkms' 'linux-firmware>=20230625.ee91452d-1')
makedepends=('git')
source=("git+https://github.com/a5a5aa555oo/rtl8xxxu")
sha256sums=('SKIP')
optdepends=('usb_modeswitch: For RTL8188GU/RTL8192FU users, use this tool to switch the adapter to wifi mode if needed.')

prepare() {
    cd "${srcdir}"/${_pkgbase}
    sed -e "/POST_INSTALL/d" -e "/PACKAGE_VERSION/d" -i dkms.conf
    printf "PACKAGE_VERSION=\"@PKGVER@\"\n" >> dkms.conf
    echo "blacklist rtl8xxxu" > blacklist-rtl8xxxu.conf
    echo "options rtl8xxxu_git ht40_2g=1" > rtl8xxxu_git.conf
}

pkgver() {
    cd "${srcdir}"/${_pkgbase}
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

package() {
    cd "${srcdir}"/${_pkgbase}
    install -Dm 644 -t "${pkgdir}"/etc/modprobe.d blacklist-rtl8xxxu.conf rtl8xxxu_git.conf
    install -Dm 644 -t "${pkgdir}"/usr/src/${_pkgbase}-${pkgver} *.c *.h Makefile dkms.conf
    sed -e "s/@PKGVER@/${pkgver}/" -i "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf
}