[packages/mame] - up to 0.283

baggins baggins at pld-linux.org
Sun Nov 30 23:47:18 CET 2025


commit 053b8bf3bf6d19c45cae8dad4f2b4f7e30539db6
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Dec 1 01:46:37 2025 +0100

    - up to 0.283
    
    Can't be built with system lua.
    Add subpackages with tool and data.

 lua-cxx.patch       |  11 ++++
 mame-includes.patch |  40 --------------
 mame.spec           | 149 +++++++++++++++++++++++++++++++++++++++++++++++-----
 3 files changed, 146 insertions(+), 54 deletions(-)
---
diff --git a/mame.spec b/mame.spec
index f74f598..48f87d8 100644
--- a/mame.spec
+++ b/mame.spec
@@ -1,42 +1,54 @@
 # TODO: is qt optional? (either as bcond, or qt-less version)
+#
+# https://github.com/mamedev/mame/issues/7046
+# Conditional build:
+%bcond_with	system_lua		# build system lua (needs LUA build as C++)
+#
 %define		fver	%(echo %{version} | tr -d .)
 Summary:	MAME - Multiple Arcade Machine Emulator
 Summary(pl.UTF-8):	MAME (Multiple Arcade Machine Emulator) - emulator wielu automatów do gier
 Name:		mame
-Version:	0.249
-Release:	2
+Version:	0.283
+Release:	1
 License:	GPL v2+ (BSD for core part, LGPL v2.1+/GPL v2+ for some drivers)
 Group:		X11/Applications/Games
 #Source0Download: https://www.mamedev.org/release.html
 Source0:	https://github.com/mamedev/mame/archive/mame%{fver}/%{name}-%{version}.tar.gz
-# Source0-md5:	37b527a7b769b0d7d000ab512a5151ac
-Patch0:		%{name}-includes.patch
+# Source0-md5:	0ba4eb1221411078c94186619ab964d3
+Patch0:		lua-cxx.patch
 URL:		https://www.mamedev.org/
 BuildRequires:	OpenGL-devel
-BuildRequires:	Qt5Core-devel >= 5
-BuildRequires:	Qt5Gui-devel >= 5
-BuildRequires:	Qt5Widgets-devel >= 5
+BuildRequires:	Qt6Core-devel >= 5
+BuildRequires:	Qt6Gui-devel >= 5
+BuildRequires:	Qt6Widgets-devel >= 5
 BuildRequires:	SDL2-devel >= 2
 BuildRequires:	SDL2_ttf-devel >= 2
 BuildRequires:	alsa-lib-devel
+BuildRequires:	asio-devel
 BuildRequires:	expat-devel >= 1.95
 BuildRequires:	flac-devel
 BuildRequires:	fontconfig-devel
 BuildRequires:	freetype-devel >= 2
+BuildRequires:	glm-devel
 BuildRequires:	libjpeg-devel
 BuildRequires:	lua53-devel >= 5.3
 BuildRequires:	pkgconfig
 BuildRequires:	portaudio-devel
 BuildRequires:	portmidi-devel
+BuildRequires:	pugixml-devel
 BuildRequires:	pulseaudio-devel
+BuildRequires:	rapidjson-devel
 BuildRequires:	sed >= 4.0
 BuildRequires:	sqlite3-devel >= 3
 BuildRequires:	unzip
+BuildRequires:	utf8proc-devel
 BuildRequires:	xorg-lib-libX11-devel
 BuildRequires:	xorg-lib-libXext-devel
 BuildRequires:	xorg-lib-libXi-devel
 BuildRequires:	xorg-lib-libXinerama-devel
 BuildRequires:	zlib-devel
+BuildRequires:	zstd-devel
+Requires:	%{name}-data = %{version}-%{release}
 Suggests:	gmameui
 Obsoletes:	sdlhazemd < 0.15
 Obsoletes:	sdlmame < 0.137
@@ -77,11 +89,29 @@ MAME służy jako ta dokumentacja. Fakt, że w gry da się grać, służy
 głównie sprawdzeniu dokładności dokumentacji (bo jak inaczej można
 udowodnić wierne odtworzenie sprzętu?).
 
+%package tools
+Summary:	Additional tools for MAME
+Group:		X11/Applications/Games
+Requires:	%{name} = %{version}-%{release}
+
+%description tools
+Additional tools for MAME.
+
+%package data
+Summary:	Data files used by MAME
+Group:		X11/Applications/Games
+BuildArch:	noarch
+
+%description data
+Data files used by MAME.
+
 %prep
 %setup -q -n %{name}-%{name}%{fver}
 %patch -P0 -p1
 
-%{__sed} -i -e 's/"lua"/"lua5.3"/' scripts/src/main.lua
+%if %{with system_lua}
+%{__sed} -i -e 's/"lua"/"lua5.4"/' scripts/src/main.lua
+%endif
 
 %build
 %{__make} \
