# SDL2 frontend %bcond_without sdl # Qt5 frontend %bcond_without qt # terminal debugging %bcond_without editline # zlib support %bcond_without zlib # PNG support %bcond_without png # LIBZIP support %bcond_without libzip # SQlite3 support %bcond_without sqlite3 # elf loading support %bcond_without elf # ffmpeg 5 support is now in a tagged release yet # https://github.com/mgba-emu/mgba/pull/2434 %bcond_with ffmpeg # minizip requires cmake support from zstd, which Fedora does not provide # https://bugzilla.redhat.com/show_bug.cgi?id=2088517 %bcond_with minizip # python bindings have trouble compiling %bcond_with python Name: mgba Version: 0.9.3 Release: 1%{?dist} Summary: Game Boy Advance Emulator License: MPL-2.0 and GPLv2 and MIT and BSD-3 URL: https://mgba.io/ # generate using ./gen_clean_tarball.sh Source0: %{name}-%{version}.tar.gz BuildRequires: gcc gcc-c++ # libzip-devel requires a binary provided by libzip-tools BuildRequires: libzip-devel libzip-tools BuildRequires: make cmake BuildRequires: libglvnd-devel %if %{with sdl} BuildRequires: SDL2-devel %endif %if %{with qt} BuildRequires: qt5-qtbase-devel BuildRequires: qt5-qtmultimedia-devel BuildRequires: qt5-linguist %endif %if %{with python} BuildRequires: python3-devel BuildRequires: python3dist(setuptools) %endif %if %{with editline} BuildRequires: libedit-devel %endif %if %{with zlib} BuildRequires: zlib-devel %endif %if %{with minizip} BuildRequires: minizip-devel %endif %if %{with png} BuildRequires: libpng-devel %endif %if %{with libzip} BuildRequires: libzip-devel %endif %if %{with sqlite3} BuildRequires: sqlite-devel >= 3 %endif %if %{with elf} BuildRequires: elfutils-libelf-devel %endif BuildRequires: desktop-file-utils Requires: mgba-data Provides: bundled(inih) = r55 Provides: bundled(blip_buf) = 1.1.0 %description mGBA is an emulator for running Game Boy Advance games. It aims to be faster and more accurate than many existing Game Boy Advance emulators, as well as adding features that other emulators lack. It also supports Game Boy and Game Boy Color games. %prep %autosetup %if %{with qt} %package qt Summary: %{name} qt package %description qt %{name} qt package %endif %package data Summary: Icons for %{name} BuildArch: noarch Requires: mgba-data %description data Icons for %{name} %package doc Summary: %{name} doc package BuildArch: noarch %description doc %{name} doc package %package -n libmgba Summary: libmgba %description -n libmgba libmgba %package -n libmgba-static Summary: libmgba-static %description -n libmgba-static libmgba-static %package -n libmgba-devel Summary: libmgba-devel Requires: libmgba %description -n libmgba-devel libmgba-devel %if %{with python} %package -n python3-mgba Summary: python3-mgba Requires: libmgba %{?python_provide:%python_provide python3-mgba} %description -n python3-mgba python3-mgba %endif %build %cmake \ -DCMAKE_SKIP_RPATH:BOOL=ON \ -DUSE_DEBUGGERS:BOOL=ON \ -DUSE_GDB_STUB:BOOL=ON \ %if %{with editline} -DUSE_EDITLINE:BOOL=ON \ %else -DUSE_EDITLINE:BOOL=OFF \ %endif %if %{with ffmpeg} -DUSE_FFMPEG:BOOL=ON \ %else -DUSE_FFMPEG:BOOL=OFF \ %endif %if %{with zlib} -DUSE_ZLIB:BOOL=ON \ %else -DUSE_ZLIB:BOOL=OFF \ %endif %if %{with minizip} -DUSE_MINIZIP:BOOL=ON \ %else -DUSE_MINIZIP:BOOL=OFF \ %endif %if %{with png} -DUSE_PNG:BOOL=ON \ %else -DUSE_PNG:BOOL=OFF \ %endif %if %{with sqlite3} -DUSE_SQLITE3:BOOL=ON \ %else -DUSE_SQLITE3:BOOL=OFF \ %endif %if %{with elf} -DUSE_ELF:BOOL=ON \ %else -DUSE_ELF:BOOL=OFF \ %endif -DUSE_LZMA:BOOL=OFF \ -DUSE_DISCORD_RPC:BOOL=OFF \ -DENABLE_SCRIPTING:BOOL=ON \ %if %{with qt} -DBUILD_QT:BOOL=ON \ %else -DBUILD_QT:BOOL=OFF \ %endif %if %{with sdl} -DBUILD_SDL:BOOL=ON \ %else -DBUILD_SDL:BOOL=OFF \ %endif -DBUILD_LIBRETRO:BOOL=OFF \ %if %{with python} -DBUILD_PYTHON:BOOL=ON \ %else -DBUILD_PYTHON:BOOL=OFF \ %endif -DBUILD_GL:BOOL=ON \ -DBUILD_GLES2:BOOL=ON \ -DBUILD_GLES3:BOOL=ON \ -DBUILD_STATIC:BOOL=ON \ -DBUILD_SHARED:BOOL=ON \ -DSKIP_LIBRARY:BOOL=OFF \ -DUSE_EPOXY:BOOL=OFF \ -DDISTBUILD:BOOL=ON %cmake_build %if %{with python} # mgba expects in-tree building so we need to prepare the environment cp %{__cmake_builddir}/include/mgba/flags.h include/mgba pushd src/platform/python/ %py3_build popd %endif %install %cmake_install %if %{with python} pushd src/platform/python/ %py3_install popd %endif %if %{with sdl} cp res/mgba-qt.desktop res/mgba-sdl.desktop desktop-file-install \ --set-key=Name --set-value='mGBA (SDL)' \ res/mgba-sdl.desktop %endif %if %{with qt} rm %{buildroot}/%{_datadir}/applications/mgba-qt.desktop desktop-file-install \ --set-key=Name --set-value='mGBA (QT)' \ res/mgba-qt.desktop %endif %if %{with sdl} %files %{_bindir}/mgba %{_datadir}/applications/mgba-sdl.desktop %{_mandir}/man6/mgba.6.* %endif %if %{with qt} %files qt %{_bindir}/mgba-qt %{_datadir}/applications/mgba-qt.desktop %{_mandir}/man6/mgba-qt.6.* %{_datadir}/mgba/ %endif %files data %{_datadir}/icons/hicolor/16x16/apps/mgba.png %{_datadir}/icons/hicolor/24x24/apps/mgba.png %{_datadir}/icons/hicolor/32x32/apps/mgba.png %{_datadir}/icons/hicolor/48x48/apps/mgba.png %{_datadir}/icons/hicolor/64x64/apps/mgba.png %{_datadir}/icons/hicolor/96x96/apps/mgba.png %{_datadir}/icons/hicolor/128x128/apps/mgba.png %{_datadir}/icons/hicolor/256x256/apps/mgba.png %{_datadir}/icons/hicolor/512x512/apps/mgba.png %files doc %{_datadir}/doc/mGBA/ %files -n libmgba %{_libdir}/libmgba.so.0.9.3 %files -n libmgba-static %{_libdir}/libmgba-static.a %files -n libmgba-devel %{_libdir}/libmgba.so %{_libdir}/libmgba.so.0.9 %{_includedir}/mgba %{_includedir}/mgba-util %if %{with python} %files -n python3-mgba %license LICENSE %doc README.md %{python3_sitelib}/mgba %{python3_sitelib}/mgba-%{version}-py*.*.egg-info %endif %changelog * Thu May 19 2022 Jan Drögehoff - 0.9.3-1 - Initial spec