1 # Contributor: [wisp558] <wisp558@gmail.com>
5 pkgdesc="Super Nintendo Entertainment System (SNES) emulator focused on accuracy, with a minimalistic GTK based user interface."
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')
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"
22 # Disable extraneous audio drivers.
23 sed -e 's|audio.pulseaudio ||' \
24 -e 's|audio.pulseaudiosimple ||' \
25 -e 's|audio.openal ||' \
27 -i "${srcdir}/bsnes_v081-source/bsnes/ui/Makefile" || return 1
29 sed -e 's|gconftool-2 --type bool|#gconftool-2 --type bool|' \
30 -i "${srcdir}/bsnes_v081-source/bsnes/Makefile" || return 1
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}"
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}
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
50 # Now lets build and install the plugins, you can remove any of the below if
51 # you don't want/need them.
53 # snesfilter :: output filters
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
63 # snesreader :: handle compressed files
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
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"
77 msg "Building snespurify"
78 cd "${srcdir}/bsnes_v081-source/snespurify"
79 sed -e 's|g++-4.5|g++|' -i ./cc-gtk.sh
81 install -m755 "${srcdir}/bsnes_v081-source/snespurify/snespurify-gtk" "${pkgdir}/usr/bin/snespurify-gtk"