Opened 12 years ago

Closed 12 years ago

Last modified 9 years ago

#36214 closed defect (fixed)

windowmaker @0.92.0 compile error with libpng 1.5

Reported by: martini@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc: jean-philippe.humbert@…
Port: windowmaker

Description

When building Windowmaker: port -v install -s windowmaker the compile errors:

make[2]: Entering directory `/opt/local_20120918/var/macports/build/_opt_local_20120918_var_macports_sources_rsync.macports.org_release_tarballs_ports_x11_windowmaker/windowmaker/work/WindowMaker-0.92.0/wrlib'
/bin/sh ../libtool --mode=compile /usr/bin/llvm-gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I../src  -I/opt/local/include   -I/opt/local/include  -pipe -O2 -arch x86_64 -c png.c
 /usr/bin/llvm-gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I../src -I/opt/local/include -I/opt/local/include -pipe -O2 -arch x86_64 -c png.c  -fno-common -DPIC -o .libs/png.o
png.c: In function 'RLoadPNG':
png.c:100: error: dereferencing pointer to incomplete type
make[2]: *** [png.lo] Error 1

Note there is no pre-compiled binary for this port. Mac OS X 10.6.8 (Snow Leopard)

Attachments (3)

main.log (50.6 KB) - added by martini@… 12 years ago.
log file for port
patch-wrlib_png.c.diff (402 bytes) - added by wlux 12 years ago.
The patch as a file
Portfile (3.3 KB) - added by wlux 12 years ago.
and the modified Portfile

Download all attachments as: .zip

Change History (9)

Changed 12 years ago by martini@…

Attachment: main.log added

log file for port

comment:1 Changed 12 years ago by martini@…

I found a workaround.
The problem is caused by a change in the png struct png_info which was removed in modern versions of libpng.
Documented in: http://stackoverflow.com/questions/10507610/libpng-1-5-10-error-dereferencing-pointer-to-incomplete-type

The png_info struct was removed from the png.h in 1.5.0 and now you should use this pointer with the png_get_* and png_set_* functions.
The png_info structure is designed to provide information about the PNG file. At one time, the fields of png_info were intended to be directly accessible to the user. However, this tended to cause problems with applications using dynamically loaded libraries, and as a result a set of interface functions for png_info (the png_get_*() and png_set_*() functions) was developed, and direct access to the png_info fields was deprecated..

So when libpng was upgraded to @1.5.12 all ports that depend on png_info broke. I found that libpng Revision 96302 is at version @1.4.12 which still has png_info. I downloaded the Portfile from browser:trunk/dports/graphics/libpng/Portfile?rev=96302 and build the old version of libpng and then windowmaker compiles just fine.

Windomaker should be patched in macports to account for the changes in 1.5.12, and probably should be changed in the original source as well.

Last edited 12 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:2 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: Windowmaker png removed
Port: windowmaker added; Windowmaker removed
Summary: Windowmaker @0.92.0 compile error png lib problem on Mac OS X 10.6.8 (Snow Leopard)windowmaker @0.92.0 compile error with libpng 1.5

comment:3 Changed 12 years ago by jean-philippe.humbert@…

Cc: jean-philippe.humbert@… added

Cc Me!

comment:4 Changed 12 years ago by wlux

I have been bitten by the just the same bug today. In order to fix WindowMaker, the following patch must be applied to wrlib/png.c:

--- wrlib/png.c.orig	2004-10-12 20:22:04.000000000 +0200
+++ wrlib/png.c	2012-10-08 19:41:57.000000000 +0200
@@ -97,7 +97,10 @@
     }
 
     RErrorCode = RERR_INTERNAL;
-    if (setjmp(png->jmpbuf)) {
+#ifndef png_jmpbuf
+# define png_jmpbuf(png) (png)->jmpbuf
+#endif
+    if (setjmp(png_jmpbuf(png))) {
         fclose(f);
         png_destroy_read_struct(&png, &pinfo, &einfo);
         if (image)
Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

Changed 12 years ago by wlux

Attachment: patch-wrlib_png.c.diff added

The patch as a file

Changed 12 years ago by wlux

Attachment: Portfile added

and the modified Portfile

comment:5 Changed 12 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

comment:6 Changed 12 years ago by jean-philippe.humbert@…

It works for me. Thanks.

Note: See TracTickets for help on using tickets.