updated on Thu Jan 19 16:10:29 UTC 2012
[aur-mirror.git] / bsnes-aio / PKGBUILD
blobb9d258474f93e3a1b4da6b41bc8123f1fbfa10b8
1 # Maintainer : Alucryd <alucryd at gmail dot com>
2 # Thx vEX for the Qt 4.8.0 fix
3 pkgname=bsnes-aio
4 pkgver=085
5 pkgrel=4
6 pkgdesc="SNES emulator focused on accuracy, debugging functionality, and clean code. Includes snespurify, bps, filters, shaders and cheats database."
7 arch=('i686' 'x86_64')
8 url="http://byuu.org/bsnes/"
9 license=('GPL3')
10 depends=('gtk2' 'qt>=4.7.0' 'pulseaudio' 'libao' 'libgl' 'libxv' 'openal' 'sdl')
11 makedepends=('mesa')
12 source=('http://bsnes.googlecode.com/files/bsnes_v085-source.tar.bz2' 'http://byuu.org/files/bps_v03.tar.bz2')
13 md5sums=('2419710087ba28c894e5aa1c3c41b6e7' '65c425a5843556bef6f333c4084af8c6')
14 provides=('bsnes' 'snespurify' 'bps')
15 conflicts=('bsnes' 'snesfilter')
17 build() {
18     # Filters/Shaders fix
19     cd "${srcdir}/bsnes_v$pkgver-source/bsnes/ui/general"
20     sed -i 's/application->basepath/"\/usr\/share\/bsnes\/"/g' main-window.cpp
22     # Cheats fix
23     cd "${srcdir}/bsnes_v$pkgver-source/bsnes/ui/tools"
24     sed -i 's/application->path("cheats.xml")/"\/usr\/share\/bsnes\/cheats.xml"/g' cheat-database.cpp
26     # Profile
27     cd "${srcdir}/bsnes_v$pkgver-source/bsnes"
28     msg "Please select a version"
29     select bp in "Accuracy (Slower)" "Compatibility" "Performance (Faster)"; do
30         case $bp in
31             "Accuracy (Slower)" ) msg "Building the accuracy version..."; break;;
32             "Compatibility" ) sed -i 's/accuracy/compatibility/g' Makefile && msg "Building the compatibility version..."; break;;
33             "Performance (Faster)" ) sed -i 's/accuracy/performance/g' Makefile && msg "Building the performance version..."; break;;
34         esac
35     done
37     # Compile bsnes
38     cd "${srcdir}/bsnes_v$pkgver-source/bsnes"
39     msg "Please select your preferred interface"
40     select pi in "GTK" "Qt"; do
41         case $pi in
42             "GTK" ) msg "Building the GTK interface..." && make compiler=gcc platform=x phoenix=gtk; break;;
43             "Qt" ) moc -i -Iphoenix/qt/ -o phoenix/qt/platform.moc phoenix/qt/platform.moc.hpp && msg "Building the Qt interface..." && make compiler=gcc platform=x phoenix=qt; break;;
44         esac
45     done
47     # Compile snespurify
48     cd "${srcdir}/bsnes_v$pkgver-source/snespurify"
49     sed -e 's|g++-4.5|g++|' -i cc-gtk.sh
50     ./cc-gtk.sh
52     # Compile filters
53     cd "${srcdir}/bsnes_v$pkgver-source/snesfilter"
54     make compiler=gcc
56     # Compile bps
57     cd "${srcdir}/bps"
58     sed -e 's|g++-4.5|g++|' -i cc-gtk.sh
59     ./cc-gtk.sh
62 package() {
63     cd "${srcdir}/bsnes_v$pkgver-source/bsnes"
64     sed -i 's/~\/.config/$(DESTDIR)$(prefix)\/share/g' ui/Makefile
65     make install DESTDIR="${pkgdir}" prefix=/usr
67     cd "${srcdir}/bsnes_v$pkgver-source/snespurify"
68     install -Dm755 snespurify-gtk "${pkgdir}/usr/bin/snespurify-gtk"
70     cd "${srcdir}/bsnes_v$pkgver-source/snesfilter"
71     sed -i 's/~\/.config/$(DESTDIR)$(prefix)\/share/g' Makefile
72     make install DESTDIR="${pkgdir}" prefix=/usr
74     cd "${srcdir}/bsnes_v$pkgver-source/snesshader"
75     sed -i 's/~\/.config/$(DESTDIR)$(prefix)\/share/g' Makefile
76     make install DESTDIR="${pkgdir}" prefix=/usr
78     cd "${srcdir}/bps"
79     install -Dm755 bps-gtk "${pkgdir}/usr/bin/bps-gtk"