From 04a4b2c338444072a0fca1134e0dcc530b7296c0 Mon Sep 17 00:00:00 2001 From: Morgan Helton Date: Wed, 25 Dec 2024 14:40:03 -0500 Subject: [PATCH] xboxdrv: drop --- .../by-name/xb/xboxdrv/fix-60-sec-delay.patch | 27 ------- pkgs/by-name/xb/xboxdrv/package.nix | 54 -------------- pkgs/by-name/xb/xboxdrv/scons-py3.patch | 63 ---------------- pkgs/by-name/xb/xboxdrv/scons-v4.2.0.patch | 20 ----- pkgs/by-name/xb/xboxdrv/xboxdrvctl-py3.patch | 73 ------------------- 5 files changed, 237 deletions(-) delete mode 100644 pkgs/by-name/xb/xboxdrv/fix-60-sec-delay.patch delete mode 100644 pkgs/by-name/xb/xboxdrv/package.nix delete mode 100644 pkgs/by-name/xb/xboxdrv/scons-py3.patch delete mode 100644 pkgs/by-name/xb/xboxdrv/scons-v4.2.0.patch delete mode 100644 pkgs/by-name/xb/xboxdrv/xboxdrvctl-py3.patch diff --git a/pkgs/by-name/xb/xboxdrv/fix-60-sec-delay.patch b/pkgs/by-name/xb/xboxdrv/fix-60-sec-delay.patch deleted file mode 100644 index da543d2cfa01b9..00000000000000 --- a/pkgs/by-name/xb/xboxdrv/fix-60-sec-delay.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 7326421eeaadbc2aeb3828628c2e65bb7be323a9 Mon Sep 17 00:00:00 2001 -From: buxit -Date: Wed, 2 Nov 2016 16:25:14 +0100 -Subject: [PATCH] fix 60 seconds delay - -use `libusb_handle_events_timeout_completed()` instead of `libusb_handle_events()` -should fix #144 ---- - src/usb_gsource.cpp | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/usb_gsource.cpp b/src/usb_gsource.cpp -index 00bf1315..afb38f65 100644 ---- a/src/usb_gsource.cpp -+++ b/src/usb_gsource.cpp -@@ -174,7 +174,10 @@ USBGSource::on_source_dispatch(GSource* source, GSourceFunc callback, gpointer u - gboolean - USBGSource::on_source() - { -- libusb_handle_events(NULL); -+ struct timeval to; -+ to.tv_sec = 0; -+ to.tv_usec = 0; -+ libusb_handle_events_timeout_completed(NULL, &to, NULL); - return TRUE; - } - diff --git a/pkgs/by-name/xb/xboxdrv/package.nix b/pkgs/by-name/xb/xboxdrv/package.nix deleted file mode 100644 index 98c79cd7f80a04..00000000000000 --- a/pkgs/by-name/xb/xboxdrv/package.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - scons, - libX11, - pkg-config, - libusb1, - boost, - glib, - dbus-glib, -}: - -stdenv.mkDerivation rec { - pname = "xboxdrv"; - version = "0.8.8"; - - src = fetchFromGitHub { - owner = "xboxdrv"; - repo = "xboxdrv"; - rev = "v${version}"; - hash = "sha256-R0Bt4xfzQA1EmZbf7lcWLwSSUayf5Y711QhlAVhiLrY="; - }; - - makeFlags = [ "PREFIX=$(out)" ]; - nativeBuildInputs = [ - pkg-config - scons - ]; - buildInputs = [ - libX11 - libusb1 - boost - glib - dbus-glib - ]; - enableParallelBuilding = true; - dontUseSconsInstall = true; - - patches = [ - ./fix-60-sec-delay.patch - ./scons-py3.patch - ./scons-v4.2.0.patch - ./xboxdrvctl-py3.patch - ]; - - meta = with lib; { - homepage = "https://xboxdrv.gitlab.io/"; - description = "Xbox/Xbox360 (and more) gamepad driver for Linux that works in userspace"; - license = licenses.gpl3Plus; - maintainers = [ ]; - platforms = platforms.linux; - }; -} diff --git a/pkgs/by-name/xb/xboxdrv/scons-py3.patch b/pkgs/by-name/xb/xboxdrv/scons-py3.patch deleted file mode 100644 index 4aa6fa6193175e..00000000000000 --- a/pkgs/by-name/xb/xboxdrv/scons-py3.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 17bd43a7d3ef86216abc36b42b4e6a1f70aa9979 Mon Sep 17 00:00:00 2001 -From: xnick -Date: Thu, 12 Oct 2017 20:34:35 +0300 -Subject: [PATCH] Update SConstruct - -python3 compatible ---- - SConstruct | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/SConstruct b/SConstruct -index 4cd79704..c0007054 100644 ---- a/SConstruct -+++ b/SConstruct -@@ -19,7 +19,7 @@ def build_dbus_glue(target, source, env): - xml = re.sub(r"callback = \(([A-Za-z_]+)\) \(marshal_data \? marshal_data : cc->callback\);", - r"union { \1 fn; void* obj; } conv;\n " - "conv.obj = (marshal_data ? marshal_data : cc->callback);\n " -- "callback = conv.fn;", xml) -+ "callback = conv.fn;", xml.decode('utf-8')) - - with open(target[0].get_path(), "w") as f: - f.write(xml) -@@ -29,10 +29,10 @@ def build_bin2h(target, source, env): - Takes a list of files and converts them into a C source that can be included - """ - def c_escape(str): -- return str.translate(string.maketrans("/.-", "___")) -+ return str.translate(bytes.maketrans(b"/.-", b"___")) - -- print target -- print source -+ print(target) -+ print(source) - with open(target[0].get_path(), "w") as fout: - fout.write("// autogenerated by scons Bin2H builder, do not edit by hand!\n\n") - -@@ -45,8 +45,8 @@ def build_bin2h(target, source, env): - data = fin.read() - fout.write("// \"%s\"\n" % src.get_path()) - fout.write("const char %s[] = {" % c_escape(src.get_path())) -- bytes_arr = ["0x%02x" % ord(c) for c in data] -- for i in xrange(len(bytes_arr)): -+ bytes_arr = ["0x%02x" % c for c in data] -+ for i in range(len(bytes_arr)): - if i % 13 == 0: - fout.write("\n ") - fout.write(bytes_arr[i]) -@@ -131,12 +131,12 @@ env.Append(CPPDEFINES = { 'PACKAGE_VERSION': "'\"%s\"'" % package_version }) - conf = Configure(env) - - if not conf.env['CXX']: -- print "g++ must be installed!" -+ print('g++ must be installed!') - Exit(1) - - # X11 checks - if not conf.CheckLibWithHeader('X11', 'X11/Xlib.h', 'C++'): -- print 'libx11-dev must be installed!' -+ print('libx11-dev must be installed!') - Exit(1) - - env = conf.Finish() diff --git a/pkgs/by-name/xb/xboxdrv/scons-v4.2.0.patch b/pkgs/by-name/xb/xboxdrv/scons-v4.2.0.patch deleted file mode 100644 index 04b05e8d6ffc6c..00000000000000 --- a/pkgs/by-name/xb/xboxdrv/scons-v4.2.0.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/SConstruct 2021-10-31 20:42:44.232084185 -0400 -+++ b/SConstruct 2021-10-31 20:42:54.063024444 -0400 -@@ -36,7 +36,7 @@ - with open(target[0].get_path(), "w") as fout: - fout.write("// autogenerated by scons Bin2H builder, do not edit by hand!\n\n") - -- if env.has_key("BIN2H_NAMESPACE"): -+ if "BIN2H_NAMESPACE" in env: - fout.write("namespace %s {\n\n" % env["BIN2H_NAMESPACE"]) - - # write down data -@@ -62,7 +62,7 @@ - for src in source], ",\n")) - fout.write("\n}\n\n") - -- if env.has_key("BIN2H_NAMESPACE"): -+ if "BIN2H_NAMESPACE" in env: - fout.write("} // namespace %s\n\n" % env["BIN2H_NAMESPACE"]) - - fout.write("/* EOF */\n") diff --git a/pkgs/by-name/xb/xboxdrv/xboxdrvctl-py3.patch b/pkgs/by-name/xb/xboxdrv/xboxdrvctl-py3.patch deleted file mode 100644 index 71d8762cb9ca52..00000000000000 --- a/pkgs/by-name/xb/xboxdrv/xboxdrvctl-py3.patch +++ /dev/null @@ -1,73 +0,0 @@ ---- 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 -@@ -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))