Name: duckstation Version: 0.1.9483 Release: 1%{?dist} Summary: A fast PlayStation 1 emulator License: CC-BY-NC-ND-4.0 URL: https://github.com/stenzek/duckstation # Main source tarball from the release tag Source0: https://github.com/stenzek/duckstation/archive/refs/tags/v0.1-9483.tar.gz # Cheat and patch databases Source1: https://github.com/duckstation/chtdb/releases/download/latest/cheats.zip Source2: https://github.com/duckstation/chtdb/releases/download/latest/patches.zip # Source for Discord RPC Source3: https://github.com/discord/discord-rpc/archive/refs/tags/v3.4.0.tar.gz # Don't want extra flags producing a slower build than our other formats. %undefine _hardened_build %undefine _annotated_build %undefine _fortify_level %undefine _include_frame_pointers # Defines -O2, -flto, and others. We manage LTO ourselves. %global _general_options "-O3" "-pipe" %global _preprocessor_defines "" # We include debug information in the main package for user backtrace reporting. %global debug_package %{nil} BuildRequires: alsa-lib-devel BuildRequires: autoconf BuildRequires: automake BuildRequires: brotli-devel BuildRequires: clang BuildRequires: cmake BuildRequires: cpuinfo-devel BuildRequires: curl BuildRequires: dbus-devel BuildRequires: egl-wayland-devel BuildRequires: extra-cmake-modules BuildRequires: fontconfig-devel BuildRequires: gcc-c++ BuildRequires: git BuildRequires: gtk3-devel BuildRequires: libavcodec-free-devel BuildRequires: libavformat-free-devel BuildRequires: libavutil-free-devel BuildRequires: libcurl-devel BuildRequires: libdecor-devel BuildRequires: libevdev-devel BuildRequires: libICE-devel BuildRequires: libinput-devel BuildRequires: libSM-devel BuildRequires: libswresample-free-devel BuildRequires: libswscale-free-devel BuildRequires: libX11-devel BuildRequires: libXau-devel BuildRequires: libxcb-devel BuildRequires: libXcomposite-devel BuildRequires: libXcursor-devel BuildRequires: libXext-devel BuildRequires: libXfixes-devel BuildRequires: libXft-devel BuildRequires: libXi-devel BuildRequires: libxkbcommon-devel BuildRequires: libxkbcommon-x11-devel BuildRequires: libXpresent-devel BuildRequires: libXrandr-devel BuildRequires: libXrender-devel BuildRequires: libtool BuildRequires: lld BuildRequires: llvm BuildRequires: make BuildRequires: mesa-libEGL-devel BuildRequires: mesa-libGL-devel BuildRequires: nasm BuildRequires: ninja-build BuildRequires: openssl-devel BuildRequires: patch BuildRequires: pcre2-devel BuildRequires: perl-Digest-SHA BuildRequires: pipewire-devel BuildRequires: plutosvg-devel BuildRequires: pulseaudio-libs-devel BuildRequires: SDL3-devel BuildRequires: systemd-devel BuildRequires: wayland-devel BuildRequires: xcb-util-cursor-devel BuildRequires: xcb-util-devel BuildRequires: xcb-util-errors-devel BuildRequires: xcb-util-image-devel BuildRequires: xcb-util-keysyms-devel BuildRequires: xcb-util-renderutil-devel BuildRequires: xcb-util-wm-devel BuildRequires: xcb-util-xrm-devel BuildRequires: zlib-devel BuildRequires: qt6-qtbase-devel BuildRequires: qt6-qtbase-private-devel BuildRequires: qt6-qttools BuildRequires: qt6-qttools-devel Requires: bash Requires: curl Requires: dbus Requires: freetype Requires: libpng Requires: libwebp Requires: libzip Requires: libzstd Requires: qt6-qtbase Requires: qt6-qtbase-gui Requires: qt6-qtimageformats Requires: qt6-qtsvg %description DuckStation is an simulator/emulator of the Sony PlayStation(TM) console, focusing on playability, speed, and long-term maintainability. The goal is to be as accurate as possible while maintaining performance suitable for low-end devices. "Hack" options are discouraged, the default configuration should support all playable games with only some of the enhancements having compatibility issues. "PlayStation" and "PSX" are registered trademarks of Sony Interactive Entertainment Europe Limited. This project is not affiliated in any way with Sony Interactive Entertainment. %prep # Unpack the main source first. %setup -q -n duckstation-0.1-9483 # Unpack and build discord-rpc from Source3 before proceeding. # The `%setup -a 3` will unpack the tarball from Source3. %setup -q -a 3 # Navigate to the discord-rpc source directory, build, and install. pushd discord-rpc-3.4.0 mkdir build cd build cmake .. -DCMAKE_INSTALL_PREFIX=%{_builddir}/duckstation-0.1-9483/deps \ -DBUILD_SHARED_LIBS=OFF cmake --build . --config Release --target install # Return to the main source directory. popd # Use sed to fix the SDL3 version requirement sed -i 's/find_package(SDL3 3.2.18/find_package(SDL3 3.2.16/' CMakeModules/DuckStationDependencies.cmake mkdir -p data/resources/ cp %{SOURCE1} data/resources/cheats.zip cp %{SOURCE2} data/resources/patches.zip %build if [ ! -d "${PWD}/deps" ]; then scripts/deps/build-dependencies-linux.sh "${PWD}/deps" fi rm -fr build cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH="%{_builddir}/duckstation-0.1-9483/deps;/usr" \ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" \ -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \ -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \ -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \ -DALLOW_INSTALL=ON -DINSTALL_SELF_CONTAINED=ON \ -DUSE_FBDEV=ON \ -DCMAKE_INSTALL_PREFIX=%{buildroot}/opt/%{name} ninja -C build %{?_smp_mflags} %install rm -fr %{buildroot} ninja -C build install mkdir -p %{buildroot}/opt/duckstation mkdir -p %{buildroot}/usr/bin ln -s /opt/duckstation/duckstation-qt %{buildroot}/usr/bin/duckstation-qt install -Dm644 scripts/packaging/org.duckstation.DuckStation.png %{buildroot}/usr/share/icons/hicolor/512x512/apps/org.duckstation.DuckStation.png install -Dm644 scripts/packaging/org.duckstation.DuckStation.desktop %{buildroot}/usr/share/applications/org.duckstation.DuckStation.desktop %files %license LICENSE /opt/duckstation /usr/bin/duckstation-qt /usr/share/icons/hicolor/512x512/apps/org.duckstation.DuckStation.png /usr/share/applications/org.duckstation.DuckStation.desktop