diff --git a/games-emulation/mame/additional-files/mame.rdef.in b/games-emulation/mame/additional-files/mame.rdef.in new file mode 100644 index 000000000..13c681534 --- /dev/null +++ b/games-emulation/mame/additional-files/mame.rdef.in @@ -0,0 +1,40 @@ + +resource app_flags B_MULTIPLE_LAUNCH; + +resource app_version { + major = @MAJOR@, + middle = @MIDDLE@, + minor = @MINOR@, + variety = B_APPV_FINAL, + internal = 0, + short_info = "@SUMMARY@", + long_info = "@DESCRIPTION@" +}; + +resource app_signature "@APP_SIGNATURE@"; + +resource vector_icon { + $"6E6369660C010100007B0301000002001602B6D0E43AA952BC6AB8B88EA74B71" + $"7F4B0BA80099FE6C020016023A72333A634ABACB4D3ADCBF4935514A884A00CC" + $"FFA5020016023894763AB560BCB5603A94764A8410498D8A00E5FFCB02011602" + $"3B8098B9DD5539DD553B809848E42F46770900E4FF2102030603378AE535B709" + $"B5B709378AE54A430349497B00010000766C6C6CFE010101020016023A8082AC" + $"B0492C262B39FFF649BEEE46822801BEFF0B020116033800000000000000003B" + $"C00049800048F00000FFC886FF41020106033B4F850000000000003B4F85495F" + $"FB467FF700FFFFFF7F00AAFFFF0000FF02000603380000000000000000380000" + $"4B20004A400000FF595999B30404FFFF0606020106033B80000000000000003B" + $"800049400046800000FFD5D570FBAAAAFFEE06060A0A062448244C445C584858" + $"4438360A044456445C584858440A044456445C244C24480A0424484456584438" + $"36020447C0BF47BF6D47C2103EC323C0EFC323BCF8C32335C0BF35C21035BF6D" + $"3EBE5BBCF8BE5BC0EFBE5B06051F033E47BEA947BF3E4740C25FBF83C27940C2" + $"5F353C3CC25F3CC25FBE64C27902043E24BCB824C12F24482E48B65848BACF3E" + $"38C12F38BCB838342E34BACF34B6580204544454435445514654464E464E444E" + $"454E4351414E4154410A05445E485E5E485A46444602024E5C4254C992CDBC5A" + $"4ECE24C7A24C46100A00020809000A0101001001178400040A020101000A0301" + $"02000A040103000A010106124066660000000000003F9999C50000490CCC0117" + $"8400040A050106024066660000000000003F9999C50000490CCC0A070106123F" + $"99990000000000003E6EEF430000494F7701178400040A060106023F99990000" + $"000000003E9999430000492CCC0A010106023D33330000000000003C66664840" + $"004A0CCC0A080105000A0101061001178400040A090106000A01010710011784" + $"00040A0A0107000A0B0106023C66660000000000003B33334A800049E666" +}; diff --git a/games-emulation/mame/additional-files/mame.sh b/games-emulation/mame/additional-files/mame.sh new file mode 100755 index 000000000..f05897cfe --- /dev/null +++ b/games-emulation/mame/additional-files/mame.sh @@ -0,0 +1,69 @@ +#!/bin/bash +mame=$(findpaths -r 'cmd:mame' B_FIND_PATH_BIN_DIRECTORY mame) +userSettingsDir=$(finddir B_USER_SETTINGS_DIRECTORY) + +print() { + if [ -t 1 ]; then + echo "$1" + else + alert --info "$1" + fi +} + +gen_mame_dirs() { + echo $userSettingsDir/mame/$1';'$(findpaths -c ';' B_FIND_PATH_LIB_DIRECTORY mame/"$1") +} + +mame_first_run() { + print "Creating an ini file for MAME at $userSettingsDir/mame/mame.ini +Modify this file for permanent changes to your MAME +options and paths before running MAME again." + + mkdir -p "$userSettingsDir/mame" || exit + cd -- "$userSettingsDir/mame" || exit + + if [ -e mame.ini ]; then + mv mame.ini mameini.bak || exit + print "Your old ini file has been renamed to mameini.bak" + fi + + # Note: the single quotes here are not a mistake; MAME will save these + # strings verbatim into its configuration file, and expand the variables when + # it is run in future. + "$mame" \ + -artpath "$(gen_mame_dirs artwork)" \ + -bgfx_path "$(gen_mame_dirs bgfx)" \ + -ctrlrpath "$(gen_mame_dirs ctrlr)" \ + -hashpath "$(gen_mame_dirs hash)" \ + -languagepath "$(gen_mame_dirs language)" \ + -pluginspath "$(gen_mame_dirs plugins)" \ + -inipath "$(gen_mame_dirs ini)" \ + -rompath "$(gen_mame_dirs roms)" \ + -samplepath "$(gen_mame_dirs samples)" \ + -cfg_directory "$(gen_mame_dirs cfg)" \ + -comment_directory "$(gen_mame_dirs comments)" \ + -diff_directory "$(gen_mame_dirs diff)" \ + -input_directory "$(gen_mame_dirs inp)" \ + -nvram_directory "$(gen_mame_dirs nvram)" \ + -snapshot_directory "$(gen_mame_dirs snap)" \ + -state_directory "$(gen_mame_dirs sta)" \ + -video opengl \ + -createconfig +} + +if [ "$1" = "--newini" ]; then + mame_first_run + exit +elif ! [ -e "$userSettingsDir/mame" ]; then + echo "Running MAME for the first time..." + + mkdir -- "$userSettingsDir/mame" + ( + cd -- "$userSettingsDir/mame" || exit + mkdir artwork bgfx cfg comments ctrlr diff hash ini inp language nvram samples snap sta roms + + mame_first_run + ) || exit +fi + +exec "$mame" -inipath "$userSettingsDir/mame" -cfg_directory "$userSettingsDir/mame/cfg" "$@" diff --git a/games-emulation/mame/mame-0.209~git.recipe b/games-emulation/mame/mame-0.209~git.recipe deleted file mode 100644 index 112cad347..000000000 --- a/games-emulation/mame/mame-0.209~git.recipe +++ /dev/null @@ -1,127 +0,0 @@ -SUMMARY="A a multi-purpose emulation framework" -DESCRIPTION="MAME\'s purpose is to preserve decades of software history. As \ -electronic technology continues to rush forward, MAME prevents this important \ -\"vintage\" software from being lost and forgotten. This is achieved by \ -documenting the hardware and how it functions. The source code to MAME \ -serves as this documentation. The fact that the software is usable serves \ -primarily to validate the accuracy of the documentation (how else can you \ -prove that you have recreated the hardware faithfully?). Over time, MAME \ -(originally stood for Multiple Arcade Machine Emulator) absorbed the \ -sister-project MESS (Multi Emulator Super System), so MAME now documents a \ -wide variety of (mostly vintage) computers, video game consoles and \ -calculators, in addition to the arcade video games that were its initial focus." -HOMEPAGE="https://www.mamedev.org/" -COPYRIGHT="1997-2019 MAMEDev and contributors" -LICENSE="GNU GPL v2" -REVISION="1" -srcGitRev="dcf6e1c61be02811aa2205c46a2e006331b3f14d" -SOURCE_URI="https://github.com/mamedev/mame/archive/$srcGitRev.zip" -CHECKSUM_SHA256="9681d79dae311cdab3de91bc21a030cc030511d96fb643aacd4ad404e42896ce" -SOURCE_FILENAME="mame-$srcGitRev.zip" -SOURCE_DIR="mame-$srcGitRev" -PATCHES="mame-$portVersion.patchset" - -ARCHITECTURES="!x86_gcc2 x86 x86_64" -SECONDARY_ARCHITECTURES="x86" - -bits=64 -commandBinDir=$binDir -commandSuffix=$secondaryArchSuffix -if [ "$targetArchitecture" = x86_gcc2 ] -then - bits=32 - commandBinDir=$prefix/bin - commandSuffix= -fi - -PROVIDES=" - mame$secondaryArchSuffix = $portVersion - cmd:castool$commandSuffix - cmd:chdman$commandSuffix - cmd:floptool$commandSuffix - cmd:imgtool$commandSuffix - cmd:jedutil$commandSuffix - cmd:ldresample$commandSuffix - cmd:ldverify$commandSuffix - cmd:mame$commandSuffix - cmd:mame$bits$commandSuffix - cmd:nltool$commandSuffix - cmd:nlwav$commandSuffix - cmd:pngcmp$commandSuffix - cmd:regrep$commandSuffix - cmd:romcmp$commandSuffix - cmd:split$commandSuffix - cmd:src2html$commandSuffix - cmd:srcclean$commandSuffix - cmd:testkeys$commandSuffix - cmd:unidasm$commandSuffix -" - -REQUIRES=" - haiku$secondaryArchSuffix -# glm$secondaryArchSuffix -# lib:libexpat$secondaryArchSuffix -# lib:libflac$secondaryArchSuffix - lib:libfontconfig$secondaryArchSuffix - lib:libfreetype$secondaryArchSuffix - lib:libGL$secondaryArchSuffix -# lib:libjpeg$secondaryArchSuffix -# lib:liblua$secondaryArchSuffix - lib:libpugixml$secondaryArchSuffix - lib:libSDL2_2.0$secondaryArchSuffix - lib:libSDL2_ttf$secondaryArchSuffix - lib:libsqlite3$secondaryArchSuffix -# lib:libutf8proc$secondaryArchSuffix - lib:libz$secondaryArchSuffix -" - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel -# glm${secondaryArchSuffix}_devel -# devel:libexpat$secondaryArchSuffix -# devel:libflac$secondaryArchSuffix - devel:libfontconfig$secondaryArchSuffix - devel:libfreetype$secondaryArchSuffix - devel:libGL$secondaryArchSuffix -# devel:libjpeg$secondaryArchSuffix -# devel:liblua$secondaryArchSuffix - devel:libpugixml$secondaryArchSuffix -# devel:librapidjson$secondaryArchSuffix - devel:libSDL2_2.0$secondaryArchSuffix - devel:libSDL2_ttf$secondaryArchSuffix - devel:libsqlite3$secondaryArchSuffix -# devel:libutf8proc$secondaryArchSuffix - devel:libz$secondaryArchSuffix -" -BUILD_PREREQUIRES=" - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:libtoolize - cmd:make - cmd:pkg_config$secondaryArchSuffix - cmd:python2 -" - -BUILD() -{ - LIBS="-lbsd -lnetwork -lpugixml -lsqlite3" \ - LDFLAGS="-lbsd -lnetwork -lpugixml -lsqlite3" \ - make \ - REGENIE=1 \ - TOOLS=1 \ - PRECOMPILE=0 \ - USE_SYSTEM_LIB_SQLITE3=1 \ - $jobArgs -} - -INSTALL() -{ - mkdir -p $commandBinDir - - for f in castool chdman floptool imgtool jedutil ldresample ldverify \ - mame$bits nltool nlwav pngcmp regrep romcmp split src2html srcclean \ - testkeys unidasm; do - install -m 755 -t "$commandBinDir" $f - done - ln -s "$commandBinDir/mame$bits" "$commandBinDir/mame" -} diff --git a/games-emulation/mame/mame-0.210.recipe b/games-emulation/mame/mame-0.210.recipe new file mode 100644 index 000000000..f355872f4 --- /dev/null +++ b/games-emulation/mame/mame-0.210.recipe @@ -0,0 +1,219 @@ +SUMMARY="A multi-purpose emulation framework" +DESCRIPTION="MAME\'s purpose is to preserve decades of software history. As \ +electronic technology continues to rush forward, MAME prevents this important \ +\"vintage\" software from being lost and forgotten. This is achieved by \ +documenting the hardware and how it functions. The source code to MAME \ +serves as this documentation. The fact that the software is usable serves \ +primarily to validate the accuracy of the documentation (how else can you \ +prove that you have recreated the hardware faithfully?). Over time, MAME \ +(originally stood for Multiple Arcade Machine Emulator) absorbed the \ +sister-project MESS (Multi Emulator Super System), so MAME now documents a \ +wide variety of (mostly vintage) computers, video game consoles and \ +calculators, in addition to the arcade video games that were its initial focus." +HOMEPAGE="https://www.mamedev.org/" +COPYRIGHT="1997-2019 MAMEDev and contributors" +LICENSE="GNU GPL v2" +REVISION="1" +SOURCE_URI="https://github.com/mamedev/mame/archive/mame${portVersion/./}.tar.gz" +CHECKSUM_SHA256="4d0b23f3c9f9b2f6283ed78d5afc9a6391d2ee6ce5f0f4bcc2a357ec14aa06c4" +SOURCE_FILENAME="mame-$portVersion.tar.gz" +SOURCE_DIR="mame-mame${portVersion/./}" +PATCHES="mame-$portVersion.patchset" +ADDITIONAL_FILES=" + mame.sh + mame.rdef.in + " + +ARCHITECTURES="!x86_gcc2 x86 x86_64" +SECONDARY_ARCHITECTURES="x86" + +bits=64 +commandBinDir=$binDir +commandSuffix=$secondaryArchSuffix +if [ "$targetArchitecture" = x86_gcc2 ]; then + bits= + commandBinDir=$prefix/bin + commandSuffix= +fi + +PROVIDES=" + mame$secondaryArchSuffix = $portVersion + cmd:castool$commandSuffix + cmd:chdman$commandSuffix + cmd:floptool$commandSuffix + cmd:imgtool$commandSuffix + cmd:jedutil$commandSuffix + cmd:ldresample$commandSuffix + cmd:ldverify$commandSuffix + cmd:mame.sh + cmd:mame$commandSuffix + cmd:nltool$commandSuffix + cmd:nlwav$commandSuffix + cmd:pngcmp$commandSuffix + cmd:regrep$commandSuffix + cmd:romcmp$commandSuffix + cmd:split$commandSuffix + cmd:src2html$commandSuffix + cmd:srcclean$commandSuffix + cmd:testkeys$commandSuffix + cmd:unidasm$commandSuffix +" + +REQUIRES=" + haiku$secondaryArchSuffix + lib:libexpat$secondaryArchSuffix + lib:libflac$secondaryArchSuffix + lib:libfontconfig$secondaryArchSuffix + lib:libfreetype$secondaryArchSuffix + lib:libGL$secondaryArchSuffix + lib:libjpeg$secondaryArchSuffix + lib:liblua$secondaryArchSuffix >= 5.3 + lib:libpugixml$secondaryArchSuffix + lib:libSDL2_2.0$secondaryArchSuffix + lib:libSDL2_ttf$secondaryArchSuffix + lib:libsqlite3$secondaryArchSuffix + lib:libutf8proc$secondaryArchSuffix + lib:libz$secondaryArchSuffix +" + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + glm${secondaryArchSuffix}_devel + devel:libexpat$secondaryArchSuffix + devel:libflac$secondaryArchSuffix + devel:libfontconfig$secondaryArchSuffix + devel:libfreetype$secondaryArchSuffix + devel:libGL$secondaryArchSuffix + devel:libjpeg$secondaryArchSuffix + devel:liblua$secondaryArchSuffix >= 5.3 + devel:libogg$secondaryArchSuffix + devel:libpugixml$secondaryArchSuffix + devel:librapidjson$secondaryArchSuffix + devel:libSDL2_2.0$secondaryArchSuffix + devel:libSDL2_ttf$secondaryArchSuffix + devel:libsqlite3$secondaryArchSuffix + devel:libutf8proc$secondaryArchSuffix + devel:libz$secondaryArchSuffix +" +BUILD_PREREQUIRES=" + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:libtoolize + cmd:make + cmd:pkg_config$secondaryArchSuffix + cmd:python2 + cmd:sed + cmd:strip$secondaryArchSuffix +" + +defineDebugInfoPackage mame$secondaryArchSuffix \ + $commandBinDir/castool \ + $commandBinDir/chdman \ + $commandBinDir/floptool \ + $commandBinDir/imgtool \ + $commandBinDir/jedutil \ + $commandBinDir/ldresample \ + $commandBinDir/ldverify \ + $commandBinDir/mame \ + $commandBinDir/nltool \ + $commandBinDir/nlwav \ + $commandBinDir/pngcmp \ + $commandBinDir/regrep \ + $commandBinDir/romcmp \ + $commandBinDir/split \ + $commandBinDir/src2html \ + $commandBinDir/srcclean \ + $commandBinDir/testkeys \ + $commandBinDir/unidasm + +BUILD() +{ +# make clean + + # This is wrong on so many levels + SYS_LDFLAGS="-lbsd -lnetwork " # trailing space required! + for _i in flac libutf8proc lua RapidJSON sqlite3; do + SYS_CFLAGS+="`pkg-config $_i --cflags`" + SYS_LDFLAGS+="`pkg-config $_i --libs`" + done + + ARCHOPTS="$SYS_CFLAGS $SYS_LDFLAGS" \ + make \ + REGENIE=1 \ + TOOLS=1 \ + PRECOMPILE=0 \ + NOWERROR=1 \ + 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_UTF8PROC=1 \ + USE_SYSTEM_LIB_GLM=1 \ + USE_SYSTEM_LIB_RAPIDJSON=1 \ + USE_SYSTEM_LIB_PUGIXML=1 \ + $jobArgs +} + +INSTALL() +{ + # Based on https://projects.archlinux.de/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/mame + + # Arch cleanup + # 32 bit main binary called as "mame" which would collide with our symlink + if [ "$targetArchitecture" = x86_64 ]; then + mv mame$bits mame + fi + + # Install the binaries + mkdir -p "$commandBinDir" + for _i in castool chdman floptool imgtool jedutil ldresample ldverify \ + mame nltool nlwav pngcmp regrep romcmp split src2html srcclean \ + testkeys unidasm; do + install -m755 $_i -t "$commandBinDir" + strip "$commandBinDir"/$_i + done + + # Create the startscript + cp $portDir/additional-files/mame.sh "$commandBinDir"/mame.sh + chmod +x "$commandBinDir"/mame.sh + + # Add extra attributes to the binaries... + local APP_SIGNATURE="application/x-vnd.mame" + local MAJOR="`echo "$portVersion" | cut -d. -f1`" + local MIDDLE="`echo "$portVersion" | cut -d. -f2`" + local MINOR="0" + sed \ + -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + -e "s|@SUMMARY@|Multiple Arcade Machine Emulator|" \ + -e "s|@DESCRIPTION@|$SUMMARY|" \ + $portDir/additional-files/mame.rdef.in > mame.rdef + + addResourcesToBinaries mame.rdef "$commandBinDir/mame" + + # ...and to our startscript, but we can't use addResourcesToBinaries here + rc mame.rdef + resattr -o "$commandBinDir"/mame.sh mame.rsrc + + # Creating icon in Haiku's leaf-menu + addAppDeskbarSymlink "$commandBinDir"/mame.sh "MAME" + + # Install the extra bits + install -Dm644 src/osd/modules/opengl/shader/glsl*.*h -t "$libDir/"/mame/shader/ + cp -ar {artwork,bgfx,plugins,language,ctrlr,keymaps,hash} "$libDir"/mame/ + + # FS#28203 fix from AUR + sed -i 's|KEYCODE_2_PAD|KEYCODE_2PAD|' "$libDir"/mame/ctrlr/*.cfg + sed -i 's|KEYCODE_4_PAD|KEYCODE_4PAD|' "$libDir"/mame/ctrlr/*.cfg + sed -i 's|KEYCODE_6_PAD|KEYCODE_6PAD|' "$libDir"/mame/ctrlr/*.cfg + sed -i 's|KEYCODE_8_PAD|KEYCODE_8PAD|' "$libDir"/mame/ctrlr/*.cfg + + # Install man-pages + install -dm0755 "$manDir"/man{1,6} + install -m644 docs/man/*.1* "$manDir"/man1 + install -m644 docs/man/*.6* "$manDir"/man6 +} diff --git a/games-emulation/mame/patches/mame-0.209~git.patchset b/games-emulation/mame/patches/mame-0.210.patchset similarity index 97% rename from games-emulation/mame/patches/mame-0.209~git.patchset rename to games-emulation/mame/patches/mame-0.210.patchset index 40a15a5ae..3ecda914c 100644 --- a/games-emulation/mame/patches/mame-0.209~git.patchset +++ b/games-emulation/mame/patches/mame-0.210.patchset @@ -1,6 +1,6 @@ -From fd6cdce8f103f772cded1dc8f9be7f55723e0cdd Mon Sep 17 00:00:00 2001 +From 10e90efe1df231765209973799a86338acc11d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= -Date: Sun, 26 May 2019 16:32:28 +0200 +Date: Sun, 9 Jun 2019 18:07:46 +0200 Subject: [PATCH] Haiku patches --- @@ -20,13 +20,12 @@ Subject: [PATCH] Haiku patches 3rdparty/genie/src/base/cmdline.lua | 1 + 3rdparty/genie/src/base/os.lua | 3 + 3rdparty/genie/src/host/premake.h | 3 + - 3rdparty/lua-zlib/lua_zlib.c | 2 +- makefile | 27 + scripts/toolchain.lua | 9 + src/osd/modules/file/posixfile.cpp | 4 +- src/osd/modules/file/posixptty.cpp | 4 + src/osd/modules/render/drawbgfx.cpp | 2 +- - 22 files changed, 611 insertions(+), 7 deletions(-) + 21 files changed, 610 insertions(+), 6 deletions(-) create mode 100644 3rdparty/genie/build/gmake.haiku/Makefile create mode 100644 3rdparty/genie/build/gmake.haiku/genie.make @@ -857,24 +856,11 @@ index f0782db4..5a3a636f 100644 #else #define PLATFORM_WINDOWS (1) #define PLATFORM_STRING "windows" -diff --git a/3rdparty/lua-zlib/lua_zlib.c b/3rdparty/lua-zlib/lua_zlib.c -index 1921ab70..b619258c 100644 ---- a/3rdparty/lua-zlib/lua_zlib.c -+++ b/3rdparty/lua-zlib/lua_zlib.c -@@ -392,7 +392,7 @@ LUALIB_API int luaopen_zlib(lua_State * const L) { - - SETLITERAL("_COPYRIGHT", "Copyright (c) 2009-2010 Brian Maher"); - SETLITERAL("_DESCRIPTION", "Yet another binding to the zlib library"); -- SETLITERAL("_VERSION", "lua-zlib $Id$ "); -+ SETLITERAL("_VERSION", "lua-zlib $Id$ $Format:%d$"); - - /* Expose this to lua so we can do a test: */ - SETINT("_TEST_BUFSIZ", LUAL_BUFFERSIZE); diff --git a/makefile b/makefile -index 40ac90c5..a71462e6 100644 +index 29935190..740b3d53 100644 --- a/makefile +++ b/makefile -@@ -214,6 +214,7 @@ GENIEOS := darwin +@@ -215,6 +215,7 @@ GENIEOS := darwin endif ifeq ($(firstword $(filter Haiku,$(UNAME))),Haiku) OS := haiku @@ -882,7 +868,7 @@ index 40ac90c5..a71462e6 100644 endif ifndef OS $(error Unable to detect OS from uname -a: $(UNAME)) -@@ -444,6 +445,10 @@ endif +@@ -445,6 +446,10 @@ endif ifeq ($(TARGETOS),asmjs) OSD := sdl endif @@ -893,7 +879,7 @@ index 40ac90c5..a71462e6 100644 endif #------------------------------------------------- -@@ -1547,6 +1552,28 @@ endif +@@ -1552,6 +1557,28 @@ endif $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-ci20 config=$(CONFIG) precompile $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-ci20 config=$(CONFIG)