void-packages/srcpkgs/rtl8812au-dkms/template
Đoàn Trần Công Danh 103ab731ab srcpkgs/r*: convert patches to -Np1
* runit is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

47 lines
1.3 KiB
Bash

# Template file for 'rtl8812au-dkms'
pkgname=rtl8812au-dkms
version=20210427
revision=1
_modver=5.9.3.2
_gitrev=6ef5d8fcdb0b94b7490a9a38353877708fca2cd4
wrksrc="rtl8812au-${_modver}-${_gitrev}"
depends="dkms"
short_desc="Realtek 8812AU/8821AU USB WiFi driver (DKMS)"
maintainer="Renato Aguiar <renato@renag.me>"
license="GPL-2.0-only"
homepage="http://www.dlink.com"
distfiles="https://github.com/gordboy/rtl8812au-${_modver}/archive/${_gitrev}.tar.gz"
checksum=72b04bb7e1ef01eae653222d6f75f71163f7442fa142198605ed495f30341bd9
dkms_modules="rtl8812au ${_modver}"
case "$XBPS_TARGET_MACHINE" in
x86_64*) _karch="x86_64";;
i686*) _karch="i386";;
aarch64*) _karch="arm64";;
arm*) _karch="arm";;
ppc*) _karch="powerpc";;
mips*) _karch="mips";;
*) broken="kernel arch not defined";;
esac
post_patch() {
if [ "$XBPS_TARGET_ENDIAN" = "be" ]; then
vsed -i 's,@@VOID_ENDIAN@@,BIG,g' Makefile
else
vsed -i 's,@@VOID_ENDIAN@@,LITTLE,g' Makefile
fi
vsed -i "s,@@VOID_ARCH@@,${_karch},g" Makefile
}
do_install() {
local dest=/usr/src/rtl8812au-${_modver}
vmkdir ${dest}
cp -r dkms.conf Kconfig Makefile platform core hal include os_dep ${DESTDIR}/${dest}
# modules-load.d(5) file.
vmkdir usr/lib/modules-load.d
echo "8812au" > ${DESTDIR}/usr/lib/modules-load.d/${pkgname}.conf
chmod 644 ${DESTDIR}/usr/lib/modules-load.d/${pkgname}.conf
}