# Contributor: August Klein # Maintainer: August Klein pkgname=mednafen pkgver=0.9.38.4 pkgrel=0 pkgdesc="A command-line multi-system emulator" url="http://mednafen.sourceforge.net" arch="all" license="GPL2" depends="" depends_dev="alsa-lib-dev libsndfile-dev sdl-dev zlib-dev" makedepends="$depends_dev mesa-dev glu-dev paxmark" install="" subpackages="$pkgname-lang" source="https://prdownloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2 01-fix_help.patch 02-sdl_by_default.patch 03-fix_textrels.patch 04-fix_x86_inline_asm.patch " _builddir="$srcdir"/$pkgname prepare() { local i cd "$_builddir" update_config_sub || return 1 for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done } build() { cd "$_builddir" ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr || return 1 make || return 1 } package() { cd "$_builddir" make DESTDIR="$pkgdir" install || return 1 rm -rf "$pkgdir"/usr/lib/charset.alias mv -f "$pkgdir"/usr/bin/mednafen "$pkgdir"/usr/bin/mednafen-bin || return 1 libgl=$(scanelf -qF '#F%S' /usr/lib/libGL.so) cat > "$pkgdir"/usr/bin/mednafen << __EOF__ #!/bin/sh # as a workaround for libGL's initial-exec TLS we preload libgl # https://bugs.freedesktop.org/show_bug.cgi?id=35268 LD_PRELOAD=$libgl exec /usr/bin/mednafen-bin "\$@" __EOF__ chmod 755 "$pkgdir"/usr/bin/mednafen paxmark -m "$pkgdir"/usr/bin/mednafen-bin } md5sums="c7d8539d044466f3884b49fc9a68a099 mednafen-0.9.38.4.tar.bz2 259d9396e292b0446f3837799c3ff091 01-fix_help.patch fe551992f13f1cfe44fde9a96f5fd0b2 02-sdl_by_default.patch 554494930528cbb4881c85e043e17827 03-fix_textrels.patch 7c5210fdc196e79b9f73637ec306b5ad 04-fix_x86_inline_asm.patch" sha256sums="3298e2d5c03efbe638c2a98bf74435e306768461c65d2bb9b9a95e99dc463105 mednafen-0.9.38.4.tar.bz2 511509758cd80cb2472bc95a8c790ae69565869a081a6d70acffb5d57c6c4b4a 01-fix_help.patch 3fd7154caaf00c6f58b912a24d396503d817fbb2cfdea1550f7dd9dea69d4664 02-sdl_by_default.patch a9990e59a91f330dc2cc3b069545629b1907dba92bd0760a8e8b89be1a73eed2 03-fix_textrels.patch d8524b5afa22ba09f03578c1bc49ea7763bf22492ea6d8670b83bdd96af09cae 04-fix_x86_inline_asm.patch" sha512sums="3eb19a10e97cd285387fcf86eae09f550d248ab9c070750b1c0af0f334cce47ea375227df72cf7cdbc2193b311bab5e09108388a15634f694ef398b1a77ac3df mednafen-0.9.38.4.tar.bz2 80e549698687fbe61021ccf964979bb83243ba86d5651fb648ca134822b6b0147c79d0491d076cdfbd579236b5e9db314fcda6d0df46b17a4e856e3677314c56 01-fix_help.patch 856d16f4c044c3787abdd3d65c6b72b6e42c88d7195f097cb6767fde6e0027d756cacc1fd54279a90a6a1bd164cecb8baaf1ff66787ca38d64bdd3eb6583738b 02-sdl_by_default.patch 797a4e0d5a768a9052b226d9395d9d03d3c59a6faf67958e09169d1e603fc59f468a68e958d60661b03ff4faf0b0275d66559f517efdfd523f07eb03618cb620 03-fix_textrels.patch 424a6727117f4e0ad022b2fe2726a85c43a8a529770e74dada7e7810a6542741c0a2f7ad767e0d0471c5201c26242ab5380b7c82d25f74aa533c4508ded71811 04-fix_x86_inline_asm.patch"