%global gitbranch edge %global gitcommit 7d5dcea %global gitcommit_short %(echo %{gitcommit} | cut -c1-7) # Stripping the LTO release binary takes a long time and we ship the binary # as-is; skip the separate -debuginfo subpackage. %global debug_package %{nil} Name: xenia-edge Version: 0^g%{gitcommit_short} Release: 1%{?dist} Summary: Xbox 360 emulator research project (Edge fork) License: BSD-3-Clause URL: https://github.com/has207/xenia-edge # Sources are fetched in %%prep via `git clone --recursive`; COPR project l4s # has enable_net=true so this works inside mock as well. ExclusiveArch: aarch64 BuildRequires: cmake >= 3.20 BuildRequires: ninja-build BuildRequires: clang BuildRequires: llvm BuildRequires: lld BuildRequires: git BuildRequires: python3 BuildRequires: gcc-c++ BuildRequires: make # Graphics / shader tooling BuildRequires: mesa-libGL-devel BuildRequires: mesa-libGLU-devel BuildRequires: mesa-vulkan-drivers BuildRequires: vulkan-loader-devel BuildRequires: vulkan-headers # Window system / input BuildRequires: libxcb-devel BuildRequires: libX11-devel BuildRequires: libX11-xcb BuildRequires: xcb-util-devel BuildRequires: SDL2-devel # wxWidgets bundled-build deps (GTK3 backend) BuildRequires: gtk3-devel BuildRequires: fontconfig-devel BuildRequires: expat-devel BuildRequires: zlib-devel # Audio BuildRequires: alsa-lib-devel # Misc BuildRequires: lz4-devel BuildRequires: pkgconfig %description Xenia Edge is a research fork of the Xenia Canary Xbox 360 emulator focused on faster iteration, higher default game compatibility, and improved usability and platform support. %prep rm -rf %{name}-%{version} git clone --depth=1 --branch %{gitbranch} %{url} %{name}-%{version} cd %{name}-%{version} git fetch --depth=1 origin %{gitcommit} git checkout %{gitcommit} # Skip submodules we never compile on aarch64 Linux. The .update=none entries # are honored by `git submodule update --init` (including the one that # `xenia-build.py setup` runs in %%build), so these repos stay un-cloned. # * DirectX-Headers / DirectXShaderCompiler: Windows-only D3D12 paths # * metal-cpp: macOS Metal backend # * xbyak: x86_64 JIT emitter git config submodule.third_party/DirectXShaderCompiler.update none git config submodule.third_party/DirectX-Headers.update none git config submodule.third_party/metal-cpp.update none git config submodule.third_party/xbyak.update none # Pre-fetch submodules with per-submodule retries — parallel `git submodule # update -j N` against the github CDN trips its rate limiter, and worse the # parallel codepath can leave empty submodule dirs on partial failures while # still exiting 0 (cmake then errors on "no SOURCES"). Walk the list serially # and retry each one until it actually checks out. git submodule init git submodule sync # Iterate in the current shell (no pipe → no subshell) so `exit 1` aborts %%prep. submodules=$(git submodule foreach --quiet 'echo $sm_path') for sm in $submodules; do if [ "$(git config --get "submodule.${sm}.update" 2>/dev/null || true)" = "none" ]; then echo "skip ${sm} (update=none)" continue fi ok= for attempt in 1 2 3 4 5 6 7 8; do rm -rf -- "${sm}" ".git/modules/${sm}" git submodule init -- "${sm}" >/dev/null if git submodule update --depth=1 -- "${sm}"; then ok=1 break fi echo "${sm}: attempt ${attempt} failed, retrying in $((attempt * 5))s..." >&2 sleep $((attempt * 5)) done if [ -z "$ok" ]; then echo "submodule ${sm}: exhausted retries" >&2 exit 1 fi done %build cd %{name}-%{version} export CC=clang export CXX=clang++ # Reset the distro hardening flags — they include -fstack-protector-strong and # other options that conflict with xenia's vendored third_party builds. # Also downgrade clang 19+'s default error on incompatible pointer types so # xenia's ffmpeg-xenia codec_list (uses FFCodec*/AVCodec* interchangeably) # compiles; -w alone does not affect default-error diagnostics. export CFLAGS="-Wno-error=incompatible-pointer-types" export CXXFLAGS="-Wno-error=incompatible-pointer-types" export LDFLAGS= # xb setup does non-recursive submodule init + cmake configure on Linux. ./xenia-build.py setup ./xenia-build.py build --config=release -- -j%{?_smp_build_ncpus}%{!?_smp_build_ncpus:1} %install cd %{name}-%{version} install -Dpm0755 build/bin/Linux/Release/xenia_edge %{buildroot}%{_bindir}/xenia_edge install -Dpm0644 assets/xenia_edge.desktop %{buildroot}%{_datadir}/applications/xenia_edge.desktop for sz in 16 32 48 64 128 256 512; do install -Dpm0644 assets/icon/${sz}.png \ %{buildroot}%{_datadir}/icons/hicolor/${sz}x${sz}/apps/xenia_edge.png done %files %license %{name}-%{version}/LICENSE %doc %{name}-%{version}/README.md %{_bindir}/xenia_edge %{_datadir}/applications/xenia_edge.desktop %{_datadir}/icons/hicolor/*/apps/xenia_edge.png %changelog %autochangelog