@@ -98,26 +128,71 @@ udowodnić wierne odtworzenie sprzętu?).
 	CC="%{__cc}" \
 	CXX="%{__cxx}" \
 	LD="%{__cxx}" \
-	OPT_FLAGS="%{rpmcflags} $(pkg-config --cflags lua5.3)" \
-	LDFLAGS="%{rpmldflags}" \
-	CPP11=1 \
+#	OPT_FLAGS="%{rpmcflags}%{?with_system_lua: $(pkg-config --cflags lua5.4)}" \
+#	LDFLAGS="%{rpmldflags}%{?with_system_lua: $(pkg-config --libs lua5.4)}" \
+	QT_HOME=%{_libdir}/qt6 \
 	NOWERROR=1 \
 	OSD=sdl \
+	TOOLS=1 \
+	%{?with_system_lua:USE_SYSTEM_LIB_LUA=1} \
+	USE_SYSTEM_LIB_ASIO=1 \
 	USE_SYSTEM_LIB_EXPAT=1 \
 	USE_SYSTEM_LIB_FLAC=1 \
+	USE_SYSTEM_LIB_GLM=1 \
 	USE_SYSTEM_LIB_JPEG=1 \
-	USE_SYSTEM_LIB_LUA=1 \
 	USE_SYSTEM_LIB_PORTAUDIO=1 \
 	USE_SYSTEM_LIB_PORTMIDI=1 \
+	USE_SYSTEM_LIB_PUGIXML=1 \
+	USE_SYSTEM_LIB_RAPIDJSON=1 \
 	USE_SYSTEM_LIB_SQLITE3=1 \
+	USE_SYSTEM_LIB_UTF8PROC=1 \
 	USE_SYSTEM_LIB_ZLIB=1 \
+	USE_SYSTEM_LIB_ZSTD=1 \
 	VERBOSE=1
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_bindir}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_bindir},%{_mandir}/man{1,6}} \
+	$RPM_BUILD_ROOT%{_datadir}/%{name}/{cheats,chds,crosshair,ctrlr,effects,fonts,roms,samples,shader}
+
+cat > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.ini << EOF
+# Define multi-user paths
+artpath            %{_datadir}/%{name}/artwork;%{_datadir}/%{name}/effects
+bgfx_path          %{_datadir}/%{name}/bgfx
+cheatpath          %{_datadir}/%{name}/cheats
+crosshairpath      %{_datadir}/%{name}/crosshair
+ctrlrpath          %{_datadir}/%{name}/ctrlr
+fontpath           %{_datadir}/%{name}/fonts
+hashpath           %{_datadir}/%{name}/hash
+languagepath       %{_datadir}/%{name}/language
+pluginspath        %{_datadir}/%{name}/plugins
+rompath            %{_datadir}/%{name}/roms;%{_datadir}/%{name}/chds;\$HOME/.local/share/%{name}/roms
+samplepath         %{_datadir}/%{name}/samples
+
+# Allow user to override ini settings
+inipath            \$HOME/.config/%{name};\$HOME/.%{name}/ini;%{_sysconfdir}/%{name}
 
