summaryrefslogtreecommitdiff
path: root/graphics/optipng/patches
diff options
context:
space:
mode:
authorwiz <wiz>2006-04-19 17:02:22 +0000
committerwiz <wiz>2006-04-19 17:02:22 +0000
commit93e85c0159eb5a207e0a37dbf189c76733700dd1 (patch)
tree0d9697757aac14eee2518bdb86b3a59f134c2889 /graphics/optipng/patches
parent09d5dc112d3064bb19ba7cf1bef8cf92e4923a5f (diff)
downloadpkgsrc-93e85c0159eb5a207e0a37dbf189c76733700dd1.tar.gz
Fix build with png-1.2.9nb2. Bump PKGREVISION.
Diffstat (limited to 'graphics/optipng/patches')
-rw-r--r--graphics/optipng/patches/patch-aa13
-rw-r--r--graphics/optipng/patches/patch-ac66
2 files changed, 73 insertions, 6 deletions
diff --git a/graphics/optipng/patches/patch-aa b/graphics/optipng/patches/patch-aa
index 60debaf36b9..0405c3b978c 100644
--- a/graphics/optipng/patches/patch-aa
+++ b/graphics/optipng/patches/patch-aa
@@ -1,16 +1,17 @@
-$NetBSD: patch-aa,v 1.2 2006/01/19 11:18:41 adam Exp $
+$NetBSD: patch-aa,v 1.3 2006/04/19 17:02:22 wiz Exp $
---- /dev/null 2006-01-19 12:14:22.000000000 +0100
+--- Makefile.orig 2006-04-19 14:47:12.000000000 +0200
+++ Makefile
-@@ -0,0 +1,26 @@
+@@ -0,0 +1,27 @@
+OBJS= optipng.o opngio.o opngreduc.o cbitset.o osys.o \
+ pngxread.o pngxrbmp.o pngxrgif.o pngxrpnm.o \
-+ gifread.o pnmerror.o pnmread.o pnmwrite.o
++ gifread.o pnmerror.o pnmread.o pnmwrite.o \
++ png_write_sig.o
+
-+CPPFLAGS= -I${PREFIX}/include -Ilib/pngxtern -Isrc
++CPPFLAGS= `libpng-config --cflags` -Ilib/pngxtern -Isrc
+
+all: $(OBJS)
-+ $(CC) -o optipng $(LDFLAGS) $(OBJS) -lm -lz -lpng
++ $(CC) -o optipng $(LDFLAGS) $(OBJS) `libpng-config --ldflags`
+
+optipng.o: src/optipng.c src/opng.h src/osys.h src/cbitset.h src/cexcept.h
+opngio.o: src/opngio.c src/opng.h
diff --git a/graphics/optipng/patches/patch-ac b/graphics/optipng/patches/patch-ac
new file mode 100644
index 00000000000..bc5ed49735f
--- /dev/null
+++ b/graphics/optipng/patches/patch-ac
@@ -0,0 +1,66 @@
+$NetBSD: patch-ac,v 1.1 2006/04/19 17:02:22 wiz Exp $
+
+--- png_write_sig.c.orig 2006-04-19 15:45:16.000000000 +0200
++++ png_write_sig.c
+@@ -0,0 +1,61 @@
++/* png_write_sig.c from libpng-1.2.9 */
++
++/* pngwutil.c - utilities to write a PNG file
++ *
++ * Last changed in libpng 1.2.9 April 14, 2006
++ * For conditions of distribution and use, see copyright notice in png.h
++ * Copyright (c) 1998-2006 Glenn Randers-Pehrson
++ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
++ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
++ */
++
++#define PNG_INTERNAL
++#include "png.h"
++
++/* Simple function to write the signature. If we have already written
++ * the magic bytes of the signature, or more likely, the PNG stream is
++ * being embedded into another stream and doesn't need its own signature,
++ * we should call png_set_sig_bytes() to tell libpng how many of the
++ * bytes have already been written.
++ */
++void /* PRIVATE */
++png_write_sig(png_structp png_ptr)
++{
++ png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
++ /* write the rest of the 8 byte signature */
++ png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes],
++ (png_size_t)8 - png_ptr->sig_bytes);
++ if(png_ptr->sig_bytes < 3)
++ png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
++}
++
++/* pngwio.c - functions for data output
++ *
++ * Last changed in libpng 1.2.3 - May 21, 2002
++ * For conditions of distribution and use, see copyright notice in png.h
++ * Copyright (c) 1998-2002 Glenn Randers-Pehrson
++ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
++ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
++ *
++ * This file provides a location for all output. Users who need
++ * special handling are expected to write functions that have the same
++ * arguments as these and perform similar functions, but that possibly
++ * use different output methods. Note that you shouldn't change these
++ * functions, but rather write replacement functions and then change
++ * them at run time with png_set_write_fn(...).
++ */
++
++/* Write the data to whatever output you are using. The default routine
++ writes to a file pointer. Note that this routine sometimes gets called
++ with very small lengths, so you should implement some kind of simple
++ buffering if you are using unbuffered writes. This should never be asked
++ to write more than 64K on a 16 bit machine. */
++
++void /* PRIVATE */
++png_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
++{
++ if (png_ptr->write_data_fn != NULL )
++ (*(png_ptr->write_data_fn))(png_ptr, data, length);
++ else
++ png_error(png_ptr, "Call to NULL write function");
++}