File azahar.spec of Package azahar

#
# spec file for package _service:set_version:azahar
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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:           azahar
Version:        2123.3
%global _unpackaged_files_terminate_build               0
Release:        0
Summary:        An open-source 3DS emulator project based on Citra.
URL:            https://github.com/azahar-emu/azahar
License:        GPL-2.0-only
BuildRequires:  boost-devel
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  make
BuildRequires:  pkg-config
BuildRequires:  spirv-headers
BuildRequires:  cmake(fmt)
BuildRequires:  pkgconfig(fmt)
BuildRequires:  pkgconfig(libusb)
BuildRequires:  pkgconfig(soundtouch)
BuildRequires:  rpm_macro(cmake)
BuildRequires:  rpm_macro(cmake_build)
BuildRequires:  rpm_macro(cmake_install)
%ifarch %{x86_64} x86_64
BuildRequires:  cmake(xbyak)
%endif
%ifarch %{x86_64} %{arm64} aarch64 x86_64
BuildRequires:  cmake(dynarmic)
%endif
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig(cryptopp)
BuildRequires:  pkgconfig(inih)
#BuildRequires:  cmake(zstd)
BuildRequires:  pkgconfig(libenet)
BuildRequires:  libboost_container-devel
BuildRequires:  libboost_test-devel
BuildRequires:  libboost_thread-devel
BuildRequires:  libboost_timer-devel
BuildRequires:  libboost_type_erasure-devel
BuildRequires:  libboost_wave-devel
BuildRequires:  qt6-base-devel
BuildRequires:  qt6-multimedia-devel
BuildRequires:  cmake(OpenAL)
BuildRequires:  cmake(SDL2)
BuildRequires:  cmake(VulkanMemoryAllocator)
BuildRequires:  cmake(cpp-jwt)
BuildRequires:  cmake(cubeb)
BuildRequires:  cmake(glslang)
BuildRequires:  cmake(httplib)
BuildRequires:  cmake(mcl)
BuildRequires:  cmake(nlohmann_json)
BuildRequires:  cmake(oaknut)
BuildRequires:  cmake(tsl-robin-map)
BuildRequires:  pkgconfig(catch2)
BuildRequires:  pkgconfig(lodepng)
BuildRequires:  pkgconfig(openssl)
#BuildRequires: libboost_system-devel
BuildRequires:  libboost_stacktrace-devel
BuildRequires:  libboost_chrono-devel
BuildRequires:  libboost_container-devel
BuildRequires:  libboost_context-devel
BuildRequires:  libboost_contract-devel
BuildRequires:  libboost_coroutine-devel
BuildRequires:  libboost_date_time-devel
BuildRequires:  libboost_fiber-devel
BuildRequires:  libboost_fiber-devel
BuildRequires:  libboost_filesystem-devel
BuildRequires:  libboost_graph-devel
BuildRequires:  libboost_headers-devel
BuildRequires:  libboost_iostreams-devel
BuildRequires:  libboost_locale-devel
BuildRequires:  libboost_log-devel
BuildRequires:  libboost_math-devel
BuildRequires:  libboost_nowide-devel
BuildRequires:  libboost_process-devel
BuildRequires:  libboost_program_options-devel
BuildRequires:  libboost_random-devel
BuildRequires:  libboost_regex-devel
BuildRequires:  libboost_serialization-devel
BuildRequires:  nihstro-devel
BuildRequires:  qt6-gui-private-devel
BuildRequires:  qt6-platformsupport-private-devel

Source0:        https://github.com/azahar-emu/azahar/releases/download/%{version}/azahar-unified-source-%{version}.tar.xz
#Patch0:  https://patch-diff.githubusercontent.com/raw/azahar-emu/azahar/pull/1126.patch
#Patch1:  https://patch-diff.githubusercontent.com/raw/azahar-emu/azahar/pull/1165.patch

%description
%{summary}.

%prep
%autosetup -p1 -n azahar-unified-source-%{version}

%build
flags=(
USE_SYSTEM_LODEPNG
USE_SYSTEM_OPENAL
USE_SYSTEM_GLSLANG
USE_SYSTEM_VMA
USE_SYSTEM_VULKAN_HEADERS
USE_SYSTEM_SDL2
USE_SYSTEM_QT
USE_SYSTEM_MOLTENVK
USE_SYSTEM_BOOST
USE_SYSTEM_LIBUSB
USE_SYSTEM_SOUNDTOUCH
USE_SYSTEM_CRYPTOPP
USE_SYSTEM_FMT
USE_SYSTEM_XBYAK
USE_SYSTEM_DYNARMIC
USE_SYSTEM_INIH
USE_SYSTEM_FFMPEG_HEADERS
#USE_SYSTEM_ZSTD
USE_SYSTEM_ENET
USE_SYSTEM_CATCH2
USE_SYSTEM_CUBEB
USE_SYSTEM_JSON
USE_SYSTEM_OPENSSL
USE_SYSTEM_CPP_HTTPLIB
USE_SYSTEM_CPP_JWT
)

declare -a system
for flag in "${flags[@]}"
do
  system+=("-D${flag}=ON")
done

fin="$(echo /usr/include/qt6/QtGui/*/QtGui)"
cin="${CMAKE_CXX_FLAGS}"

%cmake "${system[@]}" -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS="${cin:+"${cin} "}-I${fin}"
%cmake_build

%install
%cmake_install
rm -rfv %{buildroot}%{_libdir}

%files
%{_bindir}/azahar
%{_bindir}/azahar-room
%{_datadir}/applications/org.azahar_emu.Azahar.desktop
%{_iconsdir}/hicolor/*/apps/org.azahar_emu.Azahar.*
%{_datadir}/mime/packages/org.azahar_emu.Azahar.xml

%changelog
openSUSE Build Service is sponsored by