Update to png 1.5.2. Lots of improvements, but also significant

API incompatibility:

"The libpng 1.5.x series finally hides the contents of the venerable
and hoary png_struct and png_info data structures inside private
(i.e., non-installed) header files. Instead of direct struct-access,
applications should be using the various png_get_xxx() and png_set_xxx()
accessor functions, which have existed for almost as long as libpng
itself."
This commit is contained in:
naddy 2011-07-08 20:34:36 +00:00
parent de06b85786
commit 64920edcf7
8 changed files with 77 additions and 70 deletions

View File

@ -1,12 +1,11 @@
# $OpenBSD: Makefile,v 1.78 2011/07/01 17:09:36 jasper Exp $
# $OpenBSD: Makefile,v 1.79 2011/07/08 20:34:36 naddy Exp $
COMMENT= library for manipulating PNG images
VERSION= 1.2.44
VERSION= 1.5.2
DISTNAME= libpng-${VERSION}
PKGNAME= png-${VERSION}
REVISION= 0
SHARED_LIBS= png 10.0
SHARED_LIBS= png 11.0
CATEGORIES= graphics
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=libpng/}
@ -28,4 +27,7 @@ MAKE_FLAGS= SHLIB_MAJOR=${LIBpng_VERSION:R} \
SHLIB_MINOR=${LIBpng_VERSION:E} \
PNGLIB_VERSION=${VERSION}
do-configure:
cp ${WRKSRC}/scripts/pnglibconf.h.prebuilt ${WRKBUILD}/pnglibconf.h
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
MD5 (libpng-1.2.44.tar.gz) = ibYvjaruqxNC4wfW0UEf8Q==
RMD160 (libpng-1.2.44.tar.gz) = ZFgC0qiz+SyrYQVgTisZjkgyVPQ=
SHA1 (libpng-1.2.44.tar.gz) = d2u45C2GvXGuWODZb4VHLB1jvus=
SHA256 (libpng-1.2.44.tar.gz) = bVvgKh2QQL9OggXgbJ+2oHDI/ACFnZ4XKcTED/EB9n0=
SIZE (libpng-1.2.44.tar.gz) = 829035
MD5 (libpng-1.5.2.tar.gz) = MdRI65OhZGNZoj8bI0NKsw==
RMD160 (libpng-1.5.2.tar.gz) = 0Rh51Y1si7849KZuUp5qs01KHMw=
SHA1 (libpng-1.5.2.tar.gz) = ccMLmyMWmi2sWwp3lU2dkfjZRP4=
SHA256 (libpng-1.5.2.tar.gz) = HtKBgQNI27YdAkZcDf+FTBe4JvXF12zOMrwOatygIVY=
SIZE (libpng-1.5.2.tar.gz) = 964261

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-libpng_3,v 1.1 2011/07/08 20:34:37 naddy Exp $
--- libpng.3.orig Sun Jul 3 08:20:25 2011
+++ libpng.3 Sun Jul 3 08:20:40 2011
@@ -1122,7 +1122,7 @@ rebuilt from scripts/pnglibconf.dfa using awk or it mu
Hand editing is achieved by copying scripts/pnglibconf.h.prebuilt and changing
the lines defining the supported features, paying very close attention to the
-'option' information in scripts/pnglibconf.dfa that describes those features and
+\&'option' information in scripts/pnglibconf.dfa that describes those features and
their requirements. This is easy to get wrong.
B. Configuration using DFA_XTRA

View File

