From e4fc377268aef3b078d4cb796df4c684dd79ddda Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Mon, 3 Nov 2025 18:13:24 -0800 Subject: [PATCH] add: udev-joystick-blacklist, split from Steam package (#7054) (#7075) * add: udev-joystick-blacklist, split from Steam package * fix: Change didn't save * fix: Obsolete * fix: Everything * fix: How am I managing this (cherry picked from commit ea7638be4d7e740d909111fa9eeaf2069f0b4ab7) Co-authored-by: Gilver --- anda/games/steam/steam.spec | 35 ++++--------- anda/games/udev-joystick-blacklist/anda.hcl | 9 ++++ .../udev-joystick-blacklist.spec | 52 +++++++++++++++++++ .../games/udev-joystick-blacklist/update.rhai | 5 ++ 4 files changed, 76 insertions(+), 25 deletions(-) create mode 100644 anda/games/udev-joystick-blacklist/anda.hcl create mode 100644 anda/games/udev-joystick-blacklist/udev-joystick-blacklist.spec create mode 100644 anda/games/udev-joystick-blacklist/update.rhai diff --git a/anda/games/steam/steam.spec b/anda/games/steam/steam.spec index 6968f23c33..ee21b44b5b 100644 --- a/anda/games/steam/steam.spec +++ b/anda/games/steam/steam.spec @@ -5,7 +5,7 @@ Name: steam Version: 1.0.0.85 -Release: 1%?dist +Release: 2%?dist Summary: Installer for the Steam software distribution service # Redistribution and repackaging for Linux is allowed, see license file. udev rules are MIT. License: Steam License Agreement and MIT @@ -24,14 +24,11 @@ Source5: https://github.com/terrapkg/pkg-steam/raw/refs/heads/main/README # https://github.com/denilsonsa/udev-joystick-blacklist # https://github.com/systemd/systemd/issues/32773 -# Input devices seen as joysticks: -Source6: https://raw.githubusercontent.com/denilsonsa/udev-joystick-blacklist/master/after_kernel_4_9/51-these-are-not-joysticks-rm.rules - # Configure limits in systemd -Source7: https://github.com/terrapkg/pkg-steam/raw/refs/heads/main/01-steam.conf +Source6: https://github.com/terrapkg/pkg-steam/raw/refs/heads/main/01-steam.conf # Steam restart script -Source9: steamrestart.sh +Source7: steamrestart.sh # Do not install desktop file in lib/steam, do not install apt sources Patch0: https://github.com/terrapkg/pkg-steam/raw/refs/heads/main/steam-makefile.patch @@ -130,7 +127,10 @@ Recommends: xdg-user-dirs Recommends: gobject-introspection Requires: steam-devices -Requires: steam-device-rules + +# -rm is usually better for Steam +Recommends: udev-joystick-blacklist-rm +Requires: (udev-joystick-blacklist-rm or udev-joystick-blacklist) # Workaround for GNOME issues with libei Recommends: (extest-%{name} if gnome-shell) @@ -142,14 +142,6 @@ and screenshot functionality, and many social features. This package contains the installer for the Steam software distribution service. -%package device-rules -Summary: Fix for keyboard/mouse/tablet being detected as joystick in Linux -Obsoletes: steam-devices < %{version}-%{release} -BuildArch: noarch - -%description device-rules -This package contains fixes for devices being detected incorrectly by Steam. - %prep %autosetup -p1 -n %{name}-launcher @@ -164,10 +156,6 @@ cp %{SOURCE5} . rm -fr %{buildroot}%{_docdir}/%{name}/ \ %{buildroot}%{_bindir}/%{name}deps -mkdir -p %{buildroot}%{_udevrulesdir}/ -install -m 644 -p %{SOURCE6} \ - %{buildroot}%{_udevrulesdir}/ - # Environment files mkdir -p %{buildroot}%{_sysconfdir}/profile.d install -pm 644 %{SOURCE1} %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d @@ -175,9 +163,9 @@ install -pm 644 %{SOURCE1} %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d # Raise file descriptor limit mkdir -p %{buildroot}%{_prefix}/lib/systemd/system.conf.d/ mkdir -p %{buildroot}%{_prefix}/lib/systemd/user.conf.d/ -install -m 644 -p %{SOURCE7} %{buildroot}%{_prefix}/lib/systemd/system.conf.d/ -install -m 644 -p %{SOURCE7} %{buildroot}%{_prefix}/lib/systemd/user.conf.d/ -install -m 775 -p %{SOURCE9} %{buildroot}%{_bindir}/steamrestart +install -m 644 -p %{SOURCE6} %{buildroot}%{_prefix}/lib/systemd/system.conf.d/ +install -m 644 -p %{SOURCE6} %{buildroot}%{_prefix}/lib/systemd/user.conf.d/ +install -m 775 -p %{SOURCE7} %{buildroot}%{_bindir}/steamrestart # https://github.com/ValveSoftware/steam-for-linux/issues/9940 desktop-file-edit --remove-key=PrefersNonDefaultGPU %{buildroot}%{_datadir}/applications/%{name}.desktop @@ -206,9 +194,6 @@ appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{appstream_id %dir %{_prefix}/lib/systemd/user.conf.d/ %{_prefix}/lib/systemd/user.conf.d/01-steam.conf -%files device-rules -%{_udevrulesdir}/51-these-are-not-joysticks-rm.rules - %changelog * Sun Sep 01 2024 Simone Caronni - 1.0.0.81-1 - Update to 1.0.0.81. diff --git a/anda/games/udev-joystick-blacklist/anda.hcl b/anda/games/udev-joystick-blacklist/anda.hcl new file mode 100644 index 0000000000..e0fc065888 --- /dev/null +++ b/anda/games/udev-joystick-blacklist/anda.hcl @@ -0,0 +1,9 @@ +project pkg { + arches = ["x86_64"] + rpm { + spec = "udev-joystick-blacklist.spec" + } + labels { + nightly = 1 + } +} diff --git a/anda/games/udev-joystick-blacklist/udev-joystick-blacklist.spec b/anda/games/udev-joystick-blacklist/udev-joystick-blacklist.spec new file mode 100644 index 0000000000..5370c20d09 --- /dev/null +++ b/anda/games/udev-joystick-blacklist/udev-joystick-blacklist.spec @@ -0,0 +1,52 @@ +%global commit a1ace571823be5979c135e9cb8e9ae103c7641ac +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global commit_date 20250715 + +Name: udev-joystick-blacklist +Version: 0^%{commit_date}git%{shortcommit} +Release: 1%{?dist} +Summary: Fix for keyboard/mouse/tablet being detected as joysticks in Linux +License: Public Domain +URL: https://github.com/denilsonsa/udev-joystick-blacklist +Source0: %{url}/archive/%{commit}.tar.gz +BuildRequires: systemd-rpm-macros +Conflicts: %{name}-rm +BuildArch: noarch +Packager: Gilver E. + +%description +There are several devices that, although recognized by kernel as joysticks, are not joysticks. + +This package contains rules which will prevent those devices from being recognized as joysticks. + +%package rm +Summary: Fix for keyboard/mouse/tablet being detected as joysticks in Linux +Conflicts: %{name} +Obsoletes: steam-device-rules <= 1.0.0.85-1 + +%description rm +There are several devices that, although recognized by kernel as joysticks, are not joysticks. + +This package contains rules which will prevent those devices from being recognized as joysticks by removing the devices. + +%prep +%autosetup -n %{name}-%{commit} + +%build +# Empty. + +%install +install -Dpm644 after_kernel_4_9/51-these-are-not-joysticks.rules -t %{buildroot}%{_udevrulesdir} +install -Dpm644 after_kernel_4_9/51-these-are-not-joysticks-rm.rules -t %{buildroot}%{_udevrulesdir} + +%files +%doc README.md +%{_udevrulesdir}/51-these-are-not-joysticks.rules + +%files rm +%doc README.md +%{_udevrulesdir}/51-these-are-not-joysticks-rm.rules + +%changelog +* Mon Nov 03 2025 Gilver E. - 0^20250715gita1ace57-1 +- Initial package diff --git a/anda/games/udev-joystick-blacklist/update.rhai b/anda/games/udev-joystick-blacklist/update.rhai new file mode 100644 index 0000000000..87e01e4532 --- /dev/null +++ b/anda/games/udev-joystick-blacklist/update.rhai @@ -0,0 +1,5 @@ +rpm.global("commit", gh_commit("denilsonsa/udev-joystick-blacklist")); +if rpm.changed() { + rpm.release(); + rpm.global("commit_date", date()); +}