File retroarch.spec of Package retroarch
#
# spec file for package retroarch
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define appid com.libretro.RetroArch
Name: retroarch
Version: 1.21.0
Release: 0
Summary: Emulator frontend
License: GPL-3.0-only
URL: http://www.retroarch.com
Source0: https://github.com/libretro/RetroArch/releases/download/v%{version}/%{name}-sourceonly-%{version}.tar.xz#/%{name}-%{version}.tar.xz
Patch0: 001-fix-sdl2-discovery.patch
Patch1: 002-use-system-gamemode.patch
Patch2: 003-use-system-discord.patch
Patch3: 004-fix-header-location.patch
Patch4: 005-use-system-xdelta3.patch
BuildRequires: c++_compiler
BuildRequires: discord-rpc-devel
BuildRequires: dr_libs-devel
BuildRequires: fdupes
BuildRequires: p7zip-full
BuildRequires: pkgconfig
BuildRequires: unzip
BuildRequires: xdelta3-devel
BuildRequires: cmake(glslang)
BuildRequires: pkgconfig(Qt6Concurrent)
BuildRequires: pkgconfig(Qt6Core)
BuildRequires: pkgconfig(Qt6Gui)
BuildRequires: pkgconfig(Qt6Network)
BuildRequires: pkgconfig(Qt6Widgets)
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(check)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(egl)
BuildRequires: pkgconfig(flac)
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(gamemode)
BuildRequires: pkgconfig(gbm)
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(jack)
BuildRequires: pkgconfig(libass)
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavdevice)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libdecor-0)
BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(libinput)
BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(libpipewire-0.3)
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(libsixel)
BuildRequires: pkgconfig(libswscale)
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(libusb)
BuildRequires: pkgconfig(libv4l2)
BuildRequires: pkgconfig(mbedtls)
BuildRequires: pkgconfig(mpv)
BuildRequires: pkgconfig(openal)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(python3)
BuildRequires: pkgconfig(sdl2-compat)
BuildRequires: pkgconfig(slang)
BuildRequires: pkgconfig(stb)
BuildRequires: pkgconfig(vorbis)
BuildRequires: pkgconfig(vulkan)
BuildRequires: pkgconfig(wayland-client)
BuildRequires: pkgconfig(wayland-cursor)
BuildRequires: pkgconfig(wayland-egl)
BuildRequires: pkgconfig(wayland-protocols)
BuildRequires: pkgconfig(wayland-scanner)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xcb)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xinerama)
BuildRequires: pkgconfig(xkbcommon)
BuildRequires: pkgconfig(xrandr)
BuildRequires: pkgconfig(xv)
BuildRequires: pkgconfig(xxf86vm)
BuildRequires: pkgconfig(zlib)
# Xbox One/Series controller wireless driver
Recommends: xpadneo
%description
RetroArch is a modular multi-system emulator system that is designed to be
fast, lightweight, and portable. It has features few other emulators frontends
have, such as real-time rewinding and game-aware shading.
%prep
%autosetup -p1 -n %{name}-sourceonly-%{version}
# let's remove all vendored dependencies
rm -rf deps
%build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
./configure --prefix=%{_prefix} --enable-hid
%make_build
%install
%make_install
%fdupes %{buildroot}
# delete doc as we use the doc macro
rm -rf %{buildroot}%{_datadir}/doc/%{name}
%files
%license COPYING
%doc AUTHORS.h CHANGES.md CODE_OF_CONDUCT.md CODING-GUIDELINES CONTRIBUTING.md SECURITY.md
%doc README-exynos.md README-mali_fbdev_r4p0.md README.md README-OMAP.md
%config(noreplace) %{_sysconfdir}/%{name}.cfg
%{_bindir}/%{name}
%{_bindir}/%{name}-cg2glsl
%{_datadir}/applications/%{appid}.desktop
%{_datadir}/metainfo/%{appid}.metainfo.xml
%{_datadir}/pixmaps/%{appid}.svg
%{_mandir}/man?/%{name}-cg2glsl.?%{?ext_man}
%{_mandir}/man?/%{name}.?%{?ext_man}
%changelog