Skip to content

Commit

Permalink
added xone-dkms package
Browse files Browse the repository at this point in the history
  • Loading branch information
mortyr45 committed Apr 29, 2024
1 parent 8a834ce commit 69ff122
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions build_orders/_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ defold
liblcf
easyrpg-player
ani-cli
xone-dkms
53 changes: 53 additions & 0 deletions packages/xone-dkms/xone-dkms/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Maintainer: Michał Kopeć <[email protected]>
# Contributor: Michał Kopeć <[email protected]>

_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"
}

22 changes: 22 additions & 0 deletions packages/xone-dkms/xone-dkms/fix_6.3_compilation.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
commit bbf0dcc484c3f5611f4e375da43e0e0ef08f3d18
Author: Vicki Pfau <[email protected]>
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;

0 comments on commit 69ff122

Please sign in to comment.