diff options
Diffstat (limited to 'community/glpng')
-rw-r--r-- | community/glpng/PKGBUILD | 22 | ||||
-rw-r--r-- | community/glpng/libpng15.patch | 83 |
2 files changed, 93 insertions, 12 deletions
diff --git a/community/glpng/PKGBUILD b/community/glpng/PKGBUILD index 0c57c67ae..0c604e544 100644 --- a/community/glpng/PKGBUILD +++ b/community/glpng/PKGBUILD @@ -1,9 +1,9 @@ -# $Id: PKGBUILD 55485 2011-09-13 02:26:22Z ebelanger $ +# $Id: PKGBUILD 63590 2012-02-05 11:58:33Z ibiru $ # Maintainer: Allan McRae <allan@archlinux.org> pkgname=glpng pkgver=1.45 -pkgrel=4 +pkgrel=5 pkgdesc="Toolkit for loading PNG images as OpenGL textures" arch=('i686' 'x86_64') url="http://www.fifi.org/doc/libglpng-dev/glpng.html" @@ -12,19 +12,13 @@ depends=('libpng' 'libgl') makedepends=('mesa') source=(http://ftp.de.debian.org/debian/pool/main/libg/libglpng/libglpng_${pkgver}.orig.tar.gz Makefile - libglpng-1.45-debian.patch - libpng14.patch + libpng15.patch license) -md5sums=('9e0daad8e39fbf3179c73c0d3f74f104' - '0b24e9cb527d4ed1c43dd743d49d2b54' - '51ee01e61a70d91977b791a03e579b0f' - '50e00b9de0b376d7fb5fd812dc7beac9' - 'cd066652a6e5dbd7c1fc303b8e03417a') - build() { cd "$srcdir/libglpng-1.45.orig" - patch -Np1 -i "$srcdir/libglpng-1.45-debian.patch" - patch -Np1 -i "$srcdir/libpng14.patch" + + patch -Np1 -i "$srcdir/libpng15.patch" + cp "$srcdir/Makefile" . make libglpng.so.1.45 } @@ -35,3 +29,7 @@ package() { install -Dm644 "$srcdir/license" \ "$pkgdir/usr/share/licenses/glpng/license" } +md5sums=('9e0daad8e39fbf3179c73c0d3f74f104' + '0b24e9cb527d4ed1c43dd743d49d2b54' + 'f3f0c0a3f867c5856d922c18677ef2a2' + 'cd066652a6e5dbd7c1fc303b8e03417a') diff --git a/community/glpng/libpng15.patch b/community/glpng/libpng15.patch new file mode 100644 index 000000000..89e9bf67e --- /dev/null +++ b/community/glpng/libpng15.patch @@ -0,0 +1,83 @@ +diff -aur libglpng-1.45.orig/include/GL/glpng.h libglpng-1.45.new/include/GL/glpng.h +--- libglpng-1.45.orig/include/GL/glpng.h 2000-07-10 21:27:00.000000000 +0200 ++++ libglpng-1.45.new/include/GL/glpng.h 2012-01-19 19:34:43.994280259 +0100 +@@ -57,7 +57,7 @@ + #define PNG_SIMPLEMIPMAP PNG_SIMPLEMIPMAPS
+ + /* Transparency parameters */
+-#define PNG_CALLBACK -3 /* Call the callback function to generate alpha */ ++#define PNG_CALLBACKT -3 /* Call the callback function to generate alpha */ + #define PNG_ALPHA -2 /* Use alpha channel in PNG file, if there is one */ + #define PNG_SOLID -1 /* No transparency */ + #define PNG_STENCIL 0 /* Sets alpha to 0 for r=g=b=0, 1 otherwise */ +diff -aur libglpng-1.45.orig/src/glpng.c libglpng-1.45.new/src/glpng.c +--- libglpng-1.45.orig/src/glpng.c 2000-07-10 21:27:10.000000000 +0200 ++++ libglpng-1.45.new/src/glpng.c 2012-01-19 19:39:37.379311651 +0100 +@@ -29,7 +29,7 @@ + #include <GL/gl.h>
+ #include <stdlib.h> + #include <math.h> +-#include "png/png.h" ++#include <png.h> +
+ /* Used to decide if GL/gl.h supports the paletted extension */
+ #ifdef GL_COLOR_INDEX1_EXT
+@@ -113,6 +113,7 @@ + } + } +
++#ifdef _WIN32 + static int ExtSupported(const char *x) { + static const GLubyte *ext = NULL; + const char *c; +@@ -129,6 +130,7 @@ + + return 0; + } ++#endif +
+ #define GET(o) ((int)*(data + (o)))
+
+@@ -269,14 +271,14 @@ + if (pinfo == NULL) return 0; + + fread(header, 1, 8, fp); +- if (!png_check_sig(header, 8)) return 0; ++ if (!png_sig_cmp(header, 0, 8)) return 0; + + png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + info = png_create_info_struct(png); + endinfo = png_create_info_struct(png); + + // DH: added following lines
+- if (setjmp(png->jmpbuf))
++ if (setjmp(png_jmpbuf(png)))
+ {
+ png_destroy_read_struct(&png, &info, &endinfo);
+ return 0;
+@@ -373,14 +375,14 @@ + png_uint_32 i; + + fread(header, 1, 8, fp); +- if (!png_check_sig(header, 8)) return 0; ++ if (png_sig_cmp(header, 0, 8)) return 0; + + png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + info = png_create_info_struct(png); + endinfo = png_create_info_struct(png); + + // DH: added following lines
+- if (setjmp(png->jmpbuf))
++ if (setjmp(png_jmpbuf(png)))
+ {
+ png_destroy_read_struct(&png, &info, &endinfo);
+ return 0;
+@@ -559,7 +561,7 @@ + #define ALPHA *q + + switch (trans) { +- case PNG_CALLBACK: ++ case PNG_CALLBACKT: + FORSTART + ALPHA = AlphaCallback((unsigned char) r, (unsigned char) g, (unsigned char) b); + FOREND |