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
Created attachment 287401 [details] build log (gziped) Sorry, had to gzip that log, as it is too large to attach uncompressed.
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.
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
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...