summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Rabert2021-06-22 11:11:53 -0400
committerAndrew Rabert2021-06-22 11:11:53 -0400
commit5d0ea53ce2fab4e06d120ad56341e7b487670940 (patch)
tree518a1b1ac6830672e868b17103117cd50141ae79
parent5a4d0aaebb84b5a878ef634a8410f77bd644609f (diff)
downloadaur-5d0ea53ce2fab4e06d120ad56341e7b487670940.tar.gz
Patch xboxdrvctl to work with python3
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD9
-rw-r--r--xboxdrvctl-py3.patch73
3 files changed, 82 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 78cd9f514b0..fe05a3e11af 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -12,8 +12,8 @@ pkgbase = xboxdrv
makedepends = python
depends = libx11
depends = dbus-glib
+ depends = dbus-python
depends = libusb
- depends = python2-dbus
depends = systemd
backup = etc/default/xboxdrv
source = xboxdrv-0.8.8.tar.gz::https://github.com/xboxdrv/xboxdrv/archive/v0.8.8.tar.gz
@@ -21,11 +21,12 @@ pkgbase = xboxdrv
source = xboxdrv.default
source = fix-60-sec-delay.patch
source = scons-py3.patch
+ source = xboxdrvctl-py3.patch
sha512sums = 3f27856da211a14e27a84fa5919da7965262adc36da16c75eed9bae891098183b5751a3e707573b4ab64e69096ea74d455e8f64827c88b38b65af94cc13b34ad
sha512sums = f1a4e7b1a06e951c3a4f5bcdec5f14db542b34963950619f0d4b1ee324d64b18ca2f63642719ef65a63e424702fb0eb33e0259937906732e587b96a9582c2e6b
sha512sums = 4f6e9a12b208254e19daba477dd7787147a8b2c8a83007d92f8cfce6212c21ce3306f23a2669080f0e46986ca102ab08c262b42c678caf1a891326b4e2c40b5f
sha512sums = 58170b3f96f02e5ba0af5f6641482fb1c612ca70650e475d68b55c05a62ec0831033190b90e591d593fd6b25c2a155e6c4975f37eef1534245947156a5e3285f
sha512sums = b3a3bbb51fa1c4ad4dd898136c3bf7c0f13193bdd07bbcb5c8243edb747c68223fe8c5bd2fd578f6c2b18844827524abb0533ce98b6e0e60fe936597cdba811d
+ sha512sums = 4e6de460523c1ddfc608b3bd6fb211a7ca0516b64a2d91e01b51deaa4fcc57d64985bb2ccfca43873efef4987e0d04741f0e97dbd6b77037a4417a97cb8d0bf9
pkgname = xboxdrv
-
diff --git a/PKGBUILD b/PKGBUILD
index 0da2e18e9df..e7416ecf29e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,25 +9,28 @@ pkgdesc='Userspace gamepad driver for Linux'
url='http://pingus.seul.org/~grumbel/xboxdrv'
arch=('x86_64')
license=('GPL3')
-depends=('libx11' 'dbus-glib' 'libusb' 'python2-dbus' 'systemd')
+depends=('libx11' 'dbus-glib' 'dbus-python' 'libusb' 'systemd')
makedepends=('scons' 'boost' 'pkg-config' 'libx11' 'python')
backup=("etc/default/xboxdrv")
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/xboxdrv/${pkgname}/archive/v${pkgver}.tar.gz
xboxdrv.service
xboxdrv.default
fix-60-sec-delay.patch
- scons-py3.patch)
+ scons-py3.patch
+ xboxdrvctl-py3.patch)
sha512sums=('3f27856da211a14e27a84fa5919da7965262adc36da16c75eed9bae891098183b5751a3e707573b4ab64e69096ea74d455e8f64827c88b38b65af94cc13b34ad'
'f1a4e7b1a06e951c3a4f5bcdec5f14db542b34963950619f0d4b1ee324d64b18ca2f63642719ef65a63e424702fb0eb33e0259937906732e587b96a9582c2e6b'
'4f6e9a12b208254e19daba477dd7787147a8b2c8a83007d92f8cfce6212c21ce3306f23a2669080f0e46986ca102ab08c262b42c678caf1a891326b4e2c40b5f'
'58170b3f96f02e5ba0af5f6641482fb1c612ca70650e475d68b55c05a62ec0831033190b90e591d593fd6b25c2a155e6c4975f37eef1534245947156a5e3285f'
- 'b3a3bbb51fa1c4ad4dd898136c3bf7c0f13193bdd07bbcb5c8243edb747c68223fe8c5bd2fd578f6c2b18844827524abb0533ce98b6e0e60fe936597cdba811d')
+ 'b3a3bbb51fa1c4ad4dd898136c3bf7c0f13193bdd07bbcb5c8243edb747c68223fe8c5bd2fd578f6c2b18844827524abb0533ce98b6e0e60fe936597cdba811d'
+ '4e6de460523c1ddfc608b3bd6fb211a7ca0516b64a2d91e01b51deaa4fcc57d64985bb2ccfca43873efef4987e0d04741f0e97dbd6b77037a4417a97cb8d0bf9')
prepare() {
cd ${pkgname}-${pkgver}
sed 's|python|python2|g' -i examples/*.py
patch -p1 < "${srcdir}/fix-60-sec-delay.patch"
patch -p1 < "${srcdir}/scons-py3.patch"
+ patch -p1 < "${srcdir}/xboxdrvctl-py3.patch"
}
build() {
diff --git a/xboxdrvctl-py3.patch b/xboxdrvctl-py3.patch
new file mode 100644
index 00000000000..71d8762cb9c
--- /dev/null
+++ b/xboxdrvctl-py3.patch
@@ -0,0 +1,73 @@
+--- a/xboxdrvctl 2021-06-21 19:39:51.000000000 -0400
++++ b/xboxdrvctl 19:43:27.467984928 -0400
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+
+ ## Xbox360 USB Gamepad Userspace Driver
+ ## Copyright (C) 2011 Ingo Ruhnke <grumbel@gmail.com>
+@@ -37,23 +37,23 @@
+ help="print controller status")
+
+ group.add_option("-s", "--slot", metavar="SLOT", type="int",
+- dest="slot",
++ dest="slot",
+ help="use slot SLOT for actions")
+
+ group.add_option("-l", "--led", metavar="NUM", type="int",
+- dest="led",
++ dest="led",
+ help="set LED")
+
+-group.add_option("-r", "--rumble", metavar="L:R",
+- dest="rumble",
++group.add_option("-r", "--rumble", metavar="L:R",
++ dest="rumble",
+ help="print controller status")
+
+ group.add_option("-c", "--config", metavar="NUM", type="int",
+- dest="config",
++ dest="config",
+ help="switches to controller configuration NUM")
+
+ group.add_option("--shutdown", action="store_true",
+- dest="shutdown",
++ dest="shutdown",
+ help="shuts down the daemon")
+
+ parser.add_option_group(group)
+@@ -69,9 +69,9 @@
+ try:
+ bus.get_object("org.seul.Xboxdrv", '/org/seul/Xboxdrv/Daemon')
+ except dbus.exceptions.DBusException:
+- bus = dbus.SystemBus()
++ bus = dbus.SystemBus()
+ else:
+- print "Error: invalid argument to --bus. Must be 'auto', 'session, or 'system'"
++ print("Error: invalid argument to --bus. Must be 'auto', 'session, or 'system'")
+ exit()
+
+ if options.status:
+@@ -82,19 +82,19 @@
+ daemon.Shutdown()
+ else:
+ if (options.led or options.rumble or options.config) and options.slot == None:
+- print "Error: --slot argument required"
++ print("Error: --slot argument required")
+ exit()
+ else:
+ if options.slot != None:
+ slot = bus.get_object("org.seul.Xboxdrv", '/org/seul/Xboxdrv/ControllerSlots/%d' % options.slot)
+-
++
+ if options.led != None:
+ slot.SetLed(options.led)
+
+ if options.rumble:
+ m = re.match('^(\d+):(\d+)$', options.rumble)
+ if not m:
+- print "Error: invalid argument to --rumble"
++ print("Error: invalid argument to --rumble")
+ exit()
+ else:
+ left = int(m.group(1))