summaryrefslogtreecommitdiff
path: root/pcr/rtl8812au/PKGBUILD
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2022-07-17 21:49:53 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2022-07-18 16:26:00 -0400
commit34a247b83767fee8fe6e28dae55c736d05b6dbe8 (patch)
tree92e2b5c5743121d888d29e904689efcc56f78bf8 /pcr/rtl8812au/PKGBUILD
parent31165779a5d09a19f574464ad6b2fe90bbaa3c22 (diff)
downloadabslibre-34a247b83767fee8fe6e28dae55c736d05b6dbe8.tar.gz
abslibre-34a247b83767fee8fe6e28dae55c736d05b6dbe8.tar.bz2
abslibre-34a247b83767fee8fe6e28dae55c736d05b6dbe8.zip
[rtl8812au]: add package v5.6.4.2.20220606
Diffstat (limited to 'pcr/rtl8812au/PKGBUILD')
-rw-r--r--pcr/rtl8812au/PKGBUILD85
1 files changed, 85 insertions, 0 deletions
diff --git a/pcr/rtl8812au/PKGBUILD b/pcr/rtl8812au/PKGBUILD
new file mode 100644
index 000000000..3d0c564b3
--- /dev/null
+++ b/pcr/rtl8812au/PKGBUILD
@@ -0,0 +1,85 @@
+# Maintainer: Parabola Hackers <dev@lists.parabola.nu>
+
+
+_pkgbase=rtl8812au
+pkgname=rtl8812au-dkms
+pkgver=5.6.4.2.20220606 # per upstream dkms.conf (see note in prepare())
+_cid=cab4e4ec56884f65e0c279c1b5ceaf70dbe79be0
+pkgrel=1
+pkgdesc="RTL8812AU/21AU and RTL8814AU driver with monitor mode and frame injection"
+url=https://github.com/aircrack-ng/rtl8812au
+license=(GPL2)
+arch=(armv7h i686 x86_64)
+
+makedepends=()
+depends=(dkms)
+
+source=(${_pkgbase}-${pkgver}.tar.gz::https://github.com/aircrack-ng/rtl8812au/archive/${_cid}.tar.gz
+ dkms.conf)
+
+sha256sums=(20b498bc597e5343ee6c240eabd45c36894db86c76f6bfc100448c8b9c420733
+ 8303638219327cdc8559aa3a8fc62d7bb9cb2c64aaf6a3b5e6a515d4e98ce17e)
+
+case "${CARCH}" in
+armv7h ) export KARCH=arm ;;
+aarch64) export KARCH=arm64 ;; # TODO: not yet supported
+esac
+
+
+prepare()
+{
+ cd "${srcdir}"/${_pkgbase}-${_cid}
+
+ # version sanity check
+ # NOTE: The upstream does not publich versioned releases, nor use git tags.
+ # However they are kind enough to version the dkms.conf.
+ # eg: PACKAGE_VERSION="5.6.4.2~20220715"
+ # This PKGBUILD attempts to version the package properly, based on
+ # that version ID (aka: pkgver) and the VCS commit (aka: _cid) which defined it.
+ local upstream_ver=$(grep PACKAGE_VERSION= dkms.conf | sed 's|PACKAGE_VERSION="\(.*\)"|\1|')
+ [[ "${upstream_ver/\~/.}" == ${pkgver} ]] || ! echo "version mismatch in dkms.conf" || return 1
+
+ # we will use our dkms.conf though
+ cp "${srcdir}"/dkms.conf .
+
+ case "${CARCH}" in
+ armv7h)
+ sed -i 's|^CONFIG_PLATFORM_I386_PC = y|CONFIG_PLATFORM_I386_PC = n|' Makefile
+ sed -i 's|^CONFIG_PLATFORM_ARM_SUN7I = n|CONFIG_PLATFORM_ARM_SUN7I = y|' Makefile
+ sed -i "s|^MAKE\[0\]=\"|MAKE[0]=\"ARCH=${KARCH} |" dkms.conf
+ ;;
+ aarch64)
+ sed -i "s|^MAKE\[0\]=\"|MAKE[0]=\"ARCH=${KARCH} |" dkms.conf
+ ;;
+ esac
+ sed -i -e "s/@_PKGBASE@/${_pkgbase}/" -e "s/@PKGVER@/${pkgver}/" dkms.conf
+
+ # cleanup some sources that we won't need
+ # the licensing of files under the tools/ directory is varied and unclear
+ # TODO: this could/should go into a mksource() function
+ rm -rf android/ tools/
+}
+
+package()
+{
+ cd "${srcdir}"/${_pkgbase}-${_cid}
+
+ local dkms_srcdir="${pkgdir}"/usr/src/${_pkgbase}-${pkgver}
+
+ # Install
+ # Makefile does not respect DESTDIR
+ # make DESTDIR="${pkgdir}" install
+
+ # Copy dkms.conf
+ install -Dm644 dkms.conf "${dkms_srcdir}"/dkms.conf
+
+ # Set name and version
+ # already did that
+
+ # Copy sources (including Makefile)
+ cp -r ./* "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/
+
+ # install docs
+ install -Dm644 README.md "${pkgdir}"/usr/share/doc/${_pkgbase}/README.md
+ install -m644 docs/* "${pkgdir}"/usr/share/doc/${_pkgbase}/
+}