Discussion:
[blfs-support] libpng-1.6.2 netpbm patch
lux-integ
2013-09-11 09:43:45 UTC
Permalink
Greetings,

I am trying to compile netbpm ( I know it is not in the blfs book ) and I
keep running into a problem of incompatibility with my existing libpng
(version 1.6.2 )

make ends like this:-
#--------------

pnmtopng.c:2746:15: error: dereferencing pointer to incomplete type
info_ptr->num_text = 0;
^
pnmtopng.c:2750:15: error: dereferencing pointer to incomplete type
info_ptr->valid &= ~PNG_INFO_tIME;
^
pnmtopng.c: In function 'displayVersion':
pnmtopng.c:2814:13: error: 'ZLIB_VERSION' undeclared (first use in this
function)
ZLIB_VERSION);
^
make[2]: *** [pnmtopng.o] Error 1
make[2]: Leaving directory
`/home/linteg/netpbm_Aug2013_stable/converter/other'
#-------

I tried different versions of netpbm beginning with 'stable' version 10.35.89
and ending with the august2013 (svn revision2000 I think ) all have a problem
with libpng-1.6.2. I tried searching for a suitable patch to no avail. If
anyone one list knows of a suitable patch for netpbm to compile libpng-1.6.2 I
would be grateful for a copy.
( or for that matter any other useful advice )
many thanks in advance.

sincerely
luxInteg
David Brodie
2013-09-11 12:04:28 UTC
Permalink
Post by lux-integ
Greetings,
I am trying to compile netbpm ( I know it is not in the blfs book ) and I
keep running into a problem of incompatibility with my existing libpng
(version 1.6.2 )
make ends like this:-
#--------------
pnmtopng.c:2746:15: error: dereferencing pointer to incomplete type
info_ptr->num_text = 0;
^
pnmtopng.c:2750:15: error: dereferencing pointer to incomplete type
info_ptr->valid &= ~PNG_INFO_tIME;
^
pnmtopng.c:2814:13: error: 'ZLIB_VERSION' undeclared (first use in this
function)
ZLIB_VERSION);
^
make[2]: *** [pnmtopng.o] Error 1
make[2]: Leaving directory
`/home/linteg/netpbm_Aug2013_stable/converter/other'
#-------
I tried different versions of netpbm beginning with 'stable' version 10.35.89
and ending with the august2013 (svn revision2000 I think ) all have a problem
with libpng-1.6.2. I tried searching for a suitable patch to no avail. If
anyone one list knows of a suitable patch for netpbm to compile libpng-1.6.2 I
would be grateful for a copy.
( or for that matter any other useful advice )
many thanks in advance.
The easiest thing to try would be to install libpng-1.5.?? (the latest
1.5 version) and build netpbm, then re-install libpng-1.6.2, without
removing the 1.5.?? version - if you run 'ldd' on the netpbm binary you
should see a line something like:

libpng15.so.15 => /usr/lib/libpng15.so.15 (0xb54f6000)

so it should work, even though the link for libpng.so on /usr/lib now
points to libpng16.so

David
lux-integ
2013-09-11 12:25:43 UTC
Permalink
Post by David Brodie
The easiest thing to try would be to install libpng-1.5.?? (the latest
1.5 version) and build netpbm, then re-install libpng-1.6.2
would I need to FIRST remove the existing libpng-1.6.2 ?
And if so would any breakage be 'fixed' after reinstllation ( i.e.
libpng-1.6.2installation-post -netpbm -

please advise
David Brodie
2013-09-12 08:19:34 UTC
Permalink
Post by lux-integ
Post by David Brodie
The easiest thing to try would be to install libpng-1.5.?? (the latest
1.5 version) and build netpbm, then re-install libpng-1.6.2
would I need to FIRST remove the existing libpng-1.6.2 ?
And if so would any breakage be 'fixed' after reinstllation ( i.e.
libpng-1.6.2installation-post -netpbm -
please advise
It shouldn't be necessary to remove 1.6.2 first; also the
re-installation of 1.6.2 will update the symlinks in /usr/lib and
elsewhere to point to the 1.6.2 versioned files.

David
lux-integ
2013-09-11 12:48:55 UTC
Permalink
Post by David Brodie
The easiest thing to try would be to install libpng-1.5.?? (the latest
1.5 version) and build netpbm, then re-install libpng-1.6.2, without
removing the 1.5.?? version - if you run 'ldd' on the netpbm binary you
libpng15.so.15 => /usr/lib/libpng15.so.15 (0xb54f6000)
so it should work, even though the link for libpng.so on /usr/lib now
points to libpng16.so
I could think of another way that minimise risks of breakages
suppose one:-

--a) sets a prefix for netpbm say NETPMBPLACE=/path/to/somewhere
--b) installs say libpng-1.5.17 to say $NETPMBPLACE/lib
--d) configures the netpbm sources to look in $NETPMBPLACE/lib for libpng (
this is the tricky part -as netpbm does not use autotools, waf, cmake i.e. a
modern well-documented build system )

