%define _binaries_in_noarch_packages_terminate_build 0 Name: gamescope-session Version: 0.2.git.201.5538cd66 Release: 25%{?dist} Summary: Steam Big Picture Mode/Gamemode session based on gamescope License: MIT URL: https://github.com/KyleGospo/gamescope-session VCS: git+https://github.com/KyleGospo/gamescope-session.git#5538cd66e4d8ee19b5c40a53e6f781b61cc68a6f: Source0: gamescope-session-5538cd66.tar.gz # This rescales the desktop to 1.5 for handheld screen viewing Source3: deckscale.desktop Source4: deckscale Patch0: fedora.patch Patch1: 0001-nobara-changes.patch BuildArch: noarch Requires: gamescope Requires: edid-decode Requires: python3 Requires: pulseaudio-utils Requires: powerbuttond BuildRequires: systemd-rpm-macros BuildRequires: git BuildRequires: glibc-devel(x86-32) BuildRequires: cmake BuildRequires: make BuildRequires: gcc %description Steam Big Picture Mode/Gamemode session based on gamescope # Disable debug packages %define debug_package %{nil} %prep %setup -T -b 0 -q -n gamescope-session %patch 0 -p1 %patch 1 -p1 # The Steam Deck controller's touchpad breaks cursor movement when steam is opened on wayland # To fix this we use the following workaround: # https://github.com/Supreeeme/extest # We compile this manually and provide the result git clone https://github.com/Supreeeme/extest cd extest curl https://sh.rustup.rs -sSf | sh -s -- -y source "$HOME/.cargo/env" rustup target add i686-unknown-linux-gnu cargo build --release cd .. %build %install mkdir -p %{buildroot}%{_bindir}/ mkdir -p %{buildroot}%{_datadir}/ mkdir -p %{buildroot}%{_userunitdir}/ mkdir -p %{buildroot}%{_sysconfdir}/xdg/autostart/ mkdir -p %{buildroot}%{_sysconfdir}/skel/Desktop/ mkdir -p %{buildroot}%{_sysconfdir}/skel/.local/share/ mkdir -p %{buildroot}%{_datadir}/gamescope-session/sessions.d/ mkdir -p %{buildroot}%{_sysconfdir}/gamescope-session/sessions.d/ mkdir -p %{buildroot}%{_libexecdir}/ cp -rv usr/bin/* %{buildroot}%{_bindir} cp -rv usr/share/* %{buildroot}%{_datadir} cp -rv etc/skel/Desktop/steam.desktop %{buildroot}%{_sysconfdir}/xdg/autostart/ cp -rv etc/skel/Desktop/* %{buildroot}%{_sysconfdir}/skel/Desktop/ cp -rv etc/skel/Desktop/Return.desktop %{buildroot}%{_sysconfdir}/skel/Desktop/RemoteHost.desktop chmod +x %{buildroot}%{_sysconfdir}/skel/Desktop/steam.desktop chmod +x %{buildroot}%{_sysconfdir}/skel/Desktop/Return.desktop cp -v usr/lib/systemd/user/* %{buildroot}%{_userunitdir} rm -rf %{buildroot}%{_bindir}/steamos-polkit-helpers rm %{buildroot}%{_bindir}/jupiter-biosupdate cp -rv usr/libexec/os-session-select %{buildroot}%{_libexecdir}/os-session-select cp -rv %{SOURCE3} %{buildroot}%{_sysconfdir}/xdg/autostart/ cp -rf %{SOURCE4} %{buildroot}%{_bindir}/ chmod +x %{buildroot}%{_bindir}/deckscale chmod +x %{buildroot}%{_bindir}/steamrestart cp extest/target/i686-unknown-linux-gnu/release/libextest.so %{buildroot}%{_datadir}/gamescope-session/ # Do post-installation %post # steam bootstrap needed for gamescope-session first-run tar -xf /usr/lib/steam/bootstraplinux_ubuntu12_32.tar.xz -C %{_sysconfdir}/skel/.local/share/ # libextest override needed to fix wayland mouse cursor breakage when steam is running on Steam Deck tar -xf %{_datadir}/gamescope-session/libextest.tar.gz -C %{_datadir}/gamescope-session/ sed -i 's|/usr/bin/steam |/usr/bin/steam -silent -steamdeck |g' %{_sysconfdir}/xdg/autostart/steam.desktop sed -i 's|/usr/bin/steam |/usr/bin/steam -silent -steamdeck |g' %{_sysconfdir}/skel/Desktop/steam.desktop sed -i 's|steamos-desktop-return|/usr/bin/steamrestart \&\& env LD_PRELOAD=/usr/share/gamescope-session/libextest.so /usr/bin/steam -silent -steamdeck -pipewire|g' %{_sysconfdir}/skel/Desktop/RemoteHost.desktop sed -i 's|Return to Gaming Mode|Host Remote Play|g' %{_sysconfdir}/skel/Desktop/RemoteHost.desktop # KDE/SDDM if [[ ! -z $(systemctl status sddm | grep running) ]]; then if [[ -f /etc/sddm.conf ]]; then sed -i "s|Relogin=.*|Relogin=true|g" /etc/sddm.conf if [[ -z $(cat /etc/sddm.conf | grep Relogin) ]]; then sed -i '/\[Autologin\]/a\Relogin=true' /etc/sddm.conf fi elif [[ -f /etc/sddm.conf.d/kde_settings.conf ]]; then sed -i "s|Relogin=.*|Relogin=true|g" /etc/sddm.conf.d/kde_settings.conf if [[ -z $(cat /etc/sddm.conf.d/kde_settings.conf | grep Relogin) ]]; then sed -i '/\[Autologin\]/a\Relogin=true' /etc/sddm.conf.d/kde_settings.conf fi fi fi # Do before uninstallation %preun # Do after uninstallation %postun # This lists all the files that are included in the rpm package and that # are going to be installed into target system where the rpm is installed. %files %license LICENSE %doc README.md %{_bindir}/gamescope-session %{_bindir}/steam-http-loader %{_bindir}/steamos-session-select %{_bindir}/steamos-desktop-return %{_bindir}/steamos-update %{_bindir}/deckscale %{_bindir}/steamrestart %{_bindir}/export-gpu %{_bindir}/steamos-select-branch %{_libexecdir}/os-session-select %{_datadir}/applications/gamescope-mimeapps.list %{_datadir}/applications/steam_http_loader.desktop %{_datadir}/gamescope-session/device-quirks %{_datadir}/gamescope-session/libextest.so %{_sysconfdir}/skel/ %{_datadir}/gamescope-session/gamescope-session-script %{_datadir}/icons/hicolor/scalable/actions/steamdeck-gaming-return.svg %{_datadir}/icons/hicolor/scalable/apps/install-firefox.svg %{_datadir}/icons/hicolor/scalable/places/distributor-logo.svg %{_datadir}/icons/hicolor/scalable/places/distributor-logo-steamdeck.svg %{_datadir}/polkit-1/actions/org.nobaraproject.update.policy %{_datadir}/polkit-1/actions/org.nobaraproject.session.select.policy %{_datadir}/wayland-sessions/gamescope-session.desktop %{_sysconfdir}/xdg/autostart/steam.desktop %{_sysconfdir}/xdg/autostart/deckscale.desktop %{_userunitdir}/gamescope-session.service # Finally, changes from the latest release of your application are generated from # your project's Git history. It will be empty until you make first annotated Git tag. %changelog