%global pkg_commit 2077e7af7e9a8c1df54af6f1959cb92daea03207 %global short_sha %(c=%{pkg_commit}; echo ${c:0:7}) %global build_timestamp %(date -u +%%Y%%m%%d%%H%%M%%S) Name: gamepadcalibration Version: 0^%{short_sha} Release: %{build_timestamp}%{?dist} Summary: GPcal — analog stick calibration UI for ROCKNIX-class handhelds License: MIT URL: https://github.com/cdeletre/GPcal Source0: %{url}/archive/%{pkg_commit}/GPcal-%{pkg_commit}.tar.gz Source1: GPcal BuildArch: noarch # Runtime: Python 3 + SDL2 + a per-user pyxel install (created on first launch # by /usr/bin/GPcal, since pyxel is not in Fedora repos). Requires: python3 Requires: SDL2 Requires: python3-pip %description A graphical analog-stick calibration tool for SM8550-class Linux handhelds (originally written by Cyril Deletre for the Retroid Pocket 5 / Mini, used by ROCKNIX on the AYANEO Pocket DS via the rsinput driver). The package installs the GPcal source under %{_datadir}/gpcal/ and a /usr/bin/GPcal launcher that creates a per-user Python venv with pyxel on first invocation, then runs main.py from that venv. %prep %setup -q -n GPcal-%{pkg_commit} # Extract the pre-bundled application source tarball that the upstream uses # for ROCKNIX. We then layer our launcher on top. tar -xzf rocknix/gpcal.tgz # Strip the pre-built Python venv that the upstream tarball ships under # gpcal/pyxel/. It contains: # * x86_64-built native shared objects (would be Arch dependent in noarch) # * absolute symlinks /usr/share/gpcal/pyxel/bin/python3 -> /usr/bin/python3 # Both are RPM-build-blocking. Our launcher (/usr/bin/GPcal) creates a # per-user pyxel venv on first invocation, so the embedded one is dead weight. rm -rf gpcal/pyxel # ROCKNIX's pre-build sed: the pocket-DS / pocket-EVO kernel exposes the # joystick-tuning sysfs under /sys/module/rsinput/parameters, not the upstream # /sys/module/retroid/parameters from the Retroid Pocket fork. sed -i 's|/sys/module/retroid/parameters|/sys/module/rsinput/parameters|g' \ gpcal/Klib/RPocket.py %build # nothing to build — pure Python %install install -d %{buildroot}%{_datadir}/gpcal cp -a gpcal/. %{buildroot}%{_datadir}/gpcal/ chmod 0755 %{buildroot}%{_datadir}/gpcal/main.py install -D -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/GPcal %files %license LICENSE %doc README.md %{_datadir}/gpcal/ %{_bindir}/GPcal %changelog * Wed May 06 2026 Pocket DS Maintainers - %{version}-%{release} - Release auto-stamped from build_timestamp; full history in git log