summaryrefslogtreecommitdiff
path: root/community/glpng
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 /community/glpng
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/glpng')
-rw-r--r--community/glpng/Makefile30
-rw-r--r--community/glpng/PKGBUILD34
-rw-r--r--community/glpng/libglpng-1.45-debian.patch29
-rw-r--r--community/glpng/libpng14.patch21
-rw-r--r--community/glpng/license21
5 files changed, 135 insertions, 0 deletions
diff --git a/community/glpng/Makefile b/community/glpng/Makefile
new file mode 100644
index 000000000..d6772798f
--- /dev/null
+++ b/community/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/glpng/PKGBUILD b/community/glpng/PKGBUILD
new file mode 100644
index 000000000..83ae13afe
--- /dev/null
+++ b/community/glpng/PKGBUILD
@@ -0,0 +1,34 @@
+# $Id: $
+# Maintainer: Allan McRae <allan@archlinux.org>
+
+pkgname=glpng
+pkgver=1.45
+pkgrel=3
+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' 'zlib')
+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
+ 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
+
+ make -f $srcdir/Makefile libglpng.so.1.45
+ make -f $srcdir/Makefile DESTDIR=$pkgdir/usr install
+
+ install -Dm644 $srcdir/license \
+ $pkgdir/usr/share/licenses/glpng/license
+}
diff --git a/community/glpng/libglpng-1.45-debian.patch b/community/glpng/libglpng-1.45-debian.patch
new file mode 100644
index 000000000..062bf6364
--- /dev/null
+++ b/community/glpng/libglpng-1.45-debian.patch
@@ -0,0 +1,29 @@
+diff -up libglpng-1.45.orig libglpng-1.45
+diff -up libglpng-1.45.orig/src/glpng.c.orig libglpng-1.45.orig/src/glpng.c
+--- libglpng-1.45.orig/src/glpng.c.orig 2000-07-10 21:27:10.000000000 +0200
++++ libglpng-1.45.orig/src/glpng.c 2009-05-17 23:02:38.000000000 +0200
+@@ -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 @@ static void Resize(int components, const
+ }
+ }
+
++#ifdef _WIN32
+ static int ExtSupported(const char *x) {
+ static const GLubyte *ext = NULL;
+ const char *c;
+@@ -129,6 +130,7 @@ static int ExtSupported(const char *x) {
+
+ return 0;
+ }
++#endif
+
+ #define GET(o) ((int)*(data + (o)))
+
diff --git a/community/glpng/libpng14.patch b/community/glpng/libpng14.patch
new file mode 100644
index 000000000..b9fae8c2d
--- /dev/null
+++ b/community/glpng/libpng14.patch
@@ -0,0 +1,21 @@
+diff -Naur libglpng-1.45.orig-old/src/glpng.c libglpng-1.45.orig/src/glpng.c
+--- libglpng-1.45.orig-old/src/glpng.c 2000-07-11 05:27:10.000000000 +1000
++++ libglpng-1.45.orig/src/glpng.c 2010-02-13 22:53:53.000000000 +1000
+@@ -269,7 +269,7 @@
+ 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);
+@@ -373,7 +373,7 @@
+ 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);
diff --git a/community/glpng/license b/community/glpng/license
new file mode 100644
index 000000000..a526262b5
--- /dev/null
+++ b/community/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.
+ */