%global commit b1758ec26a3d6da10abf50dc184fa837236c5f61 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global date 20260901 %global sbuild 2392 %bcond snapshot 1 %global src_hash 054cda2d07db616153f754f900c9ca6a %global src_pkg %{pkgname}-free-%{?with_snapshot:%{shortcommit}}%{!?with_snapshot:%{version}}.tar.xz # Enable ffmpeg support %bcond ffmpeg 1 %if %{with snapshot} %global dist .%{date}git%{shortcommit}%{?dist} %endif %global lib7zip_ver 3f1e7b2 %global sevenzip_ver 25.00 %global sevenzip_dir %(echo %{sevenzip_ver} | tr -d '.') %global xdelta_ver 3.1.0 %global pkgname puNES %global appname io.github.punesemu.%{pkgname} Name: punes Version: 0.111 Release: 9%{?dist} Summary: NES emulator License: GPL-2.0-or-later AND LGPL-2.1-or-later AND BSD-3-Clause AND MIT URL: https://github.com/punesemu/%{pkgname} # Use Makefile to download Source0: https://copr-dist-git.fedorainfracloud.org/repo/pkgs/phantomx/chinforpms/%{name}/%{src_pkg}/%{src_hash}/%{src_pkg} Source10: Makefile Patch0: 0001-lib7zip-add-libdir-punes-search-path.patch BuildRequires: cmake BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: make BuildRequires: ninja-build BuildRequires: pkgconfig(alsa) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glu) %if %{with ffmpeg} BuildRequires: pkgconfig(libavcodec) BuildRequires: pkgconfig(libavfilter) BuildRequires: pkgconfig(libavformat) BuildRequires: pkgconfig(libavutil) BuildRequires: pkgconfig(libswscale) %endif BuildRequires: cmake(Qt6Core) BuildRequires: cmake(Qt6Gui) BuildRequires: cmake(Qt6LinguistTools) BuildRequires: cmake(Qt6Network) BuildRequires: cmake(Qt6OpenGLWidgets) BuildRequires: cmake(Qt6Svg) BuildRequires: cmake(Qt6Widgets) BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xrandr) BuildRequires: desktop-file-utils BuildRequires: libappstream-glib Requires: 7zip >= %{sevenzip_ver} Requires: hicolor-icon-theme Provides: bundled(filter-c) = 0~git Provides: bundled(kissfft) = 1.3.0 Provides: bundled(lib7zip) = 0~git%{lib7zip_ver} %dnl Provides: bundled(7zip) = %{sevenzip_ver} Provides: bundled(singleapplication) = 3.5.1 Provides: bundled(xdelta) = %{xdelta_ver} %description puNES is a Qt-based NES emulator and NSF/NSF2/NSFe Music Player. %prep %autosetup -n %{pkgname}-%{?with_snapshot:%{commit}}%{!?with_snapshot:%{version}} -p1 pushd src/extra rm -rf bdf2ttf windows cp -p emu2413/LICENSE LICENSE.emu2413 cp -p filter-c/LICENSE LICENSE.filter-c cp -p lib7zip-%{lib7zip_ver}/COPYING COPYING.lib7zip cp -p kissfft/COPYING COPYING.kissfft cp -p NTSC-CRT/LICENSE LICENSE.NTSC-CRT cp -p PAL-CRT/LICENSE LICENSE.PAL-CRT %dnl cp -p 7z%{sevenzip_dir}/DOC/copying.txt COPYING.7zip cp -p qkeycode/LICENSE LICENSE.qkeycode cp -p singleapplication/LICENSE LICENSE.singleapplication cp -p xdelta-%{xdelta_ver}/COPYING COPYING.xdelta popd sed \ -e 's|(ENABLE_GIT_INFO|\0_DISABLED|' \ -e '/CMAKE_INSTALL_DOCDIR/d' \ -i CMakeLists.txt %if %{with snapshot} sed \ -e 's|@GIT_COUNT_COMMITS@|%{sbuild}|' \ -e 's|@GIT_LAST_COMMIT@|%{shortcommit}|' \ -e 's|@GIT_LAST_COMMIT_HASH@|%{commit}|' \ -i compiled.h.in %endif sed \ -e 's|_RPMLIBDIR_|%{_libexecdir}/7zip|g' \ -i src/extra/lib7zip-%{lib7zip_ver}/src/OSFunctions_UnixLike.cpp sed \ -e '/cmake_minimum_required/s|2..|3.5|' \ -e '/cmake_minimum_required/s|3..|3.5|' \ -i src/extra/xdelta-%{xdelta_ver}/cpp-btree/CMakeLists.txt \ src/extra/emu2413/CMakeLists.txt %build %cmake \ %if %{without ffmpeg} -DENABLE_FFMPEG:BOOL=OFF \ %endif %if %{with snapshot} -DENABLE_GIT_INFO:BOOL=ON \ %endif -DENABLE_OPENGL_CG:BOOL=OFF \ -DENABLE_QT6_LIBS:BOOL=ON \ -DDISABLE_PORTABLE_MODE:BOOL=ON \ -DCMAKE_BUILD_TYPE:STRING=Release \ %{nil} %cmake_build %install %cmake_install %dnl mkdir -p %{buildroot}%{_libdir}/%{name} %dnl install -pm0755 src/extra/7z%{sevenzip_dir}/bin/7z.so %{buildroot}%{_libdir}/%{name}/ desktop-file-edit \ --remove-key="GenericName" \ --remove-key="Encoding" \ %{buildroot}/%{_datadir}/applications/%{appname}.desktop %check desktop-file-validate %{buildroot}/%{_datadir}/applications/%{appname}.desktop appstream-util validate-relax --nonet \ %{buildroot}%{_metainfodir}/%{appname}.metainfo.xml %files %license COPYING* src/extra/LICENSE.* %doc README.md %{_bindir}/%{name} %dnl %{_libdir}/%{name}/7z.so %{_datadir}/%{pkgname}/ %{_datadir}/applications/%{appname}.desktop %{_datadir}/icons/hicolor/*/apps/%{appname}.png %{_metainfodir}/%{appname}.metainfo.xml %changelog * Sun Sep 20 2026 Phantom X - 0.111-9.20260901gitb1758ec - ffmpeg rebuild * Wed Sep 16 2026 Phantom X - 0.111-8.20260901gitb1758ec - Use system 7zip * Wed Dec 25 2024 Phantom X - 0.111-3.20240901git315c6d3 - Bundle p7zip * Sun Oct 06 2024 Phantom X - 0.111-2.20240901git315c6d3 - Rebuild (ffmpeg) * Sat Sep 28 2024 Phantom X - 0.111-1.20240901git315c6d3 - Initial spec