File mgba.spec of Package mgba
#
# spec file for package mgba
#
# Copyright (c) 2025 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/
#
%define sover 0_11
%define __builder ninja
Name: mgba
Version: 0.10.5+1743395596.g93d248859
Release: 0
Summary: Game Boy Advance emulator
License: MPL-2.0 AND MIT AND JSON AND BSD-3-Clause
URL: https://mgba.io/
Source0: %{name}-%{version}.tar.zst
BuildRequires: c++_compiler
BuildRequires: cmake >= 3.10
BuildRequires: dos2unix
BuildRequires: hicolor-icon-theme
BuildRequires: libzip-tools
BuildRequires: ninja
BuildRequires: pkgconfig
BuildRequires: cmake(Qt6LinguistTools)
BuildRequires: pkgconfig(Qt6Core)
BuildRequires: pkgconfig(Qt6Multimedia)
BuildRequires: pkgconfig(Qt6OpenGLWidgets)
BuildRequires: pkgconfig(Qt6Widgets)
BuildRequires: pkgconfig(bzip2)
BuildRequires: pkgconfig(epoxy)
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(glu)
BuildRequires: pkgconfig(ice)
BuildRequires: pkgconfig(json-c)
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavfilter)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libelf)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libswresample)
BuildRequires: pkgconfig(libswscale)
BuildRequires: pkgconfig(libzip)
BuildRequires: pkgconfig(lua)
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(sm)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(zlib)
%description
mGBA is a fairly accurate Game Boy Advance emulator with scripting
support and built-in debug facilities.
%package sdl
Summary: Game Boy Advance (GBA) emulator (SDL2-based CLI version)
%description sdl
mGBA is a fairly accurate Game Boy Advance emulator with scripting
support and built-in debug facilities.
This package provides SDL2-based CLI version of mGBA.
%files sdl
%{_bindir}/%{name}
%{_mandir}/man6/mgba.6%{?ext_man}
%package devel
Summary: A library to link with mGBA
Requires: libmgba%{sover} = %{version}
%description devel
mGBA is a fairly accurate Game Boy Advance emulator with scripting
support and built-in debug facilities.
This package contains development headers for libmgba.
%files devel
%{_libdir}/lib%{name}.so
%{_includedir}/%{name}*
%package -n libmgba%{sover}
Summary: A library to link with mGBA
%description -n libmgba%{sover}
mGBA is a fairly accurate Game Boy Advance emulator with scripting
support and built-in debug facilities.
This package contains mGBA as a library.
%files -n libmgba%{sover}
%{_libdir}/libmgba.so.*
%prep
%autosetup
cp src/third-party/discord-rpc/LICENSE LICENSE.discord-rpc
cp src/third-party/discord-rpc/include/rapidjson/license.txt LICENSE.rapidjson
cp src/third-party/inih/LICENSE.txt LICENSE.inih
dos2unix README_DE.md
%build
%cmake \
-DUSE_MAGICK:BOOL=OFF \
-DBUILD_{TEST,SUITE,CINEMA}=ON
%cmake_build
%install
%cmake_install
# do not install test programs
rm %{buildroot}%{_bindir}/mgba-{cinema,fuzz}
rm %{buildroot}%{_bindir}/tbl-fuzz
%check
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
%ctest
# use %%doc and %%license explicitly
rm -rf %{buildroot}%{_docdir}/mgba/
%post -n libmgba%{sover} -p /sbin/ldconfig
%postun -n libmgba%{sover} -p /sbin/ldconfig
%files
%license LICENSE*
%doc CHANGES README*.md
%{_bindir}/%{name}-qt
%{_datadir}/applications/io.mgba.mGBA.desktop
%{_datadir}/%{name}
%{_datadir}/icons/hicolor/*/apps/io.mgba.mGBA.png
%{_mandir}/man6/mgba-qt.6%{?ext_man}
%changelog