Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 384069

Summary: sci-geosciences/grass-6.4.1[png] fails to compile agains media-libs/libpng-1.5.4
Product: Gentoo Linux Reporter: Martin von Gagern <Martin.vGagern>
Component: Current packagesAssignee: Steve Arnold <nerdboy>
Status: RESOLVED FIXED    
Severity: normal CC: hwoarang, sci-geosciences, zeekec
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 354479    
Attachments: emerge --info
build log (gziped)
Proposed patch

Description Martin von Gagern 2011-09-22 12:06:18 UTC
Created attachment 287399 [details]
emerge --info

The PNG code in the Grass release currently in portage apparently accesses structure members which have become private in the latest libpng bump:

r.out.png.c: In function ‘main’:
r.out.png.c:159:2: warning: format not a string literal and no format arguments
r.out.png.c:264:13: error: dereferencing pointer to incomplete type
r.out.png.c:265:13: error: dereferencing pointer to incomplete type
r.out.png.c:266:13: error: dereferencing pointer to incomplete type
r.out.png.c:306:11: error: dereferencing pointer to incomplete type
r.out.png.c:308:11: error: dereferencing pointer to incomplete type
r.out.png.c: In function ‘write_wld’:
r.out.png.c:455:5: warning: format not a string literal and no format arguments
r.out.png.c:458:2: warning: format not a string literal and no format arguments
r.out.png.c:460:2: warning: format not a string literal and no format arguments
r.out.png.c:462:2: warning: format not a string literal and no format arguments
make[2]: *** [OBJ.x86_64-pc-linux-gnu/r.out.png.o] Error 1
Comment 1 Martin von Gagern 2011-09-22 12:08:58 UTC
Created attachment 287401 [details]
build log (gziped)

Sorry, had to gzip that log, as it is too large to attach uncompressed.
Comment 2 Martin von Gagern 2011-09-25 00:56:04 UTC
Created attachment 287639 [details, diff]
Proposed patch

This makes grass compile for me. Changes are enclosed in preprocessor switches to ensure unchanged operation with older libpng, even though I assume that the  png_set_IHDR function has been around for a while now.
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2011-09-27 11:23:47 UTC
I dropped the #ifdef's because the code should work fine with libpng-1.2, 1.4 and 1.5

+  27 Sep 2011; Samuli Suominen <ssuominen@gentoo.org> grass-6.4.1.ebuild,
+  +files/grass-6.4.1-libpng15.patch:
+  Fix building with libpng15 wrt #384069 by Martin von Gagern
Comment 4 Martin von Gagern 2011-09-27 22:25:49 UTC
No need to take this upstream, as their trunk already takes care of this:
http://trac.osgeo.org/grass/changeset/43927
If you prefer the upstream patch over mine, you'll have to adjust the file name, but otherwise the patch will apply just as well. I don't care either way. Reminds me I should have had a look at their code before I wrote my own patch...