Mail archive
alpine-aports

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

From: Taner Tas <taner76_at_gmail.com>
Date: Fri, 20 Apr 2018 08:40:38 +0300

http://mamedev.org
Multi Arcade Machine Emulator.
---
 testing/mame/APKBUILD              | 160 +++++++++++++++++++++++++++++
 testing/mame/fix-musl.patch        |  21 ++++
 testing/mame/m68000_archopts.patch |  17 +++
 testing/mame/mame.ini              |  61 +++++++++++
 testing/mame/midi.conf             |   1 +
 5 files changed, 260 insertions(+)
 create mode 100644 testing/mame/APKBUILD
 create mode 100644 testing/mame/fix-musl.patch
 create mode 100644 testing/mame/m68000_archopts.patch
 create mode 100644 testing/mame/mame.ini
 create mode 100644 testing/mame/midi.conf
diff --git a/testing/mame/APKBUILD b/testing/mame/APKBUILD
new file mode 100644
index 0000000000..2691c547a7
--- /dev/null
+++ b/testing/mame/APKBUILD
_at_@ -0,0 +1,160 @@
+# Contributor: Taner Tas <taner76_at_gmail.com>
+# Maintainer: Taner Tas <taner76_at_gmail.com>
+pkgname=mame
+pkgver=0.196
+pkgrel=0
+pkgdesc="Multi Arcade Machine Emulator."
+url="http://mamedev.org"
+arch="all"
+license="GPL-2.0-or-later"
+depends="$pkgname-common"
+makedepends="coreutils p7zip nasm dos2unix clang-dev libxrandr-dev libxinerama-dev
+	alsa-lib-dev python2-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 portmidi-dev asio-dev"
+subpackages="$pkgname-data::noarch $pkgname-doc $pkgname-common::noarch $pkgname-lang
+	$pkgname-tools $pkgname-plugins::noarch $pkgname-arcade $pkgname-mess"
+source="https://github.com/mamedev/mame/releases/download/${pkgname}${pkgver/.}/${pkgname}${pkgver/.}s.zip
+	mame.ini
+	midi.conf
+	fix-musl.patch
+	m68000_archopts.patch
+	"
+options="!check"
+
+prepare() {
+	cd "$srcdir"
+	if [ ! -d ${pkgname}-${pkgver} ]; then
+		7z x -o"${pkgname}-${pkgver}" ${pkgname}.zip
+	fi
+	cd "$builddir"
+	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
+	default_prepare
+}
+
+build() {
+	export OVERRIDE_CC=clang
+	export OVERRIDE_CXX=clang++
+	export CFLAGS="$CFLAGS -I/usr/include/lua5.3 -DBX_CRT_MUSL"
+	export CXXFLAGS="$CFLAGS"
+	export LDFLAGS="$LDFLAGS -L/usr/lib/lua5.3"
+
+	case "$CARCH" in
+		x86|armhf) _PTR64=0 _SYMBOLS=0;;
+		*) _PTR64=1 _SYMBOLS=1;;
+	esac
+	case "$CARCH" in
+		x86_64|x86) _NOASM=0 ;;
+		*) _NOASM=1 ;;
+	esac
+	case "$CARCH" in
+		s390x) _BIGENDIAN=1 ;;
+		*) _BIGENDIAN=0 ;;
+	esac
+
+_build="make
+	TARGETOS=linux
+	NOWERROR=1
+	DEBUG=0
+	USE_QTDEBUG=0
+	VERBOSE=1
+	REGENIE=1
+	OSD=sdl
+	SYMBOLS=$_SYMBOLS
+	FORCE_DRC_C_BACKEND=
+	PTR64=$_PTR64
+	NOASM=$_NOASM
+	BIGENDIAN=$_BIGENDIAN
+	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=1"
+
+	cd "$builddir"
+
+	$_build TOOLS=1 SUBTARGET=mame
+	$_build SUBTARGET=arcade
+	$_build SUBTARGET=mess
+}
+
+package() {
+	cd "$builddir"
+	install -D -m755 mame "$pkgdir"/usr/bin/mame || install -D -m755 mame64 "$pkgdir"/usr/bin/mame
+	install -D -m644  docs/man/mame.6  "$pkgdir"/usr/share/man/man6/mame.6
+	for i in castool.1 chdman.1 floptool.1 imgtool.1 jedutil.1 ldresample.1 ldverify.1 romcmp.1; do
+		install -D -m644 "docs/man/$i"  "$pkgdir"/usr/share/man/man1/"$i"
+	done
+}
+
+common() {
+	cd "$builddir"
+	pkgdesc="MAME - Common configuration files"
+	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."
+	cd "$builddir"
+	install -D -m755 mamearcade "$subpkgdir"/usr/bin/mamearcade || install -D -m755 mamearcade64 "$subpkgdir"/usr/bin/mamearcade
+}
+
+mess() {
+	pkgdesc="Multi Arcade Machine Emulator - Mess specific build."
+	cd "$builddir"
+	install -D -m755 mess "$subpkgdir"/usr/bin/mess || install -D -m755 mess64 "$subpkgdir"/usr/bin/mess
+}
+
+data() {
+	pkgdesc="Distribution files for ${pkgname}"
+	cd "$builddir"
+	mkdir -p "$subpkgdir"/usr/share/"$pkgname"
+	for i in artwork bgfx hash hlsl ini keymaps samples; do
+		cp -r $i "$subpkgdir"/usr/share/"$pkgname"
+	done
+	rm -rf "$subpkgdir"/usr/share/"$pkgname"/bgfx/shaders/dx11
+	rm -rf "$subpkgdir"/usr/share/"$pkgname"/bgfx/shaders/dx9
+	rm -rf "$subpkgdir"/usr/share/"$pkgname"/bgfx/shaders/metal
+}
+
+plugins() {
+	pkgdesc="Distribution plugins for ${pkgname}"
+	cd "$builddir"
+	mkdir -p "$subpkgdir"/usr/share/"$pkgname"
+	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"/
+}
+sha512sums="dfff1f1d0c8fd11e49a0d4d554a229e13c3e10fcb90da54c8b4945bc05ebe936ad31ed96cd5c320a831500db58a48f7ea25b97312f29c94c970c808e64af595d  mame0196s.zip
+8b7915eb8bd030d4840942ee2a89b01ba52558d47dc44d51c887c5fe6b704a1e9174f767364b7b1e01889fc0e62066804d23ca742a2a6c572ca792e4f1214a9a  mame.ini
+8f83ff5a916f4ff8e86c5afbdfe4475f7780bb36c20c78d6d029d0eb0dafd77b3471faa538aca384001d2049dc94c4df3429c67d743adde9fd6329c91e6d19a2  midi.conf
+75bba366aebb37de7758368fbf7418194a18d535e61c1768e6c2c5cf4b3b7a2f625ef687cb8278c03daa9e308951df4c0bdcc944dfcc4ce5305f5ac83e5e049b  fix-musl.patch
+a4d628d4648d28b9ae95f27ecba4a70b999ef11ffde31b31ca3ce2ed2fd4cfcab82ec78e2602309952518fac8c549d0b8b4294f6aa34c1acaa77f012ea13de9e  m68000_archopts.patch"
diff --git a/testing/mame/fix-musl.patch b/testing/mame/fix-musl.patch
new file mode 100644
index 0000000000..cda914196c
--- /dev/null
+++ b/testing/mame/fix-musl.patch
_at_@ -0,0 +1,21 @@
+--- a/src/lib/netlist/plib/pexception.cpp
++++ b/src/lib/netlist/plib/pexception.cpp
+_at_@ -10,7 +10,7 @@
+ 
+ #include <cfenv>
+ 
+-#if (defined(__x86_64__) || defined(__i386__)) && defined(__linux__)
++#if (defined(__x86_64__) || defined(__i386__)) && defined(__linux__) && defined(__GLIBC__)
+ #define HAS_FEENABLE_EXCEPT     (1)
+ #else
+ #define HAS_FEENABLE_EXCEPT     (0)
+--- a/3rdparty/bx/include/bx/bx.h
++++ b/3rdparty/bx/include/bx/bx.h
+_at_@ -11,6 +11,7 @@
+ #include <stdint.h> // uint32_t
+ #include <stdlib.h> // size_t
+ #include <stddef.h> // ptrdiff_t
++#include <time.h>   // time_t
+ 
+ #include "platform.h"
+ #include "config.h"
diff --git a/testing/mame/m68000_archopts.patch b/testing/mame/m68000_archopts.patch
new file mode 100644
index 0000000000..46fd4a6630
--- /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.ini b/testing/mame/mame.ini
new file mode 100644
index 0000000000..1fdd79d901
--- /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       1
+#Predefined monitor type (http://forum.arcadecontrols.com/index.php/topic,116023.0.html)
+monitor                   lcd
+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 0000000000..30a866501c
--- /dev/null
+++ b/testing/mame/midi.conf
_at_@ -0,0 +1 @@
+snd_virmidi
-- 
2.17.0
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Fri Apr 20 2018 - 08:40:38 GMT