summaryrefslogtreecommitdiff
path: root/pcr
diff options
context:
space:
mode:
Diffstat (limited to 'pcr')
-rw-r--r--pcr/rtl8812au/PKGBUILD85
-rw-r--r--pcr/rtl8812au/dkms.conf9
2 files changed, 94 insertions, 0 deletions
diff --git a/pcr/rtl8812au/PKGBUILD b/pcr/rtl8812au/PKGBUILD
new file mode 100644
index 000000000..b4e6141b0
--- /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=3
+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
+ 9f7c983df45db1938ee924b2dac8e8d98becef78822536b6c8f489a56a25c6a4)
+
+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}/
+}
diff --git a/pcr/rtl8812au/dkms.conf b/pcr/rtl8812au/dkms.conf
new file mode 100644
index 000000000..e996e6496
--- /dev/null
+++ b/pcr/rtl8812au/dkms.conf
@@ -0,0 +1,9 @@
+PACKAGE_NAME="@PKGBASE@"
+PACKAGE_VERSION="@PKGVER@"
+BUILT_MODULE_NAME="88XXau"
+PROCS_NUM=$(nproc)
+[ $PROCS_NUM -gt 16 ] && PROCS_NUM=16
+MAKE="'make' -j$PROCS_NUM KVER=${kernelver} KSRC=/lib/modules/${kernelver}/build"
+CLEAN="'make' clean"
+DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
+AUTOINSTALL="yes"