summaryrefslogtreecommitdiff
path: root/extra/apricots
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /extra/apricots
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'extra/apricots')
-rw-r--r--extra/apricots/PKGBUILD22
-rw-r--r--extra/apricots/apricots-0.2.6-freealut.patch65
2 files changed, 87 insertions, 0 deletions
diff --git a/extra/apricots/PKGBUILD b/extra/apricots/PKGBUILD
new file mode 100644
index 000000000..76edd3871
--- /dev/null
+++ b/extra/apricots/PKGBUILD
@@ -0,0 +1,22 @@
+# $Id: PKGBUILD 27259 2009-02-18 02:43:34Z eric $
+# Contributor: Damir Perisa <damir.perisa@bluewin.ch>
+
+pkgname=apricots
+pkgver=0.2.6
+pkgrel=3
+pkgdesc="A simple 2D flying/bombing game similar to basic side scrollers"
+arch=("i686" "x86_64")
+license=('GPL')
+url="http://www.fishies.org.uk/apricots.html"
+depends=('gcc-libs' 'openal>=1.6.372' 'sdl' 'freealut>=1.1.0')
+source=("http://www.fishies.org.uk/$pkgname-$pkgver.tar.gz" \
+ "apricots-0.2.6-freealut.patch")
+md5sums=('910828d717e46d8cbd9c24f702d09fbc' '5f9f74082dfe162ab3ba51f6ec628f99')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ patch -Np0 -i $startdir/src/apricots-0.2.6-freealut.patch || return 1
+ ./configure --prefix=/usr || return 1
+ make || return 1
+ make prefix=$pkgdir/usr install || return 1
+}
diff --git a/extra/apricots/apricots-0.2.6-freealut.patch b/extra/apricots/apricots-0.2.6-freealut.patch
new file mode 100644
index 000000000..4f6630713
--- /dev/null
+++ b/extra/apricots/apricots-0.2.6-freealut.patch
@@ -0,0 +1,65 @@
+--- apricots/apricots.cpp
++++ apricots/apricots.cpp
+@@ -16,6 +16,7 @@
+ int main(int, char**){
+ #endif
+
++atexit(SDL_Quit);
+ // Initialize data
+ gamedata g;
+ init_data(g);
+
+--- apricots/sampleio.cpp
++++ apricots/sampleio.cpp
+@@ -74,12 +74,9 @@
+ alListenerfv(AL_ORIENTATION, front );
+
+ // Load in samples
+- ALvoid* data = malloc(5 * (512 * 3) * 1024);
+ alGenBuffers(numsamples, samples);
+
+ for (int i = 0; i < numsamples; i++){
+- ALsizei freq;
+- ALboolean fileok;
+ // Evil OpenAL portability fix done here
+ #ifdef _WIN32
+ ALenum format;
+@@ -87,15 +84,12 @@
+ alutLoadWAVFile(filenames[i],&format,&data,&filelen,&freq,&trash);
+ fileok = (alGetError() == AL_NO_ERROR);
+ #else
+- ALsizei format;
+- ALsizei trash;
+- fileok = alutLoadWAV(filenames[i],&data,&format,&filelen,&trash,&freq);
++ samples[i] = alutCreateBufferFromFile(filenames[i]);
+ #endif
+- if (!fileok){
++ if (samples[i] == AL_NONE){
+ cerr << "sampleio: could not open " << filenames[i] << endl;
+ exit(1);
+ }
+- alBufferData(samples[i], format, data, filelen, freq);
+ }
+
+ // Generate Sources
+@@ -107,7 +101,6 @@
+ alSourcefv(sources[j], AL_ORIENTATION, back );
+ }
+
+- free(data);
+
+ }
+
+
+--- configure.in
++++ configure.in
+@@ -100,7 +100,8 @@
+
+ dnl Check for OpenAL
+ AC_CHECK_HEADER(AL/al.h,[CXXFLAGS="$CXXFLAGS -DAP_AUDIO_OPENAL"])
+-AC_CHECK_LIB( openal, alutInit)
++AC_CHECK_LIB( openal, alGetError)
++AC_CHECK_LIB( alut, alutInit)
+
+ KDE_CHECK_EXTRA_LIBS
+ all_libraries="$all_libraries $USER_LDFLAGS"