Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Nov 2010 10:35:42 GMT
From:      Andrey Zholos <aaz@althenia.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/152539: graphics/megapov fails to build with png 1.4
Message-ID:  <201011241035.oAOAZgb8086600@red.freebsd.org>
Resent-Message-ID: <201011241040.oAOAeAWw082318@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         152539
>Category:       ports
>Synopsis:       graphics/megapov fails to build with png 1.4
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 24 10:40:10 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Andrey Zholos
>Release:        8.1-STABLE
>Organization:
>Environment:
>Description:
The POV-Ray port has a patch to allow it to compile with libpng 1.4.
MegaPOV requires the same patch.

This problem is obscured because sometimes MegaPOV configure can't find
the system's libpng and compiles its own libpng 1.2.8 instead (and also
its own libjpeg and libtiff). This apparently depends on whether Xorg
is installed.

>How-To-Repeat:
Without Xorg installed, configure says:

checking for library containing png_get_libpng_ver... no
configure: libpng will be built and statically linked to MegaPOV


With Xorg installed, configure says:

checking for library containing png_get_libpng_ver... -lpng
checking png.h usability... yes
checking png.h presence... yes
checking for png.h... yes
checking for libpng version >= 1.2.5... 1.4.3, ok

Later, the build stops with many benign warnings and two errors:

png_pov.cpp:1440: error: 'struct png_info_struct' has no member named 'trans'
png_pov.cpp:1473: error: 'struct png_info_struct' has no member named 'trans'

>Fix:
See patch.

Patch attached with submission follows:

--- Makefile.orig	2010-03-28 07:37:08.000000000 +0100
+++ Makefile	2010-11-24 10:08:44.000000000 +0000
@@ -29,6 +29,8 @@
 LDFLAGS+= -L${LOCALBASE}/lib -L${LOCALBASE}/lib
 CFLAGS+= -I${LOCALBASE}/include
 CXXFLAGS+= -I${LOCALBASE}/include
+CPPFLAGS+= -I${LOCALBASE}/include
+CONFIGURE_ENV+=	CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
 
 .include <bsd.port.pre.mk>
 
--- files/patch-png_pov.cpp.orig	1970-01-01 01:00:00.000000000 +0100
+++ files/patch-png_pov.cpp	2010-11-24 10:18:19.000000000 +0000
@@ -0,0 +1,20 @@
+--- source/png_pov.cpp.orig	2005-08-23 20:20:33.000000000 +0100
++++ source/png_pov.cpp	2010-11-24 10:15:11.000000000 +0000
+@@ -1437,7 +1437,7 @@
+ 		if(r_info_ptr->valid & PNG_INFO_tRNS)
+ 		{
+ 			for (index = 0; index < r_info_ptr->num_trans; index++)
+-				cmap[index].Transmit = 255 - r_info_ptr->trans[index];
++				cmap[index].Transmit = 255 - r_info_ptr->trans_alpha[index];
+ 		}
+ 
+ 		Image->data.map_lines = (unsigned char **)POV_MALLOC(height * sizeof(unsigned char *), "PNG image");
+@@ -1470,7 +1470,7 @@
+ 		if(r_info_ptr->valid & PNG_INFO_tRNS)
+ 		{
+ 			for (index = 0; index < r_info_ptr->num_trans; index++)
+-				cmap[index].Transmit = 255 - r_info_ptr->trans[index];
++				cmap[index].Transmit = 255 - r_info_ptr->trans_alpha[index];
+ 		}
+ 
+ 		Image->data.map_lines = (unsigned char **)POV_MALLOC(height * sizeof(unsigned char *), "PNG image");


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011241035.oAOAZgb8086600>