-install mame $RPM_BUILD_ROOT%{_bindir}/mame
+# Set paths for local storage
+cfg_directory      \$HOME/.config/%{name}/cfg;\$HOME/.%{name}/cfg
+comment_directory  \$HOME/.config/%{name}/comments;\$HOME/.%{name}/comments
+diff_directory     \$HOME/.config/%{name}/diff;\$HOME/.%{name}/diff
+input_directory    \$HOME/.config/%{name}/inp;\$HOME/.%{name}/inp
+nvram_directory    \$HOME/.local/state/%{name}/nvram;\$HOME/.%{name}/nvram
+snapshot_directory \$HOME/.local/state/%{name}/snap;\$HOME/.%{name}/snap
+state_directory    \$HOME/.local/state/%{name}/sta;\$HOME/.%{name}/sta
+EOF
+
+cp -p %{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
+
+cp -p castool chdman floptool imgtool jedutil ldresample ldverify \
+    nltool nlwav pngcmp regrep romcmp srcclean unidasm $RPM_BUILD_ROOT%{_bindir}
+cp -p split $RPM_BUILD_ROOT%{_bindir}/%{name}-split
+
+cp -a artwork bgfx hash keymaps plugins $RPM_BUILD_ROOT%{_datadir}/%{name}
+cp -p src/osd/modules/opengl/shader/*.?sh $RPM_BUILD_ROOT%{_datadir}/%{name}/shader
+
+cp -p docs/man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
+cp -p docs/man/*.6 $RPM_BUILD_ROOT%{_mandir}/man6
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -125,4 +200,50 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %doc README.md
+%config(noreplace) %{_sysconfdir}/%{name}/%{name}.ini
 %attr(755,root,root) %{_bindir}/mame
+%dir %{_sysconfdir}/%{name}
+%{_mandir}/man6/mame.6*
+
+%files tools
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/castool
+%attr(755,root,root) %{_bindir}/chdman
+%attr(755,root,root) %{_bindir}/floptool
+%attr(755,root,root) %{_bindir}/imgtool
+%attr(755,root,root) %{_bindir}/jedutil
+%attr(755,root,root) %{_bindir}/ldresample
+%attr(755,root,root) %{_bindir}/ldverify
+%attr(755,root,root) %{_bindir}/nltool
+%attr(755,root,root) %{_bindir}/nlwav
+%attr(755,root,root) %{_bindir}/pngcmp
+%attr(755,root,root) %{_bindir}/regrep
+%attr(755,root,root) %{_bindir}/romcmp
+%attr(755,root,root) %{_bindir}/%{name}-split
+%attr(755,root,root) %{_bindir}/srcclean
+%attr(755,root,root) %{_bindir}/unidasm
+%{_mandir}/man1/castool.1*
+%{_mandir}/man1/chdman.1*
+%{_mandir}/man1/floptool.1*
+%{_mandir}/man1/imgtool.1*
+%{_mandir}/man1/jedutil.1*
+%{_mandir}/man1/ldplayer.1*
+%{_mandir}/man1/ldresample.1*
+%{_mandir}/man1/ldverify.1*
+%{_mandir}/man1/romcmp.1*
+
+%files data
+%defattr(644,root,root,755)
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}/artwork
+%{_datadir}/%{name}/bgfx
+%{_datadir}/%{name}/chds
+%{_datadir}/%{name}/cheats
+%{_datadir}/%{name}/effects
+%{_datadir}/%{name}/fonts
+%{_datadir}/%{name}/keymaps
+%{_datadir}/%{name}/plugins
+%{_datadir}/%{name}/roms
+%{_datadir}/%{name}/samples
+%{_datadir}/%{name}/shader
+%{_datadir}/%{name}/hash
diff --git a/lua-cxx.patch b/lua-cxx.patch
new file mode 100644
index 0000000..f8be252
--- /dev/null
+++ b/lua-cxx.patch
@@ -0,0 +1,11 @@
+--- mame-mame0283/3rdparty/lua/src/Makefile~	2025-11-27 17:32:18.000000000 +0100
++++ mame-mame0283/3rdparty/lua/src/Makefile	2025-11-30 20:26:32.966655887 +0100
+@@ -6,7 +6,7 @@
+ # Your platform. See PLATS for possible values.
+ PLAT= guess
+ 
+-CC= gcc -std=gnu99
++CC=$(CXX)
+ CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS)
+ LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
+ LIBS= -lm $(SYSLIBS) $(MYLIBS)
diff --git a/mame-includes.patch b/mame-includes.patch
deleted file mode 100644
index 2146a01..0000000
--- a/mame-includes.patch
+++ /dev/null
@@ -1,40 +0,0 @@
---- mame-mame0249/src/lib/netlist/plib/ptypes.h.orig	2022-10-27 00:12:58.000000000 +0200
-+++ mame-mame0249/src/lib/netlist/plib/ptypes.h	2024-09-24 22:34:28.500092609 +0200
-@@ -10,6 +10,7 @@
- 
- #include "pconfig.h"
- 
-+#include <cstdint>
- #include <limits>
- #include <string>
- #include <type_traits>
---- mame-mame0249/src/osd/modules/monitor/monitor_module.h.orig	2022-10-27 00:12:58.000000000 +0200
-+++ mame-mame0249/src/osd/modules/monitor/monitor_module.h	2024-09-25 06:22:41.836749799 +0200
-@@ -8,6 +8,7 @@
- #ifndef MAME_OSD_MODULES_MONITOR_MONITORMODULE_H
- #define MAME_OSD_MODULES_MONITOR_MONITORMODULE_H
- 
-+#include <cstdint>
- #include <vector>
- 
- #include "modules/osdmodule.h"
---- mame-mame0249/src/osd/modules/monitor/monitor_common.h.orig	2022-10-27 00:12:58.000000000 +0200
-+++ mame-mame0249/src/osd/modules/monitor/monitor_common.h	2024-09-25 06:23:06.383562606 +0200
-@@ -8,6 +8,7 @@
- #define __MONITOR_COMMON_H__
- 
- #include "monitor_module.h"
-+#include <cstdint>
- #include <map>
- 
- //============================================================
---- mame-mame0249/src/frontend/mame/ui/slider.h.orig	2022-10-27 00:12:58.000000000 +0200
-+++ mame-mame0249/src/frontend/mame/ui/slider.h	2024-09-25 06:24:44.315236300 +0200
-@@ -14,6 +14,7 @@
- 
- #pragma once
- 
-+#include <cstdint>
- #include <functional>
- #include <string>
- 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mame.git/commitdiff/053b8bf3bf6d19c45cae8dad4f2b4f7e30539db6




More information about the pld-cvs-commit mailing list