%global upstream_owner mmogr %global upstream_repo flip-companion %global upstream_tag v0.1.2 # Set this to a non-empty value to build from the Pocket DS fork instead # (https://gitlab.com/linux-pocketds/flip-companion). When unset, we fetch # the upstream mmogr tag directly. Override on the rpmbuild command line: # rpmbuild --define 'fork_url https://gitlab.com/linux-pocketds/flip-companion/-/archive/arm64-fixes/...' %global fork_url %{nil} Name: flip-companion Version: 0.1.2 Release: 20260517180000%{?dist} Summary: Bottom-screen companion app for AYANEO Flip/Pocket DS (virtual keyboard, stats, window shuttle) License: MIT URL: https://github.com/%{upstream_owner}/%{upstream_repo} # Upstream tarball. The fork_url macro overrides this when building from # our Pocket-DS-specific branch. Source0: https://github.com/%{upstream_owner}/%{upstream_repo}/archive/refs/tags/%{upstream_tag}.tar.gz#/%{name}-%{upstream_tag}.tar.gz # Patch slot: any arm64 / Pocket-DS-specific fixes that don't belong # upstream live in patches/ and are applied here. Leave the list empty # when nothing's pending. (Numbered to leave room for additions without # renumbering existing files.) # Patch0001: patches/0001-arm64-pin-slint-renderer.patch # Pocket DS is aarch64-only; refuse the build on x86 to avoid wasted # COPR cycles. (BuildArch: aarch64 would make this a no-arch RPM — # wrong: flip-companion is a compiled binary with a real ELF arch.) ExclusiveArch: aarch64 # Rust + Cargo. Slint requires rustc >= 1.75; Fedora 44 ships 1.83+. BuildRequires: rust >= 1.75 BuildRequires: cargo BuildRequires: pkgconf-pkg-config BuildRequires: gcc BuildRequires: clang BuildRequires: cmake # Slint native deps (default winit/femtovg backend). BuildRequires: fontconfig-devel BuildRequires: freetype-devel BuildRequires: libxkbcommon-devel # smithay (backend_drm + backend_libinput) deps. BuildRequires: libdrm-devel BuildRequires: libinput-devel BuildRequires: mesa-libgbm-devel BuildRequires: mesa-libEGL-devel BuildRequires: libseat-devel BuildRequires: wayland-devel BuildRequires: wayland-protocols-devel # systemd macros for the user-unit preset hook. BuildRequires: systemd-rpm-macros # Runtime deps. Requires: libdrm Requires: libinput Requires: libseat Requires: libxkbcommon Requires: fontconfig # Touch toggle helper shells out to udevadm + chmod; both already on a # baseline systemd image but listed for explicitness. Requires: systemd-udev # KWin script lives in /usr/share/kwin/scripts/; the runtime activator # is kpackagetool6 from kf6-plasma-workspace (handled by Plasma at # session start, no install-time invocation needed). Recommends: plasma-workspace >= 6.0 # The companion talks to KScreen and KWin Script over D-Bus. Recommends: libkscreen # /dev/uinput uaccess rule is shipped by pocketds-steam; the udev rule # below is the upstream copy, so we use Conflicts to avoid file overlap # rather than Requires. # (No Requires on pocketds-steam: the companion is useful outside the # SteamOS profile.) %description Flip Companion is a Slint/Rust application for the bottom screen of the AYANEO Flip / Pocket DS handhelds. It presents three tabs: * Virtual QWERTY keyboard backed by uinput. * Live system stats (CPU, GPU, RAM, battery, thermals via sysinfo). * "Shuttle" — moves windows between the top and bottom panels through a KWin Script over D-Bus. Originally written for Bazzite; this package adapts the upstream mmogr/flip-companion release to the AYANEO Pocket DS Fedora image (arm64 build, Plasma 6 paths, /dev/uinput uaccess rule already covered by pocketds-steam so the upstream udev drop-in is excluded). %prep # GitHub's archive/refs/tags/vN.M.K.tar.gz extracts to -N.M.K # (the leading `v` is stripped). Version: is already 0.1.1 without the # v, so %{version} is exactly the unpacked dir suffix. (Older attempts # used %%{upstream_tag:s/v//} but RPM's macro substitution syntax # doesn't have a /sed/-style branch — it errors as a non-parametric # macro.) %setup -q -n %{upstream_repo}-%{version} # Apply patches if any. Uncomment %%autopatch -p1 once patches/ has # at least one .patch listed in the preamble above. %build # Online cargo build. COPR mock should be invoked with network=true. # Local rpmbuild "just works" since ~/.cargo points at crates.io. cargo build --release --locked %install install -D -m 0755 target/release/flip-companion %{buildroot}%{_bindir}/flip-companion # Switchdeck-derived udev rule (uaccess for /dev/uinput) — Pocket DS # already ships an identical file from pocketds-steam, so we install # the upstream one under a flip-companion-specific filename and rely # on Conflicts: at runtime if both packages are present. # Skipped here intentionally; uncomment for non-Pocket-DS hosts: #install -D -m 0644 deploy/udev/99-uinput.rules \ # %{buildroot}%{_sysconfdir}/udev/rules.d/99-flip-companion-uinput.rules # Desktop entry. The v0.1.2 tag ships only flip-companion.desktop; # the -desktop-reset / -disable-hhd-touch helpers landed on main after # the tag and will arrive when the next upstream release cuts. Add the # install lines back here when bumping upstream_tag past that point. install -D -m 0644 deploy/desktop/flip-companion.desktop \ %{buildroot}%{_datadir}/applications/flip-companion.desktop # User systemd unit. install -D -m 0644 deploy/systemd/flip-companion.service \ %{buildroot}%{_userunitdir}/flip-companion.service # KWin Script tree (the Shuttle backend). install -d %{buildroot}%{_datadir}/kwin/scripts/flip-companion cp -r kwin-script/contents kwin-script/metadata.json \ %{buildroot}%{_datadir}/kwin/scripts/flip-companion/ # Default Apps Panel config (apps.toml) goes to /etc/skel so each new # user starts with the upstream tile set; per-user edits land at # ~/.config/flip-companion/apps.toml and override. install -D -m 0644 apps.toml \ %{buildroot}%{_sysconfdir}/skel/.config/flip-companion/apps.toml %files # Upstream v0.1.2 doesn't ship a LICENSE file even though Cargo.toml # says MIT; rely on the License: tag in the preamble for now. When # upstream adds the file, re-introduce a %%license LICENSE line. %doc README.md %{_bindir}/flip-companion %{_datadir}/applications/flip-companion.desktop %{_userunitdir}/flip-companion.service %dir %{_datadir}/kwin/scripts/flip-companion %{_datadir}/kwin/scripts/flip-companion/metadata.json %{_datadir}/kwin/scripts/flip-companion/contents %dir %{_sysconfdir}/skel/.config/flip-companion %config(noreplace) %{_sysconfdir}/skel/.config/flip-companion/apps.toml %post %systemd_user_post flip-companion.service %preun %systemd_user_preun flip-companion.service %postun %systemd_user_postun flip-companion.service %changelog * Sun May 17 2026 Pocket DS Maintainers - %{version}-%{release} - Initial package: build mmogr/flip-companion %{upstream_tag} from source for aarch64; install binary, KWin Shuttle script, desktop entries, user systemd unit, default apps.toml. Upstream uinput.rules omitted because pocketds-steam already ships an identical file.