summaryrefslogtreecommitdiff
path: root/staging/gif2png
diff options
context:
space:
mode:
Diffstat (limited to 'staging/gif2png')
-rw-r--r--staging/gif2png/PKGBUILD36
-rw-r--r--staging/gif2png/gif2png-2.5.4-libpng15.patch43
2 files changed, 79 insertions, 0 deletions
diff --git a/staging/gif2png/PKGBUILD b/staging/gif2png/PKGBUILD
new file mode 100644
index 000000000..2e530eaba
--- /dev/null
+++ b/staging/gif2png/PKGBUILD
@@ -0,0 +1,36 @@
+# $Id: PKGBUILD 146933 2012-01-19 11:45:57Z giovanni $
+# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
+# Contributor: eric <eric@archlinux.org>
+# Contributor: Andrew Rose <ody@netrux.com>
+
+pkgname=gif2png
+pkgver=2.5.4
+pkgrel=3
+pkgdesc="A GIF to PNG image format converter"
+arch=('i686' 'x86_64')
+url="http://www.catb.org/~esr/gif2png/"
+license=('ZLIB')
+depends=('libpng')
+optdepends=('python2: for using web2png')
+source=("http://www.catb.org/~esr/${pkgname}/${pkgname}-${pkgver}.tar.gz"
+ 'gif2png-2.5.4-libpng15.patch')
+md5sums=('d63ea3fc6b6119589e8d4d6fead30df9'
+ 'd4d6d31e04e7448315eae56bb12d4df6')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ sed -i 's#env python#env python2#' web2png
+ patch -Np0 -i ${srcdir}/gif2png-2.5.4-libpng15.patch
+
+ ./configure --prefix=/usr \
+ --mandir=/usr/share/man
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make DESTDIR="${pkgdir}" install
+ install -D -m644 COPYING "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
+}
diff --git a/staging/gif2png/gif2png-2.5.4-libpng15.patch b/staging/gif2png/gif2png-2.5.4-libpng15.patch
new file mode 100644
index 000000000..9e5c333bb
--- /dev/null
+++ b/staging/gif2png/gif2png-2.5.4-libpng15.patch
@@ -0,0 +1,43 @@
+ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/graphics/gif2png/patches/patch-aa
+
+--- gif2png.c
++++ gif2png.c
+@@ -10,6 +10,7 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <unistd.h> /* for isatty() */
++#include <zlib.h>
+
+ #if !defined(TRUE)
+ #define FALSE 0
+@@ -120,8 +121,8 @@ int writefile(struct GIFelement *s,struc
+ int colors_used = 0;
+ byte remap[MAXCMSIZE];
+ int low_prec;
+- png_struct *png_ptr = xalloc(sizeof (png_struct));
+- png_info *info_ptr = xalloc(sizeof (png_info));
++ png_struct *png_ptr;
++ png_info *info_ptr;
+ int p;
+ int gray_bitdepth;
+ png_color pal_rgb[MAXCMSIZE], *pltep;
+@@ -136,6 +137,19 @@ int writefile(struct GIFelement *s,struc
+ png_text software;
+ png_text comment;
+
++ png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
++ if (png_ptr == NULL) {
++ fprintf(stderr, "gif2png: fatal error, out of memory\n");
++ fprintf(stderr, "gif2png: exiting ungracefully\n");
++ exit(1);
++ }
++ info_ptr = png_create_info_struct(png_ptr);
++ if (info_ptr == NULL) {
++ fprintf(stderr, "gif2png: fatal error, out of memory\n");
++ fprintf(stderr, "gif2png: exiting ungracefully\n");
++ exit(1);
++ }
++
+ /* these volatile declarations prevent gcc warnings ("variable might be
+ * clobbered by `longjmp' or `vfork'") */
+ volatile int gray = TRUE;