void-packages/srcpkgs/sdlmame/template
2015-05-04 06:08:23 +02:00

99 lines
3 KiB
Bash

# Template file for 'mame'
pkgname=sdlmame
_distver=0161
_patchver=0
version=${_distver}u${_patchver}
revision=2
wrksrc="mame-${_distver}s"
homepage="http://mamedev.org"
distfiles="${homepage}/downloader.php?file=releases/mame${_distver}s.zip"
short_desc="The Multiple Arcade Machine Emulator"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="mame"
checksum=c0ba4c8e6ea7a491cbf7b317221d03c916dee53ca3cde4ff26adbc478a395a0f
hostmakedepends="unzip perl pkg-config python automoc4"
makedepends="SDL2_ttf-devel fontconfig-devel libXinerama-devel qt-devel alsa-lib-devel lua-devel"
depends="liberation-fonts-ttf"
repository="nonfree"
nocross=yes
do_extract() {
# mame source code is double-zipped to save space.
cd ${wrksrc}
unzip -q ${XBPS_SRCDISTDIR}/${pkgname}-${version}/$(basename $distfiles)
unzip -q mame.zip
rm -f mame.zip
find . -type f -not -name \*.png -print0 | xargs -0 perl -pi -e 's/\r\n?/\n/g'
# Download and apply released patches.
for p in $(seq -w 1 ${_patchver}); do
_patch=${_distver}u${p}
msg_normal "Fetching patch: ${_patch} ...\n"
${XBPS_FETCH_CMD} ${homepage}/updates/${_patch}_diff.zip
msg_normal "Applying patch: ${_patch} ...\n"
unzip -q ${_patch}_diff.zip
patch -p0 -E -i ${_patch}.diff
rm -f ${_patch}_diff
done
}
do_build() {
# REGENIE=1 rebuild genie binary and dependencies
# TOOLS=1 replaces target tools
make REGENIE=1 NOWERROR=1 TOOLS=1 ${makejobs}
}
do_install() {
# Install the sdlmame script
vbin ${FILESDIR}/${pkgname}.sh ${pkgname}
# Install the applications and the UI font in /usr/share
if [ -r mame64 ]; then
vinstall mame64 755 usr/share/${pkgname} ${pkgname}
else
vinstall mame 755 usr/share/${pkgname} ${pkgname}
fi
for f in chdman jedutil regrep romcmp testkeys src2html srcclean \
ldverify ldresample unidasm; do
vinstall ${f} 755 usr/share/${pkgname}
if [ -f src/osd/sdl/man/${f}.1 ]; then
vman src/osd/sdl/man/${f}.1
fi
done
vman src/osd/sdl/man/mame.6
# Install the extra bits
install -d ${DESTDIR}/usr/share/${pkgname}/{artwork,ctrlr,keymaps,shader}
install -m644 src/osd/modules/opengl/shader/glsl*.*h \
${DESTDIR}/usr/share/${pkgname}/shader
install -m644 artwork/* ${DESTDIR}/usr/share/${pkgname}/artwork
install -m644 src/osd/sdl/keymaps/* \
${DESTDIR}/usr/share/${pkgname}/keymaps
# Include the license
vlicense docs/license.txt LICENSE
}
sdlmess_package() {
depends="sdlmame-${version}_${revision}"
short_desc+=" - Multi Emulator Super System (MESS)"
pkg_install() {
make TARGET=mess NOWERROR=1 TOOLS=1 ${makejobs}
# Install the application
vmkdir usr/share/${pkgname}
if [ -r mess64 ]; then
vinstall mess64 755 usr/share/${pkgname} ${pkgname}
else
vinstall mess 755 usr/share/${pkgname} ${pkgname}
fi
# Install MESS specific tools and man pages
for f in castool floptool imgtool; do
vinstall $f 755 usr/share/${pkgname}
vman src/osd/sdl/man/$f.1
done
vman src/osd/sdl/man/mess.6
# Install the sdlmess script
vbin ${FILESDIR}/${pkgname}.sh ${pkgname}
}
}