File ares.spec of Package ares

#
# spec file for package ares
#
# Copyright (c) 2024 SUSE LLC
#
# 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/
#


Name:           ares
Version:        142
Release:        0
Summary:        Multisystem Emulator
License:        ISC
Group:          System/Emulators/Other
URL:            https://ares-emu.net/
Source0:        https://github.com/ares-emulator/ares/archive/refs/tags/%{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE ares-fix-building-for-aarch64.patch -- disable build of n64 core, fix building for aarch64
Patch0:         ares-fix-building-for-aarch64.patch
# PATCH-FIX-OPENSUSE ares-use-march-nehalem-instead-x86-64-v2.patch -- use march=nehalem for openSUSE Leap
Patch1:         ares-use-march-nehalem-instead-x86-64-v2.patch
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(SDL2_image)
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(cairo)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(sdl2) >= 2.0.9
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xrandr)
ExcludeArch:    %{arm} ppc64le

%description
Multisystem Emulator
ares is a cross-platform, open source, multisystem emulator, focusing on accuracy and preservation.

%prep
%setup -q

# disable n64 core for aarch64 because n64 core can not be build for aarch64
%ifarch aarch64
%patch -P 0 -p1
%endif

# use march=nehalem for openSUSE Leap instead new default march=x86-64-v2, both use SSE 4.2
%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 160000 && 0%{?is_opensuse}
%patch -P 1 -p1
%endif

%build
%make_build local=false \
            openmp=true \
            hiro=gtk3 \
            -C desktop-ui

%install
mkdir -p %{buildroot}/%{_bindir}/
mkdir -p %{buildroot}/%{_datadir}/applications/
mkdir -p %{buildroot}/%{_datadir}/icons/hicolor/256x256/apps/
cp desktop-ui/out/ares %{buildroot}/%{_bindir}/ares
cp desktop-ui/resource/ares.desktop %{buildroot}/%{_datadir}/applications/ares.desktop
cp desktop-ui/resource/ares.png %{buildroot}/%{_datadir}/icons/hicolor/256x256/apps/ares.png

%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%{_datadir}/icons/hicolor
%{_datadir}/applications/%{name}.desktop

%changelog
openSUSE Build Service is sponsored by