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

_pkgbase=rtl8xxxu
pkgname=rtl8xxxu-dkms-git
pkgver=r25.a029f77
pkgrel=1
pkgdesc="Driver for Realtek RTL8XXXXU usb wifi 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.git")
sha256sums=('SKIP')
optdepends=('usb_modeswitch: For RTL8188GU/RTL8192FU users, use this to switch the dongle to wifi mode if needed.')

prepare() {
    cd "${srcdir}"/${_pkgbase}
    sed -i "/POST_INSTALL/d" 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/git_4831a80-1/${pkgver}/" -i "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf
}