updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / bsnes-phoenix / PKGBUILD
blobf97e3ae1089b07617d5a7cc77ffe0821d98a0f7a
1 # Contributor: [wisp558] <wisp558@gmail.com>
2 pkgname=bsnes-phoenix
3 pkgver=0.081
4 pkgrel=1
5 pkgdesc="Super Nintendo Entertainment System (SNES) emulator focused on accuracy, with a minimalistic GTK based user interface."
6 arch=('i686' 'x86_64')
7 url="http://byuu.org/bsnes/"
8 license=('GPL2' 'LGPL') # The phoenix port doesn't support archived roms.
9 depends=('libgl' 'libxv' 'sdl' 'gtk2')
10 makedepends=('pkgconfig' 'mesa')
11 replaces=('supergameboy' 'bsnes')
12 source=("http://bsnes.googlecode.com/files/bsnes_v081-source.tar.bz2")
13 md5sums=('860d4ba0a00ddc0aaf59d31af54661f3')
15 build() {
16   cd "${srcdir}/bsnes_v081-source/bsnes"
18   # Build fixes for GCC 4.6.0
19   #patch -p0 < "${srcdir}/gcc_4.6.0_build_fix.patch"
21   # Makefile hacks
22   # Disable extraneous audio drivers.
23   sed -e 's|audio.pulseaudio ||' \
24       -e 's|audio.pulseaudiosimple ||' \
25       -e 's|audio.openal ||' \
26       -e 's|audio.ao||' \
27       -i "${srcdir}/bsnes_v081-source/bsnes/ui/Makefile" || return 1
28   # Don't run gconftool
29   sed -e 's|gconftool-2 --type bool|#gconftool-2 --type bool|' \
30       -i "${srcdir}/bsnes_v081-source/bsnes/Makefile" || return 1
31   # Force phoenix-gtk
32   sed -e 's|# phoenix := gtk|phoenix := gtk|' \
33       -i "${srcdir}/bsnes_v081-source/bsnes/Makefile" || return 1
36   # Build the different profiles and install them
37   for profile in compatibility performance accuracy; do
38     msg "Building profile: ${profile}"
39     make clean
40     make compiler=gcc platform=x profile=${profile} || return 1
41     make install profile=${profile} DESTDIR=${pkgdir} prefix=/usr || return 1
42     mv ${pkgdir}/usr/bin/bsnes ${pkgdir}/usr/bin/bsnes-${profile}
43   done
45   # The phoenix port has no launcher, so I set a symbolic link of bsnes to point to the compatibility profile.
46   msg "Linking default profile..."
47   ln -s ${pkgdir}/usr/bin/bsnes-compatibility ${pkgdir}/usr/bin/bsnes
49   ##
50   # Now lets build and install the plugins, you can remove any of the below if
51   # you don't want/need them.
52   ##
53   # snesfilter :: output filters
54   ##
55   # msg "Building plugin: snesfilter"
56   # cd "${srcdir}/snesfilter"
57   # sed -e 's|\(libsnesfilter.*\) $(DESTDIR)$(prefix)/lib|\1 $(DESTDIR)$(prefix)/lib/\1|' \
58   #    -i "${srcdir}/snesfilter/Makefile" || return 1
59   # make compiler=gcc || return 1
60   # make install DESTDIR=${pkgdir} prefix=/usr || return 1
61   # chmod 644 "${pkgdir}/usr/lib/libsnesfilter.a" || return 1
62   ##
63   # snesreader :: handle compressed files
64   ##
65   #msg "Building plugin: snesreader"
66   #cd "${srcdir}/snesreader"
67   #sed -e 's|\(libsnesreader.*\) $(DESTDIR)$(prefix)/lib|\1 $(DESTDIR)$(prefix)/lib/\1|' -i "${srcdir}/snesreader/Makefile" || return 1
68   # make compiler=gcc || return 1
69   # make install DESTDIR=${pkgdir} prefix=/usr || return 1
70   # chmod 644 "${pkgdir}/usr/lib/libsnesreader.a" || return 1
71   # Licenses
72   # mkdir -p "${pkgdir}/usr/share/licenses/bsnes"
73   # install -m644 "${srcdir}/snesreader/7z_C/lzma.txt" "${pkgdir}/usr/share/licenses/bsnes/license-7zip.txt"
74   # install -m644 "${srcdir}/snesreader/unrar/license.txt" "${pkgdir}/usr/share/licenses/bsnes/license-unrar.txt"
75   ##
77   msg "Building snespurify"
78   cd "${srcdir}/bsnes_v081-source/snespurify"
79   sed -e 's|g++-4.5|g++|' -i ./cc-gtk.sh
80   sh ./cc-gtk.sh
81   install -m755 "${srcdir}/bsnes_v081-source/snespurify/snespurify-gtk" "${pkgdir}/usr/bin/snespurify-gtk"