I do not know
if one could then set a PKG_CONFIG_PATH=$NETPMBPLACE/lib/pkgconfig
THEN if one could insert a line such as this
LIBPNG = $NETPMBPLACE/lib/libpng.so
PNGHDR_DIR = `pkg-config --variable=includedir libpng`
PNGVER = 1.5.17

in a created
Makefile.config

as examplified here:-
( http://cblfs.cross-lfs.org/index.php/Netpbm) )

could one?

please advice

sincerely
luxInteg
David Brodie
2013-09-12 08:20:07 UTC
Permalink
Post by lux-integ
Post by David Brodie
The easiest thing to try would be to install libpng-1.5.?? (the latest
1.5 version) and build netpbm, then re-install libpng-1.6.2, without
removing the 1.5.?? version - if you run 'ldd' on the netpbm binary you
libpng15.so.15 => /usr/lib/libpng15.so.15 (0xb54f6000)
so it should work, even though the link for libpng.so on /usr/lib now
points to libpng16.so
I could think of another way that minimise risks of breakages
suppose one:-
--a) sets a prefix for netpbm say NETPMBPLACE=/path/to/somewhere
--b) installs say libpng-1.5.17 to say $NETPMBPLACE/lib
--d) configures the netpbm sources to look in $NETPMBPLACE/lib for libpng (
this is the tricky part -as netpbm does not use autotools, waf, cmake i.e. a
modern well-documented build system )
I do not know
if one could then set a PKG_CONFIG_PATH=$NETPMBPLACE/lib/pkgconfig
THEN if one could insert a line such as this
LIBPNG = $NETPMBPLACE/lib/libpng.so
PNGHDR_DIR = `pkg-config --variable=includedir libpng`
PNGVER = 1.5.17
in a created
Makefile.config
as examplified here:-
( http://cblfs.cross-lfs.org/index.php/Netpbm) )
could one?
please advice
sincerely
luxInteg
You could, in theory, hack the build files, but I think it is simpler to
install both versions - for example, my (fairly old) OpenSuSE system has
libpng 1.2, 1.3, and 1.4 installed.

The linker will either use the option '-lpng' directly, or use pkgconfig
with 'libpng.pc' in /usr/lib/pkgconfig, so in either case it will pick
up the last version you installed, via the respective symlinks.

David
lux-integ
2013-09-12 12:27:37 UTC
Permalink
Post by David Brodie
You could, in theory, hack the build files, but I think it is simpler to
install both versions - for example, my (fairly old) OpenSuSE system has
libpng 1.2, 1.3, and 1.4 installed.
I set a prefix NETPBMPLACE=where/netpbm/will/live
I Installed libpng (1.5.17,1.4.12 ansd 1.2.50 to $NETPBMPLACE
BUT no matter what I did for example:
--a) set PKG_CONFIG_PATH=$NETPBMPLACE/lib/pkgconfig
--b) set CPPFLAGS="-I$NETPBMPLACE/include ...."
--c) edited Makefile,.config (after running ./configure ) with
LIBPNG = $NETPMBPLACE/lib/libpng.so
PNGHDR_DIR = `pkg-config --variable=includedir libpng`
PNGVER = 1.2.50

netpbm refused to budge ; even when it acknowledges the set flags. it
seems hardcoded only to see libpng in /usr/lib and png.h in /usr/include and
not greater than version1.4

SO I had to call on my friend jimmy 'thepeterman' who
parked /usr/include/libpng16 and linked $NETPBMPLACE/include/libpng12 in its
place and , removed /usr/inclue/libpng.so and made one to
$NETPBMPLACE/lib/libing12.so X

and lo the buildsystem lock of netpbm was fooled
afterwhich
jimmy restored
and took the cash
David Brodie
2013-09-12 13:53:08 UTC
Permalink
On 12/09/13 12:27, lux-integ wrote:
...
Post by lux-integ
netpbm refused to budge ; even when it acknowledges the set flags. it
seems hardcoded only to see libpng in /usr/lib and png.h in /usr/include and
not greater than version1.4
which are symlinks to the files for the current (or last installed)
version. Ditto /usr/lib/pkgconfig/libpng.pc . That way any package
compiling or linking against libpng gets the latest version
automatically. Anyway, it's your system. ;)

Loading...