Mail archive
alpine-aports

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

From: Natanael Copa <ncopa_at_alpinelinux.org>
Date: Thu, 19 Apr 2018 15:47:18 +0200

On Mon, 16 Apr 2018 21:29:36 +0300
Taner Tas <taner76_at_gmail.com> wrote:

> http://mamedev.org
> Multi Arcade Machine Emulator.
> ---
> testing/mame/APKBUILD | 165 +++++++++++++++++++++++++++++
> testing/mame/fix-musl.patch | 21 ++++
> testing/mame/m68000_archopts.patch | 17 +++
> testing/mame/mame.ini | 61 +++++++++++
> testing/mame/midi.conf | 1 +
> testing/mame/musl-time_t.patch | 10 ++
> 6 files changed, 275 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
> create mode 100644 testing/mame/musl-time_t.patch
>
> diff --git a/testing/mame/APKBUILD b/testing/mame/APKBUILD
> new file mode 100644
> index 00000000..618f8513
> --- /dev/null
> +++ b/testing/mame/APKBUILD
> _at_@ -0,0 +1,165 @@
> +# 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"
> +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

Is it necessary to extract it with 7z? I though abuild will extract .zip for us.

> + 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++

Does it require clang? Can it not be built with gcc?

> + 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 ;;
> + 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
> + 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() {
> + depends="$pkgname-common"

I think the depends need to be in global scope.

> + cd "$builddir"
> + install -D -m755 mame "$pkgdir"/usr/bin/mame || install -D -m755 mame64 "$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 mamearcade "$subpkgdir"/usr/bin/mamearcade || install -D -m755 mamearcade64 "$subpkgdir"/usr/bin/mamearcade
> +}
> +
> +mess() {
> + pkgdesc="Multi Arcade Machine Emulator - Mess specific build."
> + depends="$pkgname-common"
> + 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/"$pakgname"

pakgname looks like a typo.

> + 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"

pakgname looks like a typo

> + 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() {

Normally we install the files in $pkgdir from package() and let the
default doc function move and compress the manpages to the -doc
subpackage.

> + 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="dfff1f1d0c8fd11e49a0d4d554a229e13c3e10fcb90da54c8b4945bc05ebe936ad31ed96cd5c320a831500db58a48f7ea25b97312f29c94c970c808e64af595d mame0196s.zip
> +b05e953b7c4be26eaa4ab192279fa62dd2b006069cd963e997295afe6e64b3ba04e5a257c69b008d5bc4b509274646d10b9499970b5c3c36cc86fb4ce18f9266 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 00000000..cda91419
> --- /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 00000000..46fd4a66
> --- /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 00000000..795634a8
> --- /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 00000000..30a86650
> --- /dev/null
> +++ b/testing/mame/midi.conf
> _at_@ -0,0 +1 @@
> +snd_virmidi
> diff --git a/testing/mame/musl-time_t.patch b/testing/mame/musl-time_t.patch
> new file mode 100644
> index 00000000..02c11cf0
> --- /dev/null
> +++ b/testing/mame/musl-time_t.patch
> _at_@ -0,0 +1,10 @@
> +--- 3rdparty/bx/include/bx/bx.h 2017-12-27 02:45:37.000000000 +0100
> ++++ 3rdparty/bx/include/bx/bx.h 2017-12-28 10:58:30.254932880 +0100
> +_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"



---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Thu Apr 19 2018 - 15:47:18 GMT