PKGBUILDs/community/sdlmame/PKGBUILD
2018-02-28 20:36:29 +00:00

92 lines
3.5 KiB
Bash

# $Id$
# Maintainer: 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>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - install 'mame' instead of 'mame64'
highmem=1
pkgname=sdlmame
pkgver=0.195
pkgrel=2
pkgdesc="A port of the popular Multiple Arcade Machine Emulator using SDL with OpenGL support."
url="http://mamedev.org/"
license=(GPL2)
arch=(x86_64)
depends=(sdl2_ttf alsa-lib qt5-base)
makedepends=(nasm mesa python2 libxinerama)
source=("https://github.com/mamedev/mame/archive/mame${pkgver/./}.tar.gz"
"sdlmame.sh"
"extras.tar.gz")
sha256sums=('b18d0e23ecf6b218c43a6770213c850b3c605ead9d29301de34101ed14c28a57'
'06e7f5dca2255a16b3336a6d2b9af8276a8d8c672635aed83e9e8f636db3cef7'
'5ba55ce8c33743207a12a7509efdf13dd98f5d87fa12f0e471ea523d3ae4f4ac')
build() {
cd mame-mame${pkgver/./}
make \
NOWERROR=1 \
OPTIMIZE=2 \
PYTHON_EXECUTABLE=/usr/bin/python2 \
TOOLS=1 \
ARCHOPTS=-flifetime-dse=1
}
package() {
cd mame-mame${pkgver/./}
# Install the sdlmame script
install -Dm755 "$srcdir"/$pkgname.sh "$pkgdir"/usr/bin/$pkgname
# Install the applications and the UI font in /usr/share
install -Dm755 mame "$pkgdir"/usr/lib/$pkgname/$pkgname || \
install -Dm755 mame64 "$pkgdir"/usr/lib/$pkgname/$pkgname
install -m755 chdman "$pkgdir"/usr/lib/$pkgname/chdman
install -m755 jedutil "$pkgdir"/usr/lib/$pkgname/jedutil
install -m755 regrep "$pkgdir"/usr/lib/$pkgname/regrep
install -m755 romcmp "$pkgdir"/usr/lib/$pkgname/romcmp
install -m755 src2html "$pkgdir"/usr/lib/$pkgname/src2html
install -m755 srcclean "$pkgdir"/usr/lib/$pkgname/srcclean
install -m755 ldverify "$pkgdir"/usr/lib/$pkgname/ldverify
install -m755 ldresample "$pkgdir"/usr/lib/$pkgname/ldresample
# ln binaries
install -dm755 "$pkgdir"/usr/share/$pkgname
for i in $pkgname chdman jedutil regrep romcmp src2html srcclean ldverify ldresample; do
ln -s /usr/lib/$pkgname/$i "$pkgdir"/usr/share/$pkgname/$i
done
# Install the extra bits
install -d "$pkgdir"/usr/share/$pkgname/{artwork,ctrlr,hash,keymaps,shader}
install -d "$pkgdir"/usr/share/man/man1
install -d "$pkgdir"/usr/share/man/man6
install -m644 src/osd/modules/opengl/shader/glsl*.*h "$pkgdir"/usr/share/$pkgname/shader/
install -m644 docs/man/*.1* "$pkgdir"/usr/share/man/man1/
install -m644 docs/man/*.6* "$pkgdir"/usr/share/man/man6/
cp -a "$srcdir"/artwork/* "$pkgdir"/usr/share/$pkgname/artwork/
install -m644 "$srcdir"/ctrlr/* "$pkgdir"/usr/share/$pkgname/ctrlr/
install -m644 keymaps/* "$pkgdir"/usr/share/$pkgname/keymaps/
install -m644 hash/* "$pkgdir"/usr/share/$pkgname/hash/
cp -a bgfx "$pkgdir"/usr/share/$pkgname/bgfx
cp -a plugins "$pkgdir"/usr/share/$pkgname/plugins
cp -a language "$pkgdir"/usr/share/$pkgname/language
# Include the license
install -Dm644 docs/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
# FS#28203
sed -i 's|KEYCODE_2_PAD|KEYCODE_2PAD|' "$pkgdir"/usr/share/sdlmame/ctrlr/*.cfg
sed -i 's|KEYCODE_4_PAD|KEYCODE_4PAD|' "$pkgdir"/usr/share/sdlmame/ctrlr/*.cfg
sed -i 's|KEYCODE_6_PAD|KEYCODE_6PAD|' "$pkgdir"/usr/share/sdlmame/ctrlr/*.cfg
sed -i 's|KEYCODE_8_PAD|KEYCODE_8PAD|' "$pkgdir"/usr/share/sdlmame/ctrlr/*.cfg
# documentation
install -dm0755 "$pkgdir"/usr/share/doc
cp -a docs "$pkgdir"/usr/share/doc/$pkgname
rm -r "$pkgdir"/usr/share/doc/$pkgname/man
}