updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / bsnes / PKGBUILD
blob5393bb3856ebdbf8c2403de27adc56f90850801a
1 # Contributor: [vEX] <niechift.dot.vex.at.gmail.dot.com>
2 pkgname='bsnes'
3 # Fool AUR since it doesn't support split PKGBUILDS (shamelessly stolen from kernel26-git PKGBUILD).
4 (( 1 )) && pkgname=('bsnes' 'snespurify')
5 pkgver=085
6 pkgrel=1
7 pkgdesc="Super Nintendo Entertainment System (SNES) emulator focused on accuracy."
8 arch=('i686' 'x86_64')
9 url="http://byuu.org/bsnes/"
10 license=('GPL3')
11 depends=('libao' 'libgl' 'libxv' 'openal' 'sdl' 'qt>=4.7.0')
12 makedepends=('pkgconfig' 'mesa')
13 source=('http://bsnes.googlecode.com/files/bsnes_v085-source.tar.bz2' 'add-usr-share-fallback.patch')
14 md5sums=('2419710087ba28c894e5aa1c3c41b6e7' '032e01298f3034ad621522e771fd9fa9')
16 # Build the accuracy profile (you can also choose 'performance' or 'compatibility')
17 __profile='accuracy'
19 build() {
20   cd "${srcdir}/${pkgname}_v${pkgver}-source/${pkgname}"
22   # Makefile hacks:
23   # Disable pulseaudio.
24   sed -e 's|audio.pulseaudio ||' \
25       -e 's|audio.pulseaudiosimple ||' \
26       -i 'ui/Makefile'
27   # Don't copy the cheat file.
28   sed -e '/mkdir -p ~\/.config\/$(name)/{d}' \
29       -e '/cp data\/cheats.xml/{N;d}' \
30       -i 'ui/Makefile'
32   # Apply patch to make bsnes look in /usr/share/bsnes for filters/shaders.
33   patch -p0 < "${srcdir}/add-usr-share-fallback.patch"
35   # Fix building with QT 4.8.0.
36   moc -i -Iphoenix/qt/ -o phoenix/qt/platform.moc phoenix/qt/platform.moc.hpp
38   # Compile bsnes.
39   make flags="$CXXFLAGS -I. -DPROFILE_${__profile^^}" compiler=gcc platform=x profile=${__profile} phoenix=qt
41   # Compile the filters.
42   cd "${srcdir}/${pkgname}_v${pkgver}-source/snesfilter"
43   make compiler=gcc platform=x
45   # Compile snespurify.
46   cd "${srcdir}/${pkgname}_v${pkgver}-source/snespurify"
47   sed -e 's|g++-4.5|g++|' -i cc-gtk.sh
48   ./cc-gtk.sh
51 package_snespurify() {
52   pkgver=011
53   pkgrel=1
54   pkgdesc='Utility to clean game files so they are compatible with bsnes.'
55   depends=('gtk2')
57   cd "${srcdir}/bsnes_v085-source/${pkgname}"
58   install -D --mode 755 snespurify-gtk "${pkgdir}/usr/bin/snespurify-gtk"
61 package_bsnes() {
62   pkgver=085
63   pkgrel=1
64   pkgdesc="Super Nintendo Entertainment System (SNES) emulator focused on accuracy."
65   changelog='bsnes.changelog'
66   depends=('libao' 'libgl' 'libxv' 'openal' 'sdl' 'qt>=4.7.0')
68   cd "${srcdir}/${pkgname}_v${pkgver}-source/${pkgname}"
69   make install profile=${__profile} DESTDIR="${pkgdir}" prefix=/usr
71   # Install the filters/shaders
72   install --directory "${pkgdir}/usr/share/${pkgname}/filters"
73   install -D --mode=644 "${srcdir}/${pkgname}_v${pkgver}-source"/snesfilter/out/*.filter "${pkgdir}/usr/share/${pkgname}/filters"
74   install --directory "${pkgdir}/usr/share/${pkgname}/shaders"
75   install -D --mode=644 "${srcdir}/${pkgname}_v${pkgver}-source"/snesshader/*.shader "${pkgdir}/usr/share/${pkgname}/shaders"