void-packages/srcpkgs/mame/template
2017-12-28 13:31:38 +01:00

104 lines
2.7 KiB
Bash

# Template file for 'mame'
pkgname=mame
version=0193
revision=1
wrksrc="mame-mame${version}"
homepage="http://mamedev.org"
distfiles="https://github.com/mamedev/mame/archive/mame${version}.tar.gz"
short_desc="The Multiple Arcade Machine Emulator"
maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
license="GPL-2"
checksum=6b5e90b602befbcad2b6989b1e930d0ff6e537dc901f7b1615a3e6deec2207a2
hostmakedepends="perl pkg-config python automoc4"
makedepends="libstdc++-devel SDL2_ttf-devel $(vopt_if qt qt5-devel) lua-devel
libjpeg-turbo-devel libflac-devel libuv-devel sqlite-devel portaudio-devel portmidi-devel"
depends="liberation-fonts-ttf"
nocross=yes
replaces="sdlmame>=0 sdlmess>=0"
CXXFLAGS="-I${XBPS_CROSS_BASE}/usr/include/lua5.3"
case "$XBPS_TARGET_MACHINE" in
*-musl) CXXFLAGS+=" -DBX_CRT_MUSL=1"
;;
i686*) # was: nodebug=yes
broken="https://build.voidlinux.eu/builders/i686_builder/builds/2964/steps/shell_3/logs/stdio"
;;
esac
build_options="qt"
if [ -z "$CROSS_BUILD" ]; then
build_options_default="qt"
fi
do_build() {
local opts="REGENIE=1"
opts+=" TARGETOS=linux"
case "$XBPS_TARGET_MACHINE" in
x86_64*|aarch64*) opts+=" PTR64=1" ;;
esac
opts+=" NOWERROR=1"
opts+=" VERBOSE=1"
opts+=" OPTIMIZE=3"
opts+=" PRECOMPILE=0"
opts+=" TOOLS=1"
opts+=" USE_SYSTEM_LIB_EXPAT=1"
opts+=" USE_SYSTEM_LIB_ZLIB=1"
opts+=" USE_SYSTEM_LIB_JPEG=1"
opts+=" USE_SYSTEM_LIB_FLAC=1"
opts+=" USE_SYSTEM_LIB_LUA=1"
opts+=" USE_SYSTEM_LIB_SQLITE3=1"
opts+=" USE_SYSTEM_LIB_PORTMIDI=1"
opts+=" USE_SYSTEM_LIB_PORTAUDIO=1"
# opts+=" USE_SYSTEM_LIB_UTF8PROC=1"
if [ "$build_option_qt" ]; then
opts+=" USE_QTDEBUG=1"
fi
if [ "${CROSS_BUILD}" ]; then
# Doesn't work yet
opts+=" CROSS_BUILD=1 OVERRIDE_CC=${CC} OVERRIDE_CXX=${CXX} OVERRIDE_LD=${CC}"
fi
case "$XBPS_TARGET_MACHINE" in
i686*) # Overcome linker memory exhaustion
opts+=" SYMBOLS=0"
;;
esac
make ${opts} ${makejobs}
}
do_install() {
local f
# Install the mame script
vbin ${FILESDIR}/${pkgname}.sh ${pkgname}
# Install the main application(s)
for f in mame mame64 mamearcade mamearcade64; do
if [ -r ${f} ]; then
vinstall ${f} 755 usr/share/${pkgname} mame
fi
done
for f in mess mess64; do
if [ -r ${f} ]; then
vinstall ${f} 755 usr/share/${pkgname} mess
fi
done
# Install the tools
for f in chdman jedutil regrep pngcmp romcmp src2html srcclean \
ldverify ldresample unidasm castool floptool imgtool; do
vinstall ${f} 755 usr/share/${pkgname}
if [ -f docs/man/${f}.1 ]; then
vman docs/man/${f}.1
fi
done
for f in mame mess; do
if [ -r docs/man/${f}.6 ]; then
vman docs/man/${f}.6
fi
done
# Install the extra bits
for f in artwork bgfx docs hash hlsl keymaps plugins samples; do
vcopy ${f} usr/share/${pkgname}
done
}