File rpcsx.spec of Package rpcsx

%global builddate 202504255
%undefine _hardened_build
%undefine _ld_as_needed
%undefine _auto_set_build_flags
%global _lto_cflags %{nil}
%global __os_install_post %{nil}

Name: rpcsx
Version: %{builddate}
Release: %{autorelease}
Summary: PS3 Emulator
License: MIT

Source0: rpcsx.tar.gz

BuildRequires: cmake
BuildRequires: systemd-devel
BuildRequires: libunwind-devel
BuildRequires: glfw-devel
BuildRequires: vulkan-devel
BuildRequires: sox-devel
BuildRequires: alsa-lib-devel
BuildRequires: nasm
BuildRequires: ffmpeg-free-devel
BuildRequires: libavformat-free-devel
BuildRequires: libswscale-free-devel
BuildRequires: libswresample-free-devel
BuildRequires: libavutil-free-devel
BuildRequires: libavfilter-free-devel
BuildRequires: libavdevice-free-devel
BuildRequires: libavcodec-free-devel
BuildRequires: libpostproc-free-devel
BuildRequires: qt6-qtbase-devel
BuildRequires: qt6-qtmultimedia-devel
BuildRequires: qt6-qtsvg-devel
BuildRequires: openal-soft-devel
BuildRequires: SDL3-devel
BuildRequires: glew-devel
BuildRequires: libcurl-devel
BuildRequires: llvm
BuildRequires: llvm-devel
BuildRequires: lld
BuildRequires: mlir-devel
BuildRequires: ninja-build
BuildRequires: clang
BuildRequires: clang-devel

%description
%{summary}.

%prep
%autosetup -n rpcsx

%build
export CC=gcc
export CXX=g++
export CFLAGS="-fuse-ld=lld"
export CXXFLAGS=
export LDFLAGS=

cmake -B build                                         \
    -DCMAKE_INSTALL_PREFIX=%{buildroot}/usr            \
    -DUSE_NATIVE_INSTRUCTIONS=OFF                      \
    -DUSE_PRECOMPILED_HEADERS=OFF                      \
    -DUSE_SDL=OFF                                      \
    -DUSE_SYSTEM_FFMPEG=ON                             \
    -DUSE_SYSTEM_CURL=ON                               \
    -DUSE_SYSTEM_OPENAL=ON                             \
    -DUSE_DISCORD_RPC=ON                               \
    -DOpenGL_GL_PREFERENCE=LEGACY                      \
    -DSTATIC_LINK_LLVM=ON                              \
    -DBUILD_LLVM=OFF                                   \
    -DWITH_RPCSX=OFF                                   \
    -DWITH_RPCS3=ON                                    \
    -DWITH_RPCS3_QT_UI=ON                              \
    -DCMAKE_BUILD_TYPE=Release                         \
    -DCMAKE_CXX_FLAGS_INIT="-march=armv8-a+crc+simd+crypto -mcpu=cortex-a57" \
    -G Ninja

cmake --build build -j$(nproc) -- -v

%install
cmake --install build

%files
%{_bindir}/rpcs3qt-ui-legacy
%{_datadir}/icons/hicolor/scalable/apps/rpcs3.svg
%{_datadir}/icons/hicolor/48x48/apps/rpcs3.png
%{_datadir}/applications/rpcs3.desktop
%{_datadir}/metainfo/rpcs3.metainfo.xml
%{_datadir}/rpcs3/Icons/ui/*
%{_datadir}/rpcs3/GuiConfigs/*
%{_datadir}/rpcs3/git/*
%{_datadir}/rpcs3/test/*

%changelog
%{autochangelog}
openSUSE Build Service is sponsored by