%global commit 36d9fa6a1ad12b2728dd9339ada068bbb285718c %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global git_date 20260318T203910Z %global tag 3.16.22 %global clean_tag %(echo %{tag} | sed 's/^v//') %global libliftoff_minver 0.4.1 # Bundled submodule commits %global wlroots_commit 54e844748029d4874e14d0c086d50092c04c8899 %global libliftoff_commit 8b08dc1c14fd019cc90ddabe34ad16596b0691f4 %global vkroots_commit 5106d8a0df95de66cc58dc1ea37e69c99afc9540 %global reshade_commit 696b14cd6006ae9ca174e6164450619ace043283 Name: gamescope Version: %{clean_tag}^%{git_date}.g%{shortcommit} Release: %autorelease Summary: Micro-compositor for video games on Wayland License: BSD URL: https://github.com/ValveSoftware/gamescope Source0: %{url}/archive/%{commit}.tar.gz # Create stb.pc to satisfy dependency('stb') Source1: stb.pc # Bundled submodules Source2: https://github.com/Joshua-Ashton/wlroots/archive/%{wlroots_commit}.tar.gz Source3: https://gitlab.freedesktop.org/emersion/libliftoff/-/archive/%{libliftoff_commit}/libliftoff-%{libliftoff_commit}.tar.gz Source4: https://github.com/Joshua-Ashton/vkroots/archive/%{vkroots_commit}.tar.gz Source5: https://github.com/Joshua-Ashton/reshade/archive/%{reshade_commit}.tar.gz Patch1: 001-silence-meson-error.patch # Fix wlroots build with libinput >= 1.31 (LIBINPUT_SWITCH_KEYPAD_SLIDE) Patch2: 002-wlroots-libinput-switch-keypad-slide.patch BuildRequires: meson >= 0.54.0 BuildRequires: ninja-build BuildRequires: cmake BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: glm-devel BuildRequires: google-benchmark-devel BuildRequires: libXmu-devel BuildRequires: libXcursor-devel BuildRequires: libeis-devel BuildRequires: pixman-devel BuildRequires: pkgconfig(libdisplay-info) BuildRequires: pkgconfig(pixman-1) >= 0.42.0 BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xdamage) BuildRequires: pkgconfig(xcomposite) BuildRequires: pkgconfig(xrender) BuildRequires: pkgconfig(xext) BuildRequires: pkgconfig(xfixes) BuildRequires: pkgconfig(xxf86vm) BuildRequires: pkgconfig(xtst) BuildRequires: pkgconfig(xres) BuildRequires: pkgconfig(libdrm) >= 2.4.113 BuildRequires: pkgconfig(vulkan) BuildRequires: pkgconfig(wayland-scanner) BuildRequires: pkgconfig(wayland-server) >= 1.21 BuildRequires: pkgconfig(wayland-protocols) >= 1.41 BuildRequires: pkgconfig(xkbcommon) BuildRequires: pkgconfig(sdl2) BuildRequires: pkgconfig(luajit) BuildRequires: pkgconfig(libpipewire-0.3) BuildRequires: pkgconfig(libavif) >= 1.0.0 BuildRequires: pkgconfig(libcap) BuildRequires: pkgconfig(hwdata) BuildRequires: spirv-headers-devel ## Bundled wlroots dependencies BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(gbm) >= 17.1.0 BuildRequires: pkgconfig(glesv2) BuildRequires: pkgconfig(lcms2) BuildRequires: pkgconfig(libinput) >= 1.21.0 BuildRequires: pkgconfig(libseat) BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(x11-xcb) BuildRequires: pkgconfig(xcb) BuildRequires: pkgconfig(xcb-errors) BuildRequires: pkgconfig(xcb-icccm) BuildRequires: pkgconfig(xcb-renderutil) BuildRequires: pkgconfig(xkbcommon) # Enforce the the minimum EVR to contain fixes for all of: # CVE-2021-28021 CVE-2021-42715 CVE-2021-42716 CVE-2022-28041 CVE-2023-43898 # CVE-2023-45661 CVE-2023-45662 CVE-2023-45663 CVE-2023-45664 CVE-2023-45666 # CVE-2023-45667 BuildRequires: stb_image-devel >= 2.28^20231011gitbeebb24-12 # Header-only library: -static is for tracking per guidelines BuildRequires: stb_image-static BuildRequires: stb_image_resize-devel BuildRequires: stb_image_resize-static BuildRequires: stb_image_write-devel BuildRequires: stb_image_write-static BuildRequires: /usr/bin/glslangValidator BuildRequires: libdecor-devel BuildRequires: libXdamage-devel BuildRequires: xorg-x11-server-Xwayland-devel BuildRequires: git Requires: xorg-x11-server-Xwayland Requires: gamescope-libs = %{version}-%{release} %ifarch x86_64 Requires: gamescope-libs(x86-32) = %{version}-%{release} %endif Recommends: mesa-dri-drivers Recommends: mesa-vulkan-drivers %description %{name} is the micro-compositor optimized for running video games on Wayland. %package libs Summary: libs for %{name} %description libs %summary %prep %autosetup -n gamescope-%{commit} -N # Apply patches %patch -P1 -p1 # Extract bundled submodules tar xzf %{SOURCE2} --strip-components=1 -C subprojects/wlroots tar xzf %{SOURCE3} --strip-components=1 -C subprojects/libliftoff tar xzf %{SOURCE4} --strip-components=1 -C subprojects/vkroots tar xzf %{SOURCE5} --strip-components=1 -C src/reshade # Apply libinput >= 1.31 fix only when needed %if 0%{?fedora} >= 44 %patch -P2 -p1 %endif # Create stb.pc to satisfy dependency('stb') mkdir -p pkgconfig cp %{SOURCE1} pkgconfig/stb.pc # Replace spirv-headers include with the system directory sed -i 's^../thirdparty/SPIRV-Headers/include/spirv/^/usr/include/spirv/^' src/meson.build %build export PKG_CONFIG_PATH=pkgconfig MESON_OPTIONS=( -Dbenchmark=enabled -Ddrm_backend=enabled -Denable_gamescope=true -Denable_gamescope_wsi_layer=true -Dpipewire=enabled -Dinput_emulation=enabled -Drt_cap=enabled -Davif_screenshots=enabled -Dsdl2_backend=enabled -Denable_openvr_support=false -Dforce_fallback_for=vkroots,wlroots,libliftoff ) %meson "${MESON_OPTIONS[@]}" %meson_build %install %meson_install --skip-subprojects %files %license LICENSE %doc README.md %{_bindir}/gamescope %{_bindir}/gamescopectl %{_bindir}/gamescopereaper %{_bindir}/gamescopestream %{_bindir}/gamescope-type %{_datadir}/gamescope/ %files libs %{_libdir}/*.so %{_datadir}/vulkan/implicit_layer.d/ %changelog %autochangelog