1 # Contributor: Themaister <maister@archlinux.us>
7 pkgdesc="A library that exposes the core emulation of BSNES, a Super Nintendo Entertainment System (SNES) emulator."
9 url="http://byuu.org/bsnes/"
12 makedepends=('pkgconfig')
13 replaces=('snesreader' 'supergameboy')
15 source=("http://bsnes.googlecode.com/files/${_pkgbase}_v${_pkgver}-source.tar.bz2"
17 md5sums=('a1f017f5276ec5be0bc553db2b7e2241'
18 '710a534fb8a217b93ac688b77b234f1d')
22 cd "${srcdir}/bsnes_v${_pkgver}-source/bsnes"
23 patch -p1 < ${srcdir}/libco.patch
25 FLAGS="-O3 -march=native -mtune=native -fomit-frame-pointer -I. -Isnes -fPIC"
29 # Building the 3 profiles
32 echo "==============================="
33 echo "## Building Accuracy core"
34 echo "==============================="
36 make compiler="$COMPILER" flags="$FLAGS -DPROFILE_ACCURACY" profile=accuracy ui=ui-libsnes || return 1
37 mv out/libsnes.so out/libsnes-accuracy.so || return 1
38 make clean || return 1
41 echo "==============================="
42 echo "## Building Compatibility core"
43 echo "==============================="
45 make compiler="$COMPILER" flags="$FLAGS -DPROFILE_COMPATIBILITY" profile=compatibility ui=ui-libsnes || return 1
46 mv out/libsnes.so out/libsnes-compat.so || return 1
47 make clean || return 1
50 echo "==============================="
51 echo "## Building Performance core"
52 echo "==============================="
55 make compiler="$COMPILER" flags="$FLAGS -DPROFILE_PERFORMANCE" profile=performance ui=ui-libsnes || return 1
56 mv out/libsnes.so out/libsnes-performance.so || return 1
61 cd "${srcdir}/bsnes_v${_pkgver}-source/bsnes"
63 mkdir -p ${pkgdir}/usr/{lib,include} || return 1
64 install -m755 out/libsnes-{performance,compat,accuracy}.so ${pkgdir}/usr/lib || return 1
66 # Add symlink to default "compat" profile
67 ln -s libsnes-compat.so ${pkgdir}/usr/lib/libsnes.so || return 1
68 ln -s libsnes-compat.so ${pkgdir}/usr/lib/libsnes.so.1 || return 1
70 install -m644 ui-libsnes/libsnes.hpp ${pkgdir}/usr/include/ || return 1