diff options
author | root <root@rshg054.dnsready.net> | 2012-01-20 23:14:48 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-01-20 23:14:48 +0000 |
commit | a1922d0ec660fdc1892f2783515f781c090df0a9 (patch) | |
tree | 6d38a09231ff439c051261d41bfa066870e1fccb /community-staging/glpng | |
parent | eefecc8813e0c062a2058b33209cb30830f824b6 (diff) |
Fri Jan 20 23:14:48 UTC 2012
Diffstat (limited to 'community-staging/glpng')
-rw-r--r-- | community-staging/glpng/Makefile | 30 | ||||
-rw-r--r-- | community-staging/glpng/PKGBUILD | 35 | ||||
-rw-r--r-- | community-staging/glpng/libpng15.patch | 83 | ||||
-rw-r--r-- | community-staging/glpng/license | 21 |
4 files changed, 169 insertions, 0 deletions
diff --git a/community-staging/glpng/Makefile b/community-staging/glpng/Makefile new file mode 100644 index 000000000..d6772798f --- /dev/null +++ b/community-staging/glpng/Makefile @@ -0,0 +1,30 @@ +CFLAGS+=-fPIC -Iinclude +LDFLAGS+=-lpng -lGL +SHAREDLIBFLAGS=-shared +DESTDIR=/usr/local +LIB=lib + +all: libglpng.a libglpng.so.1.45 + +libglpng.a: glpng.o + ar rv $@ $< + +libglpng.so.1.45: glpng.o + gcc $(CFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname=libglpng.so.1 -Wl,--whole-archive $< -Wl,--no-whole-archive $(LDFLAGS) -o $@ + +glpng.o: src/glpng.c + gcc $(CFLAGS) -c $< + +clean: + rm glpng.o libglpng.* + +install: + for i in include include/GL $(LIB); do \ + install -m 755 -d $(DESTDIR)/$$i; \ + done + install -p -m 644 include/GL/glpng.h $(DESTDIR)/include/GL + install -m 755 libglpng.* $(DESTDIR)/$(LIB) + ln -s libglpng.so.1.45 $(DESTDIR)/$(LIB)/libglpng.so.1 + ln -s libglpng.so.1.45 $(DESTDIR)/$(LIB)/libglpng.so + +.PHONY: clean install diff --git a/community-staging/glpng/PKGBUILD b/community-staging/glpng/PKGBUILD new file mode 100644 index 000000000..c2530ae09 --- /dev/null +++ b/community-staging/glpng/PKGBUILD @@ -0,0 +1,35 @@ +# $Id: PKGBUILD 62385 2012-01-19 18:48:18Z jelle $ +# Maintainer: Allan McRae <allan@archlinux.org> + +pkgname=glpng +pkgver=1.45 +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" +license=('custom') +depends=('libpng' 'libgl') +makedepends=('mesa') +source=(http://ftp.de.debian.org/debian/pool/main/libg/libglpng/libglpng_${pkgver}.orig.tar.gz + Makefile + libpng15.patch + license) +build() { + cd "$srcdir/libglpng-1.45.orig" + + patch -Np1 -i "$srcdir/libpng15.patch" + + cp "$srcdir/Makefile" . + make libglpng.so.1.45 +} + +package() { + cd "$srcdir/libglpng-1.45.orig" + make DESTDIR="$pkgdir/usr" install + install -Dm644 "$srcdir/license" \ + "$pkgdir/usr/share/licenses/glpng/license" +} +md5sums=('9e0daad8e39fbf3179c73c0d3f74f104' + '0b24e9cb527d4ed1c43dd743d49d2b54' + 'f3f0c0a3f867c5856d922c18677ef2a2' + 'cd066652a6e5dbd7c1fc303b8e03417a') diff --git a/community-staging/glpng/libpng15.patch b/community-staging/glpng/libpng15.patch new file mode 100644 index 000000000..89e9bf67e --- /dev/null +++ b/community-staging/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 diff --git a/community-staging/glpng/license b/community-staging/glpng/license new file mode 100644 index 000000000..a526262b5 --- /dev/null +++ b/community-staging/glpng/license @@ -0,0 +1,21 @@ +/* + * PNG loader library for OpenGL v1.45 (10/07/00) + * by Ben Wyatt ben@wyatt100.freeserve.co.uk + * Using LibPNG 1.0.2 and ZLib 1.1.3 + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the author be held liable for any damages arising from the + * use of this software. + * + * Permission is hereby granted to use, copy, modify, and distribute this + * source code, or portions hereof, for any purpose, without fee, subject to + * the following restrictions: + * + * 1. The origin of this source code must not be misrepresented. You must not + * claim that you wrote the original software. If you use this software in + * a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered versions must be plainly marked as such and must not be + * misrepresented as being the original source. + * 3. This notice must not be removed or altered from any source distribution. + */ |