File melonds.spec of Package melonds

#
# Spec file for package melonDS
#
# Copyright © 2019–2022 Markus S. <kamikazow@opensuse.org>
#
# 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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# 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 <http://www.gnu.org/licenses/>.
#

%define _localname melonDS

Name:             melonds
Summary:          Nintendo DS emulator
Version:          0.9.5
Release:          0
License:          GPL-3.0-or-later
URL:              http://melonds.kuribo64.net/
Source0:          https://github.com/Arisotura/melonDS/archive/%{version}.tar.gz#/%{_localname}-%{version}.tar.gz

BuildRequires:    binutils gcc-c++
BuildRequires:    execstack
BuildRequires:    cmake >= 3.13
BuildRequires:    extra-cmake-modules
BuildRequires:    hicolor-icon-theme
BuildRequires:    libarchive-devel
BuildRequires:    libcurl-devel
BuildRequires:    libpcap-devel
BuildRequires:    libslirp-devel
BuildRequires:    pkgconfig(gtk+-3.0)
BuildRequires:    pkgconfig(Qt5Core)
BuildRequires:    pkgconfig(Qt5Multimedia)
BuildRequires:    pkgconfig(Qt5Network)
BuildRequires:    pkgconfig(Qt5OpenGL)
BuildRequires:    pkgconfig(Qt5WaylandClient)
BuildRequires:    pkgconfig(Qt5Widgets)
BuildRequires:    pkgconfig(sdl2)
BuildRequires:    pkgconfig(wayland-client)
BuildRequires:    pkgconfig(wayland-egl) 
BuildRequires:    pkgconfig(wayland-egl-backend)
BuildRequires:    pkgconfig(wayland-protocols)
BuildRequires:    pkgconfig(wayland-server)
%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel_version}
BuildRequires:    ninja-build
BuildRequires:    qt5-qtbase-private-devel
%endif
%if 0%{?suse_version}
#Ignore compiler warnings (for now)
BuildRequires:    -post-build-checks
BuildRequires:    libQt5Gui-private-headers-devel
BuildRequires:    ninja
BuildRequires:    update-desktop-files
%endif

%if 0%{?fedora} > 26
%undefine _debugsource_packages
%endif

%description
melonDS is a Nintendo DS emulator.

%prep
%setup -q -n %{_localname}-%{version}
sed -i '1s|^|include_directories("/usr/include/wayland")\n\n|' src/frontend/qt_sdl/CMakeLists.txt

%check

%build
mkdir build
cd build
cmake \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    -G "Ninja" \
    ..

ninja -v

%install
cd build
DESTDIR=%{buildroot} ninja install
execstack -c %{buildroot}/%{_bindir}/%{_localname}


%files
%defattr(-,root,root,-)
%doc README.md
%license LICENSE
%{_bindir}/%{_localname}
%{_datadir}/applications/net.kuribo64.melonDS.desktop
%{_datadir}/icons/hicolor/*/apps/net.kuribo64.melonDS.png

%changelog
openSUSE Build Service is sponsored by