void-packages/srcpkgs/rtl8822bu-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

46 lines
1.4 KiB
Bash

# Template file for 'rtl8822bu-dkms'
pkgname=rtl8822bu-dkms
version=20201222
revision=1
_gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
wrksrc="rtl8822bu-${_gitrev}"
depends="dkms"
short_desc="Realtek 8822BU USB WiFi driver (DKMS)"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-only"
homepage="https://www.tp-link.com"
distfiles="https://github.com/EntropicEffect/rtl8822bu/archive/${_gitrev}.tar.gz"
checksum=fb2dbcd0385d558af6c74571aaac9020d7cbb9e56cc4780299bd420559f29bb1
dkms_modules="88x2bu ${version}"
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() {
vmkdir /usr/src/88x2bu-${version}
vcopy "*" usr/src/88x2bu-${version}
vinstall ${FILESDIR}/dkms.conf 644 usr/src/88x2bu-${version}
sed -i -e "s/@VERSION@/${version}-${revision}/" ${PKGDESTDIR}/usr/src/88x2bu-${version}/dkms.conf
# modules-load.d(5) file.
vmkdir usr/lib/modules-load.d
echo "88x2bu" > ${DESTDIR}/usr/lib/modules-load.d/88x2bu.conf
chmod 644 ${DESTDIR}/usr/lib/modules-load.d/88x2bu.conf
}