File citra.spec of Package citra

# spec file for package citra
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2017–2019 Markus S. <>
# 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

Name:           citra
Version:        nightly1812
Release:        0
Summary:        Nintendo 3DS emulator
License:        GPL-2.0-or-later
Group:          System/Emulators/Other
Source:         %{name}-%{version}.tar.xz
Patch0:         gcc-enablement.patch
# PATCH-FIX-OPENSUSE - fix_gcc12_errors.patch - keep gcc12 happy
# to discard once upstream makes the source gcc12 compatible
Patch1:         fix_gcc12_errors.patch
Patch2:         fix_build_with_gcc_13.patch
BuildRequires:  cmake >= 3.6
BuildRequires:  hicolor-icon-theme
%if ( 0%{?sle_version} == 150400 || 0%{?sle_version} == 150500 ) && 0%{?is_opensuse}
BuildRequires:  gcc11
BuildRequires:  gcc11-c++
BuildRequires:  libboost_date_time1_75_0-devel
BuildRequires:  libboost_regex1_75_0-devel
BuildRequires:  libboost_serialization1_75_0-devel
BuildRequires:  libboost_system1_75_0-devel
BuildRequires:  libboost_date_time-devel >= 1.70.0
BuildRequires:  libboost_regex-devel
BuildRequires:  libboost_serialization-devel
BuildRequires:  libboost_system-devel
BuildRequires:  libqt5-linguist-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Multimedia)
BuildRequires:  pkgconfig(Qt5OpenGL)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(libavdevice)
BuildRequires:  pkgconfig(libavfilter)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(liblz4)
BuildRequires:  pkgconfig(liblzma)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(libpostproc)
BuildRequires:  pkgconfig(libswresample)
BuildRequires:  pkgconfig(libswscale)
BuildRequires:  pkgconfig(libzstd)
BuildRequires:  pkgconfig(sdl2)
ExclusiveArch:  x86_64

Citra is an open-source Nintendo 3DS emulator and debugger, written with portability in mind.

%setup -q
%autopatch -p1

# Enforce package versioning in GUI
sed -i '$!N;s|#define GIT_REV.*"@GIT_REV@"\n#define GIT_BRANCH.*"@GIT_BRANCH@"|#define GIT_REV\t"%{release}"\n#define GIT_BRANCH\t"nightly"|g;P;D' src/common/
sed -i 's|@GIT_DESC@|%{version}|g' src/common/
sed -i 's|@BUILD_NAME@|%{name}|g' src/common/

# Avoid submodule checks as OBS ensures source consistency
sed -i 's|check_submodules_present()||g' CMakeLists.txt

# Don't test during build phase
sed -i 's|enable_testing()||g' CMakeLists.txt

# do not use bundled libs
#sed -i -e 's|add_subdirectory(externals)||g' CMakeLists.txt

# DYNARMIC_ENABLE_CPU_FEATURE_DETECTION - we can't rely on cpu detection
# CRYPTOPP_DISABLE_CXXFLAGS_OPTIMIZATIONS - use only system set optflags
# WEB_SERVICE/CUBEB/DISCORD_PRESENCE OFF because uses bundled libs and libressl, no-go for openSUSE integration
# SHARED/STATIC_LIBS - we don't do libs it is just bundled helpers we need to link into binaries
export CXXFLAGS="%{optflags} -fno-strict-aliasing"
%if ( 0%{?sle_version} == 150400 || 0%{?sle_version} == 150500 ) && 0%{?is_opensuse}
export CC=gcc-11
export CXX=g++-11
%cmake \

rm -r %buildroot%{_includedir}/tsl
rm -r %buildroot%{_datadir}/cmake/tsl-robin-map


%license license.txt

openSUSE Build Service is sponsored by