From 69ff122b3dbf349ff303698379e1246e88a47398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Kov=C3=A1cs?= Date: Mon, 29 Apr 2024 15:52:31 +0900 Subject: [PATCH] added xone-dkms package --- README.md | 1 + build_orders/_all.txt | 1 + packages/xone-dkms/xone-dkms/PKGBUILD | 53 +++++++++++++++++++ .../xone-dkms/fix_6.3_compilation.patch | 22 ++++++++ 4 files changed, 77 insertions(+) create mode 100644 packages/xone-dkms/xone-dkms/PKGBUILD create mode 100644 packages/xone-dkms/xone-dkms/fix_6.3_compilation.patch diff --git a/README.md b/README.md index cc37219..cd4c9e1 100644 --- a/README.md +++ b/README.md @@ -47,3 +47,4 @@ teamviewer|[Archlinux AUR](https://aur.archlinux.org/packages/teamviewer)|All-In ttf-ms-fonts|[Archlinux AUR](https://aur.archlinux.org/packages/ttf-ms-fonts)|Core TTF Fonts from Microsoft. tufw|Own|Terminal UI for ufw. visual-studio-code-bin|[Archlinux AUR](https://aur.archlinux.org/packages/visual-studio-code-bin)|Visual Studio Code (vscode): Editor for building and debugging modern web and cloud applications (official binary version). +xone-dkms|[Archlinux AUR](https://aur.archlinux.org/packages/xone-dkms)|Modern Linux driver for Xbox One and Xbox Series X|S controllers diff --git a/build_orders/_all.txt b/build_orders/_all.txt index f80b70c..f498f07 100644 --- a/build_orders/_all.txt +++ b/build_orders/_all.txt @@ -17,3 +17,4 @@ defold liblcf easyrpg-player ani-cli +xone-dkms diff --git a/packages/xone-dkms/xone-dkms/PKGBUILD b/packages/xone-dkms/xone-dkms/PKGBUILD new file mode 100644 index 0000000..dc6188e --- /dev/null +++ b/packages/xone-dkms/xone-dkms/PKGBUILD @@ -0,0 +1,53 @@ +# Maintainer: Michał Kopeć +# Contributor: Michał Kopeć + +_pkgname=xone +pkgname=xone-dkms +pkgver=0.3 +pkgrel=4 +pkgdesc='Modern Linux driver for Xbox One and Xbox Series X|S controllers' +arch=('x86_64' 'aarch64') +url='https://github.com/medusalix/xone' +license=('GPL2') +depends=( + 'dkms' + 'xone-dongle-firmware' +) +makedepends=('git') +conflicts=( + 'xone-dkms' + 'xow' +) +provides=('xone-dkms') +source=( + https://github.com/medusalix/xone/archive/refs/tags/v${pkgver}.tar.gz + 'fix_6.3_compilation.patch' +) +sha256sums=( + '993f6b2b07c3236ce283d5de4da47dbfc16a86e056af504a4958d87f718ece20' + '6ce597ef7a916216584c99bd8fdf382b6a720d8550315c87142aeff2b226d70b' +) + +package() { + cd "${srcdir}/${_pkgname}-${pkgver}" + + local src + for src in "${source[@]}"; do + src="${src%%::*}" + src="${src##*/}" + src="${src%.zst}" + [[ $src = *.patch ]] || continue + echo "* Applying patch $src..." + patch -Np1 < "../$src" + done + + find . -type f \( -name 'dkms.conf' -o -name '*.c' \) -exec sed -i "s/#VERSION#/$pkgver/" {} + + + echo "* Copying module into /usr/src..." + install -dm755 "${pkgdir}/usr/src/${_pkgname}-${pkgver}" + cp -r ${srcdir}/${_pkgname}-${pkgver}/* "${pkgdir}/usr/src/${_pkgname}-${pkgver}" + + echo "* Blacklisting xpad module..." + install -D -m 644 install/modprobe.conf "${pkgdir}/usr/lib/modprobe.d/xone-blacklist.conf" +} + diff --git a/packages/xone-dkms/xone-dkms/fix_6.3_compilation.patch b/packages/xone-dkms/xone-dkms/fix_6.3_compilation.patch new file mode 100644 index 0000000..54a26d0 --- /dev/null +++ b/packages/xone-dkms/xone-dkms/fix_6.3_compilation.patch @@ -0,0 +1,22 @@ +commit bbf0dcc484c3f5611f4e375da43e0e0ef08f3d18 +Author: Vicki Pfau +Date: Tue May 16 15:06:07 2023 -0700 + + Fix build on kernel 6.3 + +diff --git a/bus/bus.c b/bus/bus.c +index 7fde92244cb9..b129d6fb519a 100644 +--- a/bus/bus.c ++++ b/bus/bus.c +@@ -67,7 +67,11 @@ static void gip_client_state_changed(struct work_struct *work) + } + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) + static int gip_client_uevent(struct device *dev, struct kobj_uevent_env *env) ++#else ++static int gip_client_uevent(const struct device *dev, struct kobj_uevent_env *env) ++#endif + { + struct gip_client *client = to_gip_client(dev); + struct gip_classes *classes = client->classes;