Mail archive
alpine-aports

[alpine-aports] [PATCH] testing/mame: new aport

From: Taner Tas <taner76_at_gmail.com>
Date: Fri, 2 Mar 2018 17:29:09 +0000

---
 testing/mame/APKBUILD                    | 214 +++++++++++++++++++++++++++++++
 testing/mame/m68000_archopts.patch       |  17 +++
 testing/mame/mame-musl-workaraound.patch |  22 ++++
 testing/mame/mame.ini                    |  61 +++++++++
 testing/mame/midi.conf                   |   1 +
 testing/mame/nonag.diff                  |  37 ++++++
 6 files changed, 352 insertions(+)
 create mode 100644 testing/mame/APKBUILD
 create mode 100644 testing/mame/m68000_archopts.patch
 create mode 100644 testing/mame/mame-musl-workaraound.patch
 create mode 100644 testing/mame/mame.ini
 create mode 100644 testing/mame/midi.conf
 create mode 100644 testing/mame/nonag.diff
diff --git a/testing/mame/APKBUILD b/testing/mame/APKBUILD
new file mode 100644
index 0000000..aa87424
--- /dev/null
+++ b/testing/mame/APKBUILD
_at_@ -0,0 +1,214 @@
+# Contributor: Taner Tas <taner76_at_gmail.com>
+# Maintainer: Taner Tas <taner76_at_gmail.com>
+pkgname=mame
+pkgver=0.195
+pkgrel=0
+pkgdesc="Multi Arcade Machine Emulator."
+url="http://mamedev.org"
+arch="x86 x86_64 ppc64le armhf aarch64"
+license="GPL-2.0-or-later"
+makedepends="coreutils p7zip nasm dos2unix subversion \
+	clang-dev libxrandr-dev libxinerama-dev alsa-lib-dev python2-dev qt5-qtbase-dev \
+	py3-sphinx sdl2-dev sdl2_ttf-dev expat-dev zlib-dev mesa-dev libxinerama-dev \
+	fontconfig-dev libjpeg-turbo-dev flac-dev lua5.3-dev sqlite-dev portaudio-dev \
+	rapidjson-dev glm-dev qt5-qtbase-dev portmidi-dev"
+subpackages="$pkgname-data::noarch $pkgname-doc $pkgname-common::noarch $pkgname-lang::noarch \
+	$pkgname-tools $pkgname-plugins::noarch $pkgname-arcade $pkgname-mess groovymame \
+	groovymame-arcade:groovyarcade groovymame-mess:groovymess"
+_groovymame_patch="groovymame-${pkgver}.diff"
+_asio_git="https://github.com/chriskohlhoff/asio.git"
+source="https://github.com/mamedev/mame/releases/download/${pkgname}${pkgver/.}/${pkgname}${pkgver/.}s.zip
+	$_groovymame_patch::https://drive.google.com/uc?export=download&id=1OdjvKB2B_vTJKONjjW9rqZ-XZC26vP0k
+	mame.ini
+	midi.conf
+	mame-musl-workaraound.patch
+	nonag.diff
+	m68000_archopts.patch"
+builddir="${srcdir}/${pkgname}-${pkgver}"
+options="!check"
+
+prepare() {
+	cd "$srcdir"
+	if [ ! -d ${pkgname}-${pkgver} ]; then
+		7z x -o"${pkgname}-${pkgver}" ${pkgname}.zip
+	fi
+	cd "$builddir"
+	if [ ! -d 3rdparty/asio.git ]; then
+		rm -rf 3rdparty/asio
+		git clone --depth=1 ${_asio_git} 3rdparty/asio.git
+		ln -sf asio.git/asio/ 3rdparty/
+	fi
+	cd "$builddir"
+	cp -n ${srcdir}/$_groovymame_patch .
+	echo "Converting all non-binary files to Unix format.."
+	find  . -type f -exec dos2unix -s -q {} \;
+	#clang workaraound
+	sed -i -e 's/-flifetime-dse=1//g' scripts/genie.lua
+	mkdir -p vanilla
+	default_prepare
+}
+
+build() {
+	export OVERRIDE_CC=clang
+	export OVERRIDE_CXX=clang++
+	export CFLAGS="$CFLAGS -I/usr/include/lua5.3"
+	export CXXFLAGS="$CFLAGS"
+	export LDFLAGS="$LDFLAGS -L/usr/lib/lua5.3"
+
+	case "$CARCH" in
+		x86|armhf|ppc) _PTR64= ;;
+		*) _PTR64=1 ;;
+	esac
+	case "$CARCH" in
+		x86_64|x86) _NOASM= ;;
+		*) _NOASM=1 ;;
+	esac
+
+_build="make
+	TARGETOS=linux
+	NOWERROR=1
+	DEBUG=
+	VERBOSE=1
+	REGENIE=1
+	OSD=sdl
+	FORCE_DRC_C_BACKEND=
+	PTR64=$_PTR64
+	NOASM=$_NOASM
+	TOOLS=
+	SDL_INI_PATH=/etc/mame
+	USE_SYSTEM_LIB_EXPAT=1
+	USE_SYSTEM_LIB_ZLIB=1
+	USE_SYSTEM_LIB_JPEG=1
+	USE_SYSTEM_LIB_FLAC=1
+	USE_SYSTEM_LIB_LUA=1
+	USE_SYSTEM_LIB_SQLITE3=1
+	USE_SYSTEM_LIB_PORTAUDIO=1
+	USE_SYSTEM_LIB_UV=1
+	USE_SYSTEM_LIB_GLM=1
+	USE_SYSTEM_LIB_RAPIDJSON=1
+	USE_SYSTEM_LIB_PORTMIDI=1
+	USE_SYSTEM_LIB_ASIO="
+
+	cd "$builddir"
+
+	if [ -d src/emu/switchres ]; then
+		patch -p0 -R < $_groovymame_patch
+		patch -p0 -R < "$srcdir"/nonag.diff
+	fi
+
+	$_build TOOLS=1 SUBTARGET=mame
+	mv -f mame vanilla/ || mv -f mame64 vanilla/mame
+	$_build SUBTARGET=arcade
+	mv -f mamearcade vanilla/ || mv -f mamearcade64 vanilla/mamearcade
+	$_build SUBTARGET=mess
+	mv -f mess vanilla/ || mv -f mess64 vanilla/mess
+
+	if [ ! -d src/emu/switchres ]; then
+		patch -p0 < $_groovymame_patch
+		patch -p0 < "$srcdir"/nonag.diff
+		$_build USE_QTDEBUG=0 SUBTARGET=mame
+		$_build USE_QTDEBUG=0 SUBTARGET=arcade
+		$_build USE_QTDEBUG=0 SUBTARGET=mess
+	fi
+}
+
+package() {
+	depends="$pkgname-common"
+	cd "$builddir"
+	install -D -m755 vanilla/mame "$pkgdir"/usr/bin/mame
+}
+
+common() {
+	cd "$builddir"
+	install -D -m644 "$srcdir"/mame.ini "$subpkgdir"/etc/mame/mame.ini
+	install -D -m644 "$srcdir"/midi.conf "$subpkgdir"/etc/modules-load.d/midi.conf
+	install -d -m755 "$subpkgdir"/usr/share/"$pkgname/roms"
+}
+
+arcade() {
+	pkgdesc="Multi Arcade Machine Emulator - Arcade specific build."
+	depends="$pkgname-common"
+	cd "$builddir"
+	install -D -m755 vanilla/mamearcade "$subpkgdir"/usr/bin/mamearcade
+}
+
+mess() {
+	pkgdesc="Multi Arcade Machine Emulator - Mess specific build."
+	depends="$pkgname-common"
+	cd "$builddir"
+	install -D -m755 vanilla/mess "$subpkgdir"/usr/bin/mess
+}
+
+groovymame() {
+	pkgdesc="Multi Arcade Machine Emulator with Groovymame/Switchres & No-Nag patchset."
+	depends="$pkgname-common"
+	cd "$builddir"
+	install -D -m755 mame "$subpkgdir"/usr/bin/groovymame || install -D -m755 mame64 "$subpkgdir"/usr/bin/groovymame
+}
+
+groovyarcade() {
+	desc="Groovymame - Arcade specific build."
+	depends="$pkgname-common"
+	cd "$builddir"
+	install -D -m755 mamearcade "$subpkgdir"/usr/bin/groovyarcade || install -D -m755 mamearcade64 "$subpkgdir"/usr/bin/groovyarcade
+	cd "$subpkgdir"/usr/bin/
+	ln -sf groovyarcade arcade
+}
+
+groovymess() {
+	desc="Groovymame - Mess specific build."
+	depends="$pkgname-common"
+	cd "$builddir"
+	install -D -m755 mess "$subpkgdir"/usr/bin/groovymess || install -D -m755 mess64 "$subpkgdir"/usr/bin/groovymess
+}
+
+data() {
+	pkgdesc="Distribution files for ${pkgname}"
+	cd "$builddir"
+	mkdir -p "$subpkgdir"/usr/share/"$pakgname"
+	for i in artwork bgfx hash hlsl ini keymaps samples; do
+		cp -r $i "$subpkgdir"/usr/share/"$pkgname"
+	done
+}
+
+plugins() {
+	pkgdesc="Distribution plugins for ${pkgname}"
+	cd "$builddir"
+	mkdir -p "$subpkgdir"/usr/share/"$pakgname"
+	cp -r plugins "$subpkgdir"/usr/share/"$pkgname"
+}
+
+tools() {
+	pkgdesc="Tools for ${pkgname}"
+	cd "$builddir"
+	mkdir -p "$subpkgdir"/usr/bin
+	for i in castool chdman floptool imgtool jedutil ldresample ldverify romcmp; do
+		install -sm755 $i "$subpkgdir"/usr/bin
+	done
+}
+
+lang() {
+	pkgdesc="Localization files for ${pkgname}"
+	cd "$builddir"
+	mkdir -p "$subpkgdir"/usr/share/"$pkgname"
+	cp -r language "$subpkgdir"/usr/share/"$pkgname"/
+}
+
+doc() {
+	pkgdesc="Man pages for ${pkgname} and tools"
+	cd "$builddir"
+	mkdir -p "$subpkgdir"/usr/share/man/man6
+	mkdir -p "$subpkgdir"/usr/share/man/man1
+	gzip -c docs/man/mame.6 > docs/man/mame.6.gz
+	cp docs/man/mame.6.gz "$subpkgdir"/usr/share/man/man6/
+	for i in castool.1 chdman.1 floptool.1 imgtool.1 jedutil.1 ldresample.1 ldverify.1 romcmp.1; do
+		gzip -c docs/man/$i > "$subpkgdir"/usr/share/man/man1/${i}.gz
+	done
+}
+sha512sums="cf39b0785aedbab596f232cceaa2cfbae9c4ac45a9c89a0badc1e619d7965d972f02fc9203c40a4c9aa8c0852fdcc91d6b50528b007885afb2e3f83f4da90589  mame0195s.zip
+3916a2a955716135ebf225c8e5433a07593db1b68e0f24162e08a7b2e03b6f7db6fa600bfe19110209506fc5cbdf9dbf3639451fed7551c4fbc7d3c7a84c745a  groovymame-0.195.diff
+b05e953b7c4be26eaa4ab192279fa62dd2b006069cd963e997295afe6e64b3ba04e5a257c69b008d5bc4b509274646d10b9499970b5c3c36cc86fb4ce18f9266  mame.ini
+8f83ff5a916f4ff8e86c5afbdfe4475f7780bb36c20c78d6d029d0eb0dafd77b3471faa538aca384001d2049dc94c4df3429c67d743adde9fd6329c91e6d19a2  midi.conf
+9335bb200f5026e7a368a52a40ee83cc81848905e9483bfbe0611a935ed7bd7c99fa0eaa80746194e76e4b641e6b7e0bc32b41906a60c2f9ea77e4ba8c8c7d43  mame-musl-workaraound.patch
+fdc84311a74c85d184c796aa61a772c24f583de98f0202d9884c276f58bae7f6125dc86f95395dc783b39493ef99bd221c08ae9fab472bf3526228d06143e000  nonag.diff
+a4d628d4648d28b9ae95f27ecba4a70b999ef11ffde31b31ca3ce2ed2fd4cfcab82ec78e2602309952518fac8c549d0b8b4294f6aa34c1acaa77f012ea13de9e  m68000_archopts.patch"
diff --git a/testing/mame/m68000_archopts.patch b/testing/mame/m68000_archopts.patch
new file mode 100644
index 0000000..46fd4a6
--- /dev/null
+++ b/testing/mame/m68000_archopts.patch
_at_@ -0,0 +1,17 @@
+Author: Jordi Mallach <jordi_at_debian.org>
+Description: Pass $(ARCHOPTS) to standalone m68000 makefile.
+Forwarded: no
+
+Index: mame/src/devices/cpu/m68000/makefile
+===================================================================
+--- mame.orig/src/devices/cpu/m68000/makefile
++++ mame/src/devices/cpu/m68000/makefile
+_at_@ -25,7 +25,7 @@ clean:
+ 	-_at_rm -f m68kops.*
+ 
+ m68kmake.o: m68kmake.cpp
+-	$(SILENT) $(CC) -x c++ -std=c++11 -o "$_at_" -c "$<"
++	$(SILENT) $(CC) -x c++ -std=c++11 $(ARCHOPTS) -o "$_at_" -c "$<"
+ 
+ m68kmake$(EXE) : m68kmake.o
+ 	_at_echo Linking $@...
diff --git a/testing/mame/mame-musl-workaraound.patch b/testing/mame/mame-musl-workaraound.patch
new file mode 100644
index 0000000..b4573da
--- /dev/null
+++ b/testing/mame/mame-musl-workaraound.patch
_at_@ -0,0 +1,22 @@
+--- a/src/lib/netlist/plib/pexception.cpp
++++ b/src/lib/netlist/plib/pexception.cpp
+_at_@ -11,7 +11,7 @@
+ #include <cfenv>
+ 
+ #if (defined(__x86_64__) || defined(__i386__)) && defined(__linux__)
+-#define HAS_FEENABLE_EXCEPT     (1)
++#define HAS_FEENABLE_EXCEPT     (0)
+ #else
+ #define HAS_FEENABLE_EXCEPT     (0)
+ #endif
+--- a/3rdparty/bx/include/bx/platform.h
++++ b/3rdparty/bx/include/bx/platform.h
+_at_@ -37,7 +37,7 @@
+ #define BX_CRT_NEWLIB 0
+ 
+ #ifndef BX_CRT_MUSL
+-#	define BX_CRT_MUSL 0
++#	define BX_CRT_MUSL 1
+ #endif // BX_CRT_MUSL
+ 
+ #ifndef BX_CRT_NONE
diff --git a/testing/mame/mame.ini b/testing/mame/mame.ini
new file mode 100644
index 0000000..795634a
--- /dev/null
+++ b/testing/mame/mame.ini
_at_@ -0,0 +1,61 @@
+#Run "mame -cc" to generate a custom mame.ini file.Then put it into ~/.mame folder. 
+#To see all available options, run "mame -showusage"
+homepath                  .
+rompath                   $HOME/.mame/roms;/usr/share/mame/roms
+hashpath                  /usr/share/mame/hash
+samplepath                $HOME/.mame/samples;/usr/share/mame/samples
+artpath                   $HOME/.mame/artwork;/usr/share/mame/artwork
+ctrlrpath                 /usr/share/mame/ctrlr
+inipath                   $HOME/.mame;/etc/mame
+fontpath                  $HOME/.mame/fonts;/usr/share/mame/fonts
+cheatpath                 $HOME/.mame/cheat;/usr/share/mame/cheat
+crosshairpath             $HOME/.mame/crosshair;/usr/share/mame/crosshair
+pluginspath               $HOME/.mame/plugins/;/usr/share/mame/plugins
+languagepath              /usr/share/mame/language
+swpath                    software
+
+cfg_directory             $HOME/.mame/cfg
+nvram_directory           $HOME/.mame/nvram
+input_directory           $HOME/.mame/inp
+state_directory           $HOME/.mame/sta
+snapshot_directory        $HOME/.mame/snap
+diff_directory            $HOME/.mame/diff
+comment_directory         $HOME/.mame/comments
+
+#Video output method: none, soft, bgfx, opengl
+video                     opengl
+
+#GROOVYMAME SPECIFIC
+#Automatic generation of modelines based on the specified monitor type
+modeline_generation       0
+#Predefined monitor type (http://forum.arcadecontrols.com/index.php/topic,116023.0.html)
+monitor                   arcade_31
+orientation               horizontal
+connector                 auto
+interlace                 1
+doublescan                1
+super_width               2560
+changeres                 1
+powerstrip                0
+lock_system_modes         1
+lock_unsupported_modes    1
+refresh_dont_care         0
+dotclock_min              0
+sync_refresh_tolerance    2.0
+frame_delay               0
+vsync_offset              0
+black_frame_insertion     0
+modeline                  auto
+ps_timing                 auto
+lcd_range                 auto
+crt_range0                auto
+crt_range1                auto
+crt_range2                auto
+crt_range3                auto
+crt_range4                auto
+crt_range5                auto
+crt_range6                auto
+crt_range7                auto
+crt_range8                auto
+crt_range9                auto
+#END OF GROOVYMAME SPECIFIC
diff --git a/testing/mame/midi.conf b/testing/mame/midi.conf
new file mode 100644
index 0000000..30a8665
--- /dev/null
+++ b/testing/mame/midi.conf
_at_@ -0,0 +1 @@
+snd_virmidi
diff --git a/testing/mame/nonag.diff b/testing/mame/nonag.diff
new file mode 100644
index 0000000..2a7518c
--- /dev/null
+++ b/testing/mame/nonag.diff
_at_@ -0,0 +1,37 @@
+diff -Nru oldsrc/emu/render.cpp src/emu/render.cpp
+--- oldsrc/emu/render.cpp	2017-08-30 11:43:29.000000000 +1000
++++ src/emu/render.cpp	2017-08-31 20:36:59.010177292 +1000
+_at_@ -1399,7 +1399,8 @@
+ 		}
+ 
+ 	// if we are not in the running stage, draw an outer box
+-	else
++	// DISABLE WHITE BORDER
++	else if ( !m_manager.machine().options().skip_gameinfo() )
+ 	{
+ 		render_primitive *prim = list.alloc(render_primitive::QUAD);
+ 		set_render_bounds_xy(prim->bounds, 0.0f, 0.0f, (float)m_width, (float)m_height);
+diff -Nru oldsrc/frontend/mame/ui/ui.cpp src/frontend/mame/ui/ui.cpp
+--- oldsrc/frontend/mame/ui/ui.cpp	2017-08-30 11:43:30.000000000 +1000
++++ src/frontend/mame/ui/ui.cpp	2017-08-31 20:48:49.676532160 +1000
+_at_@ -313,7 +313,8 @@
+ 		switch (state)
+ 		{
+ 		case 0:
+-			if (show_warnings)
++			// DISABLE INTERACTIVE WARNING MESSAGES
++			if (show_gameinfo)
+ 				messagebox_text = machine_info().warnings_string();
+ 			if (!messagebox_text.empty())
+ 			{
+_at_@ -770,6 +771,10 @@
+ 
+ uint32_t mame_ui_manager::handler_messagebox(render_container &container)
+ {
++	// DISABLE INITIALIZING, LOADING & DECRYPTING MESSAGES
++	if (machine().options().skip_gameinfo())
++		return 0;
++
+ 	draw_text_box(container, messagebox_text.c_str(), ui::text_layout::LEFT, 0.5f, 0.5f, messagebox_backcolor);
+ 	return 0;
+ }
-- 
2.16.2
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Fri Mar 02 2018 - 17:29:09 GMT