summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Teibes2015-01-25 15:00:56 +0100
committerCarsten Teibes2015-01-25 15:00:56 +0100
commit127a3947e47d4126690bd826233ec377d1ecfc4e (patch)
treecbfe530d3de4c363a0222b4680b63bbce7c9de7a
downloadaur-127a3947e47d4126690bd826233ec377d1ecfc4e.tar.gz
[add] tuxpuck 0.8.2
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD43
-rw-r--r--tuxpuck-0.8.2-ldflags.patch11
-rw-r--r--tuxpuck-0.8.2-libpng15.patch63
4 files changed, 140 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..910b02439620
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = tuxpuck
+ pkgdesc = Airhockey with tux (Shufflepuck Cafe clone)
+ pkgver = 0.8.2
+ pkgrel = 6
+ url = http://home.no.net/munsuun/tuxpuck/
+ arch = i686
+ arch = x86_64
+ license = GPL2
+ makedepends = freetype2
+ depends = libjpeg
+ depends = sdl
+ depends = libpng
+ depends = libvorbis
+ options = !makeflags
+ source = http://ftp.de.debian.org/debian/pool/main/t/tuxpuck/tuxpuck_0.8.2.orig.tar.gz
+ source = tuxpuck-0.8.2-ldflags.patch
+ source = tuxpuck-0.8.2-libpng15.patch
+ sha256sums = 62d9604ed69c27b9ca2be1312bc705b36de8ed509c539c6d81193e7846272f18
+ sha256sums = 0a5f8610ef0001b5c98834f850ec9a3ade5437703ea04cb363f7cc6f5b39fec5
+ sha256sums = cf9a3a51876fd00e1b4fd34afe1ca79763facd6b0326628186b342da0fd9b68f
+
+pkgname = tuxpuck
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..6c9c0e455cf4
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG
+# Contributor: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: Andrea Scarpino <andrea@archlinux.org>
+
+pkgname=tuxpuck
+pkgver=0.8.2
+pkgrel=6
+pkgdesc="Airhockey with tux (Shufflepuck Cafe clone)"
+arch=('i686' 'x86_64')
+url="http://home.no.net/munsuun/tuxpuck/"
+license=('GPL2')
+depends=('libjpeg' 'sdl' 'libpng' 'libvorbis')
+makedepends=('freetype2')
+options=('!makeflags')
+source=("http://ftp.de.debian.org/debian/pool/main/t/${pkgname}/${pkgname}_$pkgver.orig.tar.gz"
+ "$pkgname-$pkgver-ldflags.patch"
+ "$pkgname-$pkgver-libpng15.patch")
+sha256sums=('62d9604ed69c27b9ca2be1312bc705b36de8ed509c539c6d81193e7846272f18'
+ '0a5f8610ef0001b5c98834f850ec9a3ade5437703ea04cb363f7cc6f5b39fec5'
+ 'cf9a3a51876fd00e1b4fd34afe1ca79763facd6b0326628186b342da0fd9b68f')
+
+prepare() {
+ cd $pkgname-$pkgver
+
+ # fix path
+ sed 's|usr/man|usr/share/man|' -i Makefile
+ # do not abort on error
+ sed 's/-Werror//' -i utils/Makefile
+ # do not use hardcoded gcc binary
+ sed '/^CC/d' -i Makefile utils/Makefile data/Makefile
+ # add our ldflags
+ patch -Np0 < ../$pkgname-$pkgver-ldflags.patch
+ # allow building with newer libpng
+ patch -Np0 < ../$pkgname-$pkgver-libpng15.patch
+}
+
+build() {
+ make -C $pkgname-$pkgver
+}
+
+package() {
+ make -C $pkgname-$pkgver DESTDIR="$pkgdir/" install
+}
diff --git a/tuxpuck-0.8.2-ldflags.patch b/tuxpuck-0.8.2-ldflags.patch
new file mode 100644
index 000000000000..28fcef48a7ec
--- /dev/null
+++ b/tuxpuck-0.8.2-ldflags.patch
@@ -0,0 +1,11 @@
+--- Makefile.old 2010-10-05 10:34:57.000000000 +0200
++++ Makefile 2010-10-05 10:35:28.000000000 +0200
+@@ -20,7 +20,7 @@
+
+ $(NAME) : $(OBJS)
+ cd data; $(MAKE)
+- $(CC) $(CFLAGS) $(OBJS) data/libdata.a `sdl-config --libs` -lm -lpng \
++ $(CC) $(LDFLAGS) $(CFLAGS) $(OBJS) data/libdata.a `sdl-config --libs` -lm -lpng \
+ -ljpeg -lz -lvorbisfile -lvorbis -logg -o $(NAME)
+
+ w32icon.o : data/icons/tuxpuck.ico
diff --git a/tuxpuck-0.8.2-libpng15.patch b/tuxpuck-0.8.2-libpng15.patch
new file mode 100644
index 000000000000..ca9539f39e51
--- /dev/null
+++ b/tuxpuck-0.8.2-libpng15.patch
@@ -0,0 +1,63 @@
+--- png.c.old 2011-09-14 16:25:54.415338149 +0200
++++ png.c 2011-09-14 17:41:02.190803110 +0200
+@@ -38,6 +38,8 @@
+ png_color_16 *transv;
+ SDL_RWops *src = NULL;
+ Uint32 size;
++ int num_palette;
++ png_colorp png_palette;
+
+ memcpy(&size, data, sizeof(Uint32));
+ if (memcounter)
+@@ -74,7 +76,7 @@
+ * the normal method of doing things with libpng). REQUIRED unless you
+ * set up your own error handlers in png_create_read_struct() earlier.
+ */
+- if (setjmp(png_ptr->jmpbuf)) {
++ if (setjmp(png_jmpbuf(png_ptr))) {
+ SDL_SetError("Error reading the PNG file.");
+ goto done;
+ }
+@@ -142,9 +144,9 @@
+ Rmask = 0x000000FF;
+ Gmask = 0x0000FF00;
+ Bmask = 0x00FF0000;
+- Amask = (info_ptr->channels == 4) ? 0xFF000000 : 0;
++ Amask = (png_get_channels(png_ptr, info_ptr) == 4) ? 0xFF000000 : 0;
+ } else {
+- int s = (info_ptr->channels == 4) ? 0 : 8;
++ int s = (png_get_channels(png_ptr, info_ptr) == 4) ? 0 : 8;
+ Rmask = 0xFF000000 >> s;
+ Gmask = 0x00FF0000 >> s;
+ Bmask = 0x0000FF00 >> s;
+@@ -152,7 +154,7 @@
+ }
+ }
+ surface = SDL_AllocSurface(SDL_SWSURFACE, width, height,
+- bit_depth * info_ptr->channels, Rmask, Gmask,
++ bit_depth * png_get_channels(png_ptr, info_ptr), Rmask, Gmask,
+ Bmask, Amask);
+ if (surface == NULL) {
+ SDL_SetError("Out of memory");
+@@ -197,12 +199,15 @@
+ palette->colors[i].g = i;
+ palette->colors[i].b = i;
+ }
+- } else if (info_ptr->num_palette > 0) {
+- palette->ncolors = info_ptr->num_palette;
+- for (i = 0; i < info_ptr->num_palette; ++i) {
+- palette->colors[i].b = info_ptr->palette[i].blue;
+- palette->colors[i].g = info_ptr->palette[i].green;
+- palette->colors[i].r = info_ptr->palette[i].red;
++ } else {
++ png_get_PLTE(png_ptr, info_ptr, &png_palette, &num_palette);
++ if (num_palette > 0) {
++ palette->ncolors = num_palette;
++ for (i = 0; i < num_palette; ++i) {
++ palette->colors[i].b = png_palette[i].blue;
++ palette->colors[i].g = png_palette[i].green;
++ palette->colors[i].r = png_palette[i].red;
++ }
+ }
+ }
+ }