@ -1,15 +0,0 @@
$OpenBSD: patch-pngconf_h,v 1.8 2009/08/23 14:44:18 naddy Exp $
--- pngconf.h.orig Thu Aug 13 13:13:21 2009
+++ pngconf.h Sun Aug 23 16:21:58 2009
@@ -40,6 +40,11 @@
#endif
#endif
+/* libpng compile time options */
+#ifndef PNG_NO_MMX_CODE
+# define PNG_NO_MMX_CODE
+#endif
+
/*
* Added at libpng-1.2.8
*

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-pngerror_c,v 1.5 2011/07/01 17:09:36 jasper Exp $
$OpenBSD: patch-pngerror_c,v 1.6 2011/07/08 20:34:37 naddy Exp $
Fix for CVE-2011-2501
libpng "png_format_buffer()" Denial of Service Vulnerability
@ -6,9 +6,9 @@ libpng "png_format_buffer()" Denial of Service Vulnerability
From upstream git:
http://libpng.git.sourceforge.net/git/gitweb.cgi?p=libpng/libpng;a=commitdiff;h=65e6d5a34f49acdb362a0625a706c6b914e670af
--- pngerror.c.orig Fri Jul 1 19:07:03 2011
+++ pngerror.c Fri Jul 1 19:07:42 2011
@@ -181,8 +181,13 @@ png_format_buffer(png_structp png_ptr, png_charp buffe
--- pngerror.c.orig Thu Mar 31 18:23:40 2011
+++ pngerror.c Sun Jul 3 00:19:50 2011
@@ -185,8 +185,13 @@ png_format_buffer(png_structp png_ptr, png_charp buffe
{
buffer[iout++] = ':';
buffer[iout++] = ' ';
@ -23,4 +23,4 @@ http://libpng.git.sourceforge.net/git/gitweb.cgi?p=libpng/libpng;a=commitdiff;h=
+ buffer[iout] = '\0';
}
}
#endif /* PNG_WARNINGS_SUPPORTED || PNG_ERROR_TEXT_SUPPORTED */

View File

