File dolphin-emu.spec of Package dolphin-emu-git
#
# spec file for package dolphin-emu
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
%global use_clang 1
%global use_lld 1
%ifarch %ix86 %arm
%global use_lto 0
%else
%global use_lto 1
%endif
# upstream wants qt6 now
%define use_qt6 1
%define _realname dolphin
%define package_name dolphin-emu
Name: %{package_name}-git
Version: 20250204.b51ca8203
Release: 0
Summary: Gamecube / Wii / Triforce Emulator
License: GPL-2.0
Group: System/Emulators/Other
Url: http://www.dolphin-emu.org/
# https://github.com/dolphin-emu/dolphin
Source0: %{_realname}-%{version}.tar.xz
BuildRequires: hicolor-icon-theme
BuildRequires: update-desktop-files
BuildRequires: fdupes
BuildRequires: git
BuildRequires: cmake
BuildRequires: extra-cmake-modules
%if 0%{?use_clang}
BuildRequires: clang-devel
#BuildRequires: npth-devel
%if 0%{?use_lld}
BuildRequires: lld
%else
BuildRequires: binutils-gold
BuildRequires: llvm-gold
%endif
%else
BuildRequires: binutils-gold
BuildRequires: gcc-c++
%endif
#BuildRequires: gtest-devel
BuildRequires: alsa-devel
BuildRequires: libjack-devel
BuildRequires: libpulse-devel
BuildRequires: libao-devel
BuildRequires: openal-devel
BuildRequires: portaudio-devel
BuildRequires: soundtouch-devel
BuildRequires: libusb-1_0-devel
BuildRequires: bluez-devel
BuildRequires: libminiupnpc-devel
BuildRequires: libpng-devel
BuildRequires: glew-devel
BuildRequires: sfml2-devel
BuildRequires: imgui-devel
# it's not compatible with current version due to dependency on removed blip-buf
#BuildRequires: mgba-devel
BuildRequires: pkgconfig(gtk+-2.0)
BuildRequires: pkgconfig(egl)
BuildRequires: pkgconfig(fmt)
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(libevdev)
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavdevice)
BuildRequires: pkgconfig(libavfilter)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libedit)
BuildRequires: pkgconfig(libenet)
BuildRequires: pkgconfig(libswresample)
BuildRequires: pkgconfig(libswscale)
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(liblz4)
BuildRequires: pkgconfig(lzo2)
BuildRequires: pkgconfig(mbedtls) < 3.0.0
BuildRequires: pkgconfig(pugixml)
BuildRequires: pkgconfig(hidapi-hidraw)
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(speexdsp)
BuildRequires: pkgconfig(tinfo)
BuildRequires: pkgconfig(xi)
BuildRequires: pkgconfig(xrandr)
BuildRequires: pkgconfig(zlib-ng)
BuildRequires: libzstd-devel-static
BuildRequires: pkgconfig(minizip-ng)
BuildRequires: minizip-devel-compat
# WTF does it not get pulled?
BuildRequires: libminizip1 >= 4.0.0
BuildRequires: pkgconfig(vulkan)
BuildRequires: glslang-devel
BuildRequires: spirv-tools-devel
BuildRequires: shaderc-devel
#BuildRequires: pkgconfig(libzip)
#BuildRequires: pkgconfig(clzma)
#BuildRequires: lzlib-devel
%if 0%{?use_qt6}
BuildRequires: qt6-gui-private-devel
BuildRequires: cmake(Qt6LinguistTools)
BuildRequires: pkgconfig(Qt6Concurrent)
BuildRequires: pkgconfig(Qt6Core)
BuildRequires: pkgconfig(Qt6DBus)
BuildRequires: pkgconfig(Qt6Multimedia)
BuildRequires: pkgconfig(Qt6MultimediaWidgets)
BuildRequires: pkgconfig(Qt6Network)
BuildRequires: pkgconfig(Qt6OpenGL)
BuildRequires: pkgconfig(Qt6Qml)
BuildRequires: pkgconfig(Qt6Svg)
BuildRequires: pkgconfig(Qt6WaylandClient)
BuildRequires: pkgconfig(Qt6WebEngineCore)
BuildRequires: pkgconfig(Qt6WebEngineWidgets)
BuildRequires: pkgconfig(Qt6Widgets)
%else
BuildRequires: libQt5PlatformSupport-private-headers-devel
BuildRequires: libqt5-qtbase-private-headers-devel
BuildRequires: cmake(Qt5LinguistTools)
BuildRequires: pkgconfig(Qt5Concurrent)
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Multimedia)
BuildRequires: pkgconfig(Qt5MultimediaWidgets)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5OpenGL)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Svg)
BuildRequires: pkgconfig(Qt5WebEngineCore)
BuildRequires: pkgconfig(Qt5WebEngineWidgets)
BuildRequires: pkgconfig(Qt5Widgets)
%endif
PreReq: unzip
Conflicts: %{package_name}
%description
Dolphin is a Gamecube and Wii emulator. Most games run perfectly or with minor bugs. Games are playable at HD quality, with 1080p and more. This is a remarkable feature the actual Gamecube and Wii consoles are not capable of. As an open source project everyone can commit improvements. The code is hosted on code.google.com. Dolphin is actively developed and almost every day new features are added and bugs fixed as well. Dolphin is a multiplatform project and many operating systems are supported. Dolphin runs on Windows 7 (x86 and x64), Mac OSX and Linux.
%lang_package
%prep
%autosetup -p1 -n %{_realname}-%{version}
BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{package_name}.changes '+%%b %%e %%Y')
BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{package_name}.changes '+%R')
rev=`echo %{version}|cut -f3 -d"."`
#sed -i \
# -e s,__DATE__,"\"$BUILDDATE\"",g \
# -e s,__TIME__,"\"$BUILDTIME\"",g \
# $(grep -iRl "__DATE__" Source/*)
%build
# this macro needs 'BuildRequires: memory-constraints'
#limit_build -m 3072
ulimit -Sn 4000
UCFLAGS="-O3 -fPIC -march=x86-64 -mtune=generic -mssse3 -msse4 -msse4.1 -msse4.2 -mavx -maes -mpclmul"
export ULDFLAGS="-fPIC -Wl,-O1"
# for stupid mz_compat.h include in Source/Core/UICommon/ResourcePack/ResourcePack.cpp
export UCFLAGS="${UCFLAGS} -I%{_includedir}/minizip/"
export ULDFLAGS="${ULDFLAGS} -L%{_libdir} -lminizip -lz"
export ULDFLAGS="${ULDFLAGS} -Wl,--gc-sections -Wl,--icf=safe"
%if 0%{?use_lld}
export ULDFLAGS="${ULDFLAGS} -fuse-ld=lld"
%ifarch %ix86 %arm
export ULDFLAGS="${ULDFLAGS} -Wl,-z,notext"
%endif
export LD="lld"
alias ld=ld.lld
%else
export ULDFLAGS="${ULDFLAGS} -fuse-ld=gold -Wl,--sort-common -Wl,-O1"
export LD=ld.gold
alias ld=gold
%endif
%if 0%{?use_clang}
export CC=clang
export CXX=clang++
export UCFLAGS="${UCFLAGS} -v -fbracket-depth=1024 -fconstexpr-depth=1024 -faligned-allocation"
export UCFLAGS="${UCFLAGS} -D_GNU_SOURCE -fexceptions"
export UCXXFLAGS="${UCFLAGS}"
export UCXXFLAGS="${UCXXFLAGS} -fcxx-exceptions -fpermissive"
export HOST="$(${CC} -print-target-triple)"
%if 0%{?use_lto}
%if 0%{?use_lld}
%global _lto_cflags -flto=thin -Wl,--lto-O3 -Wl,--thinlto-jobs=3
%global _lto_ldlags -flto=thin -Wl,--lto-O3 -Wl,--thinlto-jobs=3
%else
%global _lto_cflags -flto=thin
%global _lto_ldlags -flto=thin
%endif
%else
%global _lto_cflags %nil
%global _lto_ldlags %nil
%endif
%else
export CC=gcc
export CXX=g++
export UCFLAGS="${UCFLAGS} -ftree-parallelize-loops=4 -ftree-vectorize -fpredictive-commoning"
export UCXXFLAGS="${UCFLAGS} -fpermissive"
export HOST="%{_target_platform}"
%if 0%{?use_lto}
%global _lto_cflags -fuse-linker-plugin %_lto_cflags -ffat-lto-objects -flto-odr-type-merging
%global _lto_ldlags -fuse-linker-plugin -flto=2
%else
%global _lto_cflags %nil
%global _lto_ldlags %nil
%endif
%endif
export TARGET="${HOST}"
export UCFLAGS="${UCFLAGS} %_lto_cflags"
export UCXXFLAGS="${UCXXFLAGS} %_lto_cflags"
export ULDFLAGS="${ULDFLAGS} %_lto_cflags %_lto_ldlags"
# override OBS defaults ?
export CFLAGS="${UCFLAGS}"
export CXXFLAGS="${UCXXFLAGS}"
export LDFLAGS="${ULDFLAGS}"
# LTO & _FORTIFY_SOURCE may break build: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751812
mkdir build
cd build
cmake .. \
-DUSE_SYSTEM_LIBS=AUTO \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_STATIC_LIBS=ON \
-DUSE_PCH=OFF -DENABLE_PCH=OFF \
-DENABLE_PRECOMPILED_HEADERS=OFF \
-DSKIP_PRECOMPILE_HEADERS=ON \
-DUSE_PRECOMPILED_HEADERS=OFF \
-DCMAKE_SKIP_RPATH=OFF \
-DCMAKE_INSTALL_RPATH="" \
-DCMAKE_SKIP_INSTALL_RPATH=ON \
-DUSE_PULSE=ON -DUSE_JACK=ON \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_LINKER=${LD} \
-DDOLPHIN_WC_REVISION="$rev" \
-DDOLPHIN_WC_DESCRIBE="%{version}" \
-DDOLPHIN_WC_BRANCH="master" \
-DUSE_EGL=ON -DENABLE_LTO=ON \
-DENABLE_TESTS=OFF
make %{?_smp_mflags}
%install
%cmake_install
#install -m 755 Binaries/dolphin-emu-qt %{?buildroot}%{_bindir}
%fdupes -s %{buildroot}
%find_lang %{package_name}
# cleaning garbage
rm -rfv %{buildroot}%{_includedir}/mbedtls \
%{buildroot}%{_libexecdir}/libmbed* \
%{buildroot}%{_libdir}/libdiscord-* \
%{buildroot}%{_includedir}/discord_*
# Still waiting for the day Game;Emulator; is supported
%suse_update_desktop_file -c %{package_name} Dolphin 'Gamecube / Wii / Triforce Emulator' %{package_name} %{package_name} 'System;Emulator;'
%post
%desktop_database_post
%icon_theme_cache_post
%postun
%desktop_database_postun
%icon_theme_cache_postun
%files lang -f %{package_name}.lang
%files
%defattr(-, root, root)
%doc Readme.md
%{_bindir}/%{_realname}*
%{_datadir}/%{package_name}
%{_datadir}/icons/hicolor/*/*/*
%{_datadir}/applications/%{package_name}.desktop
%{_mandir}/man?/%{package_name}*.?.*
%changelog