POV-Ray doesn't build with libpng-1.5, so we use the included
libpng-1.2.  That version 1.2.5 is ancient, though.  Let's replace it
with one with another decade worth of security fixes.

OK?  Too confusing?  Not worth the effort?


Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/povray/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- Makefile    7 Jul 2011 17:46:11 -0000       1.20
+++ Makefile    15 Jul 2011 15:10:31 -0000
@@ -3,7 +3,7 @@
 COMMENT=       3D image rendering package
 
 DISTNAME=      povray-3.6.1
-REVISION=      0
+REVISION=      1
 CATEGORIES=    graphics
 
 HOMEPAGE=      http://www.povray.org/
@@ -18,7 +18,14 @@ WANTLIB += ICE SM X11 Xpm c jpeg m stdc+
 MASTER_SITES=          http://www.povray.org/ftp/pub/povray/Official/Unix/ \
                        ftp://ftp.povray.org/pub/povray/Official/Unix/
 EXTRACT_SUFX=          .tar.bz2
-       
+
+# We replace the included ancient copy of libpng with a later release
+# from the 1.2 branch.
+EXTRACT_ONLY=          ${DISTNAME}${EXTRACT_SUFX}
+PNG_V=                 1.2.46
+MASTER_SITES0=         ${MASTER_SITE_SOURCEFORGE:=libpng/}
+DISTFILES=             ${EXTRACT_ONLY} libpng-${PNG_V}.tar.gz:0
+
 USE_LIBTOOL=           yes
 
 LIB_DEPENDS=           graphics/jpeg \
@@ -37,7 +44,7 @@ CONFIGURE_ARGS+=      ${CONFIGURE_SHARED} \
 # included libpng 1.2 will be used.
 
 CONFIGURE_ENV+=        COMPILED_BY="OpenBSD Ports <ports@openbsd.org>" \
-                       CPPFLAGS="-I${LOCALBASE}/include" \
+                       CPPFLAGS="-I${LOCALBASE}/include -DPNG_NO_MMX_CODE" \
                        CXXFLAGS="-I${LOCALBASE}/include" \
                        LDFLAGS="-L${LOCALBASE}/lib -lm"
 
@@ -45,9 +52,17 @@ MAKE_FLAGS+=         povconfdir=${PREFIX}/share
                        povdocdir=${PREFIX}/share/doc/povray/ \
                        povlibdir=${PREFIX}/share/povray/
 
+MODGNU_CONFIG_GUESS_DIRS=${WRKSRC}/config ${WRKSRC}/libraries/png
+
 NO_REGRESS=            Yes
 
+# Replace the source files for the included libpng.
 post-extract:
+       cd ${WRKDIST}/libraries; \
+           tar -xzf ${FULLDISTDIR}/libpng-${PNG_V}.tar.gz \
+               -s ',^libpng-${PNG_V},png,' 'libpng-${PNG_V}/png*.[ch]'
+
+pre-patch:
        cd ${WRKSRC} && find . -type f -name \*.orig | xargs rm
 
 post-configure:
Index: distinfo
===================================================================
RCS file: /cvs/ports/graphics/povray/distinfo,v
retrieving revision 1.4
diff -u -p -r1.4 distinfo
--- distinfo    7 Jul 2011 14:45:22 -0000       1.4
+++ distinfo    15 Jul 2011 15:10:31 -0000
@@ -1,5 +1,10 @@
+MD5 (libpng-1.2.46.tar.gz) = A938F60yHbk/mEWB6UFdIg==
 MD5 (povray-3.6.1.tar.bz2) = tXibt+6u0ICcXILQ79pXHQ==
+RMD160 (libpng-1.2.46.tar.gz) = 9PFDscZNHi6zy2YlE7MRoFaLsEw=
 RMD160 (povray-3.6.1.tar.bz2) = hLpnnaZgifGSzBv8+L3UmOc2qaM=
+SHA1 (libpng-1.2.46.tar.gz) = 1fOiQ5sLbYWiZJmyvgmRjrVOoTo=
 SHA1 (povray-3.6.1.tar.bz2) = H6s8y97a+/d+OmYIdwm732C8ZD0=
+SHA256 (libpng-1.2.46.tar.gz) = PY/UyI0Zt/z5genZra2RleGhz7t7y552or1gLW4654E=
 SHA256 (povray-3.6.1.tar.bz2) = Top/7NRIBzQ7aGfh8kQKoOCWE9bWmnOFrEj05edzenM=
+SIZE (libpng-1.2.46.tar.gz) = 831390
 SIZE (povray-3.6.1.tar.bz2) = 8200160
-- 
Christian "naddy" Weisgerber                          na...@mips.inka.de

Reply via email to