@ -1,16 +1,16 @@
$OpenBSD: patch-scripts_libpng_pc_in,v 1.18 2010/06/27 19:55:04 kili Exp $
--- scripts/libpng.pc.in.orig Sat Jun 26 02:31:16 2010
+++ scripts/libpng.pc.in Sun Jun 27 08:23:08 2010
$OpenBSD: patch-scripts_libpng_pc_in,v 1.19 2011/07/08 20:34:37 naddy Exp $
--- scripts/libpng.pc.in.orig Sat Jul 2 23:30:05 2011
+++ scripts/libpng.pc.in Sat Jul 2 23:30:23 2011
@@ -1,10 +1,10 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
-includedir=@includedir@/libpng12
-includedir=@includedir@/libpng15
+includedir=@includedir@
Name: libpng
Description: Loads and saves PNG files
Version: 1.2.44
-Libs: -L${libdir} -lpng12
Version: 1.5.2
-Libs: -L${libdir} -lpng15
+Libs: -L${libdir} -lpng -lz -lm
Cflags: -I${includedir}

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-scripts_makefile_openbsd,v 1.32 2011/06/23 22:50:27 naddy Exp $
--- scripts/makefile.openbsd.orig Fri Jun 25 18:31:16 2010
+++ scripts/makefile.openbsd Mon Jun 20 13:22:02 2011
@@ -7,11 +7,12 @@
$OpenBSD: patch-scripts_makefile_openbsd,v 1.33 2011/07/08 20:34:37 naddy Exp $
--- scripts/makefile.openbsd.orig Thu Mar 31 18:23:42 2011
+++ scripts/makefile.openbsd Sun Jul 3 19:09:39 2011
@@ -7,12 +7,11 @@
# and license in png.h
PREFIX?= /usr/local
@ -10,31 +10,33 @@ $OpenBSD: patch-scripts_makefile_openbsd,v 1.32 2011/06/23 22:50:27 naddy Exp $
-MANDIR= ${PREFIX}/man/cat
+MANDIR= ${PREFIX}/man/man
+INCDIR= ${PREFIX}/include/libpng
+DOCDIR= ${PREFIX}/share/doc/png
-SHLIB_MAJOR= 0
-SHLIB_MINOR= 1.2.44
-SHLIB_MAJOR= 15
-SHLIB_MINOR= 1.5.2
-
LIB= png
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
@@ -25,24 +26,42 @@ CPPFLAGS+= -I${.CURDIR} -DPNG_NO_MMX_CODE
pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \
@@ -25,12 +24,30 @@ CPPFLAGS+= -I${.CURDIR}
NOPROFILE= Yes
-CLEANFILES+= pngtest.o pngtest
+CLEANFILES+= pngtest.o pngtest libpng-config
-CLEANFILES+= pngtest.o pngtest pnglibconf.h
+CLEANFILES+= pngtest.o pngtest pngvalid.o pngvalid pnglibconf.h libpng-config
MAN= libpng.3 libpngpf.3 png.5
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO libpng.txt
+DOCS = libpng-1.2.44.txt
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \
- libpng-manual.txt
+all: ${_LIBS} libpng-config libpng.pc
+all: pnglibconf.h ${_LIBS} libpng-config libpng.pc
+
+beforedepend: pnglibconf.h
+
+libpng.pc:
+ cat scripts/libpng.pc.in | sed -e s\!@prefix@!$(PREFIX)! \
+ -e s\!@exec_prefix@!$(BINDIR)! -e s\!@libdir@!$(LIBDIR)! \
+ -e s\!@includedir@!$(INCDIR)! \
+ -e s\!@PNGLIB_VERSION@!$(PNGLIB_VERSION)!> libpng.pc
+ sed < scripts/libpng.pc.in -e s'!@prefix@!$(PREFIX)!' \
+ -e 's!@exec_prefix@!$(BINDIR)!' -e 's!@libdir@!$(LIBDIR)!' \
+ -e 's!@includedir@!$(INCDIR)!' \
+ -e 's!@PNGLIB_VERSION@!$(PNGLIB_VERSION)!' > libpng.pc
+
+libpng-config:
+ ( cat scripts/libpng-config-head.in; \
@ -46,17 +48,27 @@ $OpenBSD: patch-scripts_makefile_openbsd,v 1.32 2011/06/23 22:50:27 naddy Exp $
+ cat scripts/libpng-config-body.in ) > libpng-config
+ chmod +x libpng-config
+
pngtest.o: pngtest.c
${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
@@ -41,13 +58,20 @@ pngtest.o: pngtest.c
pngtest: pngtest.o
${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
-test: pngtest
+test regress: pngtest
cd ${.OBJDIR} && env \
LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
- cd ${.OBJDIR} && env \
- LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
+pngvalid.o: pngvalid.c
+ ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
+pngvalid: pngvalid.o
+ ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
+
+test regress: pngtest pngvalid
+ @LD_LIBRARY_PATH="${.OBJDIR}" srcdir=. ./test-pngtest.sh
+ @LD_LIBRARY_PATH="${.OBJDIR}" ./test-pngvalid-simple.sh
+ @LD_LIBRARY_PATH="${.OBJDIR}" ./test-pngvalid-full.sh
+
beforeinstall:
- if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \
- ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include; \
@ -65,24 +77,22 @@ $OpenBSD: patch-scripts_makefile_openbsd,v 1.32 2011/06/23 22:50:27 naddy Exp $
fi
if [ ! -d ${DESTDIR}${LIBDIR} ]; then \
${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \
@@ -56,21 +75,24 @@ beforeinstall:
@@ -61,22 +85,19 @@ beforeinstall:
if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \
${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \
fi
- if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \
- ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \
+ if [ ! -d ${DESTDIR}${DOCDIR} ]; then \
+ ${INSTALL} -d -o root -g wheel ${DESTDIR}${DOCDIR}; \
fi
+ if [ ! -d ${DESTDIR}${LIBDIR}/pkgconfig ]; then \
+ ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/pkgconfig; \
+ fi
fi
afterinstall:
@rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
@rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
- @rm -f ${DESTDIR}${PREFIX}/include/png.h
- @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
- @rm -f ${DESTDIR}${PREFIX}/include/pnglibconf.h
@rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
+ ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} \
+ -m ${BINMODE} libpng-config ${DESTDIR}${BINDIR}
@ -91,9 +101,8 @@ $OpenBSD: patch-scripts_makefile_openbsd,v 1.32 2011/06/23 22:50:27 naddy Exp $
+ -m ${NONBINMODE} ${HDRS} ${DESTDIR}${INCDIR}
${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
- -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
+ -m ${NONBINMODE} libpng.pc ${DESTDIR}${LIBDIR}/pkgconfig
${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
- ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
- -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
+ -m ${NONBINMODE} ${DOCS} ${DESTDIR}${DOCDIR}
+ -m ${NONBINMODE} libpng.pc ${DESTDIR}${LIBDIR}/pkgconfig
.include <bsd.lib.mk>

View File

@ -1,14 +1,13 @@
@comment $OpenBSD: PLIST,v 1.24 2011/06/23 22:50:27 naddy Exp $
@comment $OpenBSD: PLIST,v 1.25 2011/07/08 20:34:37 naddy Exp $
%%SHARED%%
bin/libpng-config
include/libpng/
include/libpng/png.h
include/libpng/pngconf.h
include/libpng/pnglibconf.h
lib/libpng.a
lib/pkgconfig/
lib/pkgconfig/libpng.pc
@man man/man3/libpng.3
@man man/man3/libpngpf.3
@man man/man5/png.5
share/doc/png/
share/doc/png/libpng-${VERSION}.txt