Inkscape: A Vector Drawing Tool

inkscape fails to build against libpng 1.5

Reported by Hanno Böck on 2011-02-18
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Jon A. Cruz
inkscape (Debian)
Fix Released
Unknown

Bug Description

Compilation fails against libpng 1.5. Reason is stricter type checking, I'll attach a patch

Related branches

Hanno Böck (hanno-hboeck) wrote :
~suv (suv-lp) on 2011-02-18
tags: added: build
Changed in inkscape:
milestone: none → 0.49
~suv (suv-lp) wrote :

Needs verification that it doesn't break building against older libpng versions (1.2, 1.4).

~suv (suv-lp) wrote :

(notes from #inkscape talking with JonCruz)

Unfortunately it will break building against older libpng.

What we did in ImageMagick:

    ...
    #if (PNG_LIBPNG_VER < 10500)
          png_charp
            info;
    #else
          png_bytep
            info;
    #endif
    ...
                     {
                           png_set_iCCP(ping,ping_info,(const png_charp) name,0,
    #if (PNG_LIBPNG_VER < 10500)
                             (png_charp) GetStringInfoDatum(profile),
    #else
                             (png_const_bytep) GetStringInfoDatum(profile),
    #endif
                             (png_uint_32) GetStringInfoLength(profile));

~suv (suv-lp) on 2011-02-18
Changed in inkscape:
importance: Undecided → Medium
~suv (suv-lp) on 2011-02-20
Changed in inkscape:
assignee: nobody → Jon A. Cruz (jon-joncruz)
status: New → Triaged
Changed in inkscape:
status: Triaged → In Progress
Jon A. Cruz (jon-joncruz) wrote :

Fix committed as of revision 10061.

Changed in inkscape:
status: In Progress → Fix Committed
~suv (suv-lp) wrote :

r10061 built ok with libpng 1.2.43 and libpng 1.4.5
(tested on OS X 10.5.8 (i386) using separate MacPorts trees for the dependencies).

Hanno Böck (hanno-hboeck) wrote :

Seems there are some more issues with libpng 1.5, will post a patch.

Changed in inkscape:
status: Fix Committed → Incomplete
Hanno Böck (hanno-hboeck) wrote :
~suv (suv-lp) on 2011-02-21
Changed in inkscape:
status: Incomplete → In Progress
Dmitry Dzhus (dzhus) wrote :

Will #8 patch be merged intro trunk?

~suv (suv-lp) wrote :

> Will #8 patch be merged intro trunk?

Needs verification that it doesn't break building against older versions of libpng, and #ifdef'ed accordingly if needed.

Dmitry Dzhus (dzhus) wrote :

Builds fine with libpng-1.4.2.

~suv (suv-lp) wrote :

Builds fine with libpng-1.2.43 (OS X 10.5.8 i386)

See also:
« Changes to Libpng from version 1.2.42 to 1.4.0 (January 4, 2010)
(…)
5. Other changes
(…)
   d. Direct access to png_ptr->jmpbuf has been deprecated since libpng
      version 1.0.6, and libpng now generates a warning about it.

      To avoid such warnings, change
        setjmp(png_ptr->jmpbuf)

      to
        setjmp(png_jmpbuf(png_ptr))
(…)»
<http://www.libpng.org/pub/png/src/libpng-1.2.x-to-1.4.x-summary.txt>

Jeff Kowalczyk (jfkw) wrote :

Adding my note here instead of opening a new bug:

On Gentoo Linux ~amd64, I have libpng version 1.2.46 1.4.8 1.5.5 installed in their respective slots, e.g. Google Chrome depends on libpng-1.2. Inkscape was building OK with libpng-1.4, but on 2011-09-18 when libpng-1.5 was first added to my system, Inkscape subsequently tries to build against 1.5, but fails with the following error:

  CXX helper/png-write.o
x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/freetype2 -fopenmp -I/usr/include/ImageMagick -I/usr/inc
lude/libwpg-0.2 -I/usr/include/libwpd-0.9 -I/usr/include/poppler -pthread -I/usr/include/poppler/glib -I/usr/include/pop
pler -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/cairo -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/inc
lude -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/libd
rm -I/usr/include/pango-1.0 -DPOTRACE=\"potrace\" -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/inclu
de/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/includ
e/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/libdrm -I/usr/include/libxm
l2 -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include -I/usr/include/gtkspell-2.0 -I/usr/include/glibmm-2.4 -I/usr/lib64
/glibmm-2.4/include -I/usr/include/giomm-2.4 -I/usr/lib64/giomm-2.4/include -I/usr/include/gdkmm-2.4 -I/usr/lib64/gdkmm-2.4/inc
lude -I/usr/include/pangomm-1.4 -I/usr/lib64/pangomm-1.4/include -I/usr/include/cairomm-1.0 -I/usr/lib64/cairomm-1.0/include -I
/usr/include/gtkmm-2.4 -I/usr/lib64/gtkmm-2.4/include -I/usr/include/atkmm-1.6 -I/usr/include/gtk-unix-print-2.0 -I../cxxtest
  -I./bind/javainc -I./bind/javainc/linux -I./extension/dbus -Werror=format-security -Wall -Wformat -Wformat-security -W -D_F
ORTIFY_SOURCE=2 -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch -Wno-unused-parameter -march=core2
-O2 -pipe -fno-strict-aliasing -fopenmp -c -o helper/png-write.o helper/png-write.cpp
helper/png-write.cpp: In function ‘bool sp_png_write_rgba_striped(SPDocument*, const gchar*, long unsigned int, long unsigned i
nt, double, double, int (*)(const guchar**, void**, int, int, void*), void*)’:
helper/png-write.cpp:169:9: error: invalid use of incomplete type ‘struct png_struct’
/usr/include/libpng15/png.h:830:16: error: forward declaration of ‘struct png_struct’

Jon A. Cruz (jon-joncruz) wrote :

Fixed in trunk revision #10707.

Changed in inkscape:
status: In Progress → Fix Committed
Changed in inkscape (Debian):
status: Unknown → Confirmed
~suv (suv-lp) wrote :
tags: added: backport-proposed
~suv (suv-lp) wrote :

>> added: backport-proposed

See also:
<quote>
 Would need some hacking to be buildable with libpng15
 https://bugs.launchpad.net/inkscape/+bug/721029
 (still not buildable as of 0.48.3)
</quote>
<http://fink.cvs.sourceforge.net/viewvc/fink/dists/10.7/stable/main/finkinfo/graphics/inkscape.info?annotate=1.2#l150>

ScislaC (scislac) wrote :

Backported to 0.48.x branch, r9907.

Changed in inkscape:
milestone: 0.49 → 0.48.4
~suv (suv-lp) on 2012-08-14
tags: removed: backport-proposed
Ted Gould (ted) on 2012-12-17
Changed in inkscape:
status: Fix Committed → Fix Released
Changed in inkscape (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.