summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcr/rtl8812au/PKGBUILD85
-rw-r--r--pcr/rtl8812au/dkms.conf7
2 files changed, 92 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}/
+}
diff --git a/pcr/rtl8812au/dkms.conf b/pcr/rtl8812au/dkms.conf
new file mode 100644
index 000000000..098439924
--- /dev/null
+++ b/pcr/rtl8812au/dkms.conf
@@ -0,0 +1,7 @@
+PACKAGE_NAME="@_PKGBASE@"
+PACKAGE_VERSION="@PKGVER@"
+MAKE[0]="make --uname_r=$kernelver"
+CLEAN="make clean"
+BUILT_MODULE_NAME[0]="@_PKGBASE@"
+DEST_MODULE_LOCATION[0]="/kernel/net/wireless"
+AUTOINSTALL="yes"