File yuzu.spec of Package yuzu

# spec file for package yuzu
# Copyright © 2017–2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright © 2017–2020 Markus S. <>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <>.

%define _cxx g++

Name:               yuzu
Version:            mainline0313
Release:            0
Summary:            Nintendo Switch emulator/debugger
License:            GPL-2.0-only
Group:              System/Emulators/Other
Source0:            %{name}-%{version}.tar.xz
ExclusiveArch:      x86_64

BuildRequires:      cmake >= 3.6
BuildRequires:      boost-devel
BuildRequires:      binutils gcc gcc-c++
BuildRequires:      vulkan-devel
BuildRequires:      pkgconfig(libcurl)
BuildRequires:      pkgconfig(libpng)
BuildRequires:      pkgconfig(Qt5Core)
BuildRequires:      pkgconfig(Qt5Widgets)
BuildRequires:      pkgconfig(Qt5OpenGL)
BuildRequires:      pkgconfig(sdl2)
BuildRequires:      python

%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel_version}
BuildRequires:      ninja-build
%if 0%{?suse_version}
BuildRequires:      libQt5PlatformSupport-private-headers-devel
BuildRequires:      ninja

# Ignore compiler warnings (for now)
BuildRequires:      -post-build-checks

Requires(post):     hicolor-icon-theme
Requires(postun):   hicolor-icon-theme
Requires(post):     shared-mime-info
Requires(postun):   shared-mime-info
%if 0%{?suse_version}
BuildRequires:      libQt5Concurrent-devel
Requires(post):     update-desktop-files
Requires(postun):   update-desktop-files

yuzu is an open source Nintendo Switch emulator/debugger.

%setup -q

# Enforce package versioning in GUI
sed -i \
-e 's|@GIT_REV@|%{release}|g' \
-e 's|@GIT_BRANCH@|master|g' \
-e 's|@GIT_DESC@|%{version}|g' \
-e 's|@BUILD_NAME@|%{name}|g' \

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

mkdir build
cd build

cmake .. \
        -G "Ninja" \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_CXX_COMPILER=%{_cxx} \
        -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
        -DCMAKE_INSTALL_LIBEXEC="%_libexecdir" \

ninja -v

cd build
DESTDIR=%{buildroot} ninja install

# Delete leftover development files
rm -rf %{?buildroot}%{_includedir}

%if 0%{?suse_version}

%if 0%{?suse_version}

%license license.txt
%attr(755, root, root) %{_bindir}/%{name}
%attr(755, root, root) %{_bindir}/%{name}-cmd
%attr(755, root, root) %{_bindir}/%{name}-tester

openSUSE Build Service is sponsored by