diff options
-rw-r--r-- | .SRCINFO | 30 | ||||
-rw-r--r-- | PKGBUILD | 60 | ||||
-rw-r--r-- | hbmame.sh | 52 |
3 files changed, 142 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..cdd5b2fa7924 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,30 @@ +pkgbase = hbmame + pkgdesc = A port of the popular Multiple Arcade Machine Emulator using SDL with OpenGL support. + pkgver = 0.221 + pkgrel = 1 + url = https://mamedev.org/ + arch = x86_64 + license = GPL2 + makedepends = nasm + makedepends = python + makedepends = asio + makedepends = rapidjson + makedepends = glm + makedepends = libxinerama + depends = sdl2_ttf + depends = qt5-base + depends = lua + depends = libutf8proc + depends = pugixml + depends = portmidi + depends = portaudio + depends = flac + conflicts = sdlmame + replaces = sdlmame + source = https://github.com/Robbbert/hbmame/archive/tag221.tar.gz + source = hbmame.sh + sha256sums = SKIP + sha256sums = SKIP + +pkgname = hbmame + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..4deef4d23773 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,60 @@ +# Maintainer: fuzzbop <d34dh4ck@gmail.com> +# Contributor: Antonio Rojas <arojas@archlinux.org> +# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Contributor: robb_force <robb_force@holybuffalo.net> +# Contributor: JJDaNiMoTh <jjdanimoth@gmail.com> + +# I basically just lifted the main MAME PKGBUILD and .sh and edited it for HBMAME +# also not building tools since you most likely have MAME installed as well + +pkgname=hbmame +pkgver=0.221 +pkgrel=1 +pkgdesc="A port of the popular Multiple Arcade Machine Emulator using SDL with OpenGL support." +url="https://mamedev.org/" +license=(GPL2) +arch=(x86_64) +depends=(sdl2_ttf qt5-base lua libutf8proc pugixml portmidi portaudio flac) +makedepends=(nasm python asio rapidjson glm libxinerama) +conflicts=(sdlmame) +replaces=(sdlmame) +source=("https://github.com/Robbbert/hbmame/archive/tag${pkgver:2}.tar.gz" hbmame.sh) +sha256sums=('SKIP' + 'SKIP') + + +prepare() { + + cd hbmame-tag${pkgver:2} + + # Use system libraries + sed -e 's|\# USE_SYSTEM_LIB|USE_SYSTEM_LIB|g' -i makefile +} + +build() { + + cd hbmame-tag${pkgver:2} + + # Build HBMAME + make \ + NOWERROR=1 \ + OPTIMIZE=2 \ + TOOLS=0 \ + USE_SYSTEM_LIB_ASIO=0 \ + ARCHOPTS=-flifetime-dse=1 \ + TARGET=hbmame +} + +package() { + cd hbmame-tag${pkgver:2} + + # Install the hbmame script + install -Dm755 "$srcdir"/$pkgname.sh "$pkgdir"/usr/bin/$pkgname + + # Install the binaries + install -Dm755 hbmame64 "$pkgdir"/usr/lib/hbmame/hbmame + + # Install the extra bits + install -Dm644 src/osd/modules/opengl/shader/glsl*.*h -t "$pkgdir"/usr/lib/$pkgname/shader/ + cp -ar {artwork,bgfx,plugins,language,ctrlr,keymaps,hash} "$pkgdir"/usr/lib/$pkgname/ +} diff --git a/hbmame.sh b/hbmame.sh new file mode 100644 index 000000000000..73b2c2ef4190 --- /dev/null +++ b/hbmame.sh @@ -0,0 +1,52 @@ +#!/bin/sh +hbmamelib=/usr/lib/hbmame/ + +mame_first_run() { + echo "Creating an ini file for HBMAME at $HOME/.hbmame/hbmame.ini" + echo "Modify this file for permanent changes to your MAME" + echo "options and paths before running MAME again." + + cd -- ~/.hbmame || exit + + if [ -e hbmame.ini ]; then + mv hbmame.ini hbmameini.bak || exit + echo "Your old ini file has been renamed to hbmameini.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. + "$hbmame" \ + -artpath '$HOME/.hbmame/artwork;artwork' \ + -ctrlrpath '$HOME/.hbmame/ctrlr;ctrlr' \ + -inipath '$HOME/.hbmame/ini' \ + -rompath '$HOME/.hbmame/roms' \ + -samplepath '$HOME/.hbmame/samples' \ + -cfg_directory '$HOME/.hbmame/cfg' \ + -comment_directory '$HOME/.hbmame/comments' \ + -diff_directory '$HOME/.hbmame/diff' \ + -input_directory '$HOME/.hbmame/inp' \ + -nvram_directory '$HOME/.hbmame/nvram' \ + -snapshot_directory '$HOME/.hbmame/snap' \ + -state_directory '$HOME/.hbmame/sta' \ + -video opengl \ + -createconfig +} + +if [ "$1" = "--newini" ]; then + mame_first_run + exit +elif ! [ -e ~/.hbmame ]; then + echo "Running MAME for the first time..." + + mkdir -- ~/.hbmame + ( + cd -- ~/.hbmame || exit + mkdir artwork cfg comments ctrlr diff ini inp nvram samples snap sta roms + + mame_first_run + ) || exit +fi + +cd "$hbmamelib" +exec ./hbmame "$@" |