Build failure with freetype 2.5.1

Bug #1255830 reported by su_v on 2013-11-28
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Medium
su_v
inkscape (Debian)
Fix Released
Unknown

Bug Description

Just released freetype 2.5.1 has changed the header file layout:
<quote>
    - The header file layout has been changed. After installation,
      all files are now located in `<prefix>/include/freetype2'.

      Applications that use (a) `freetype-config' or FreeType's
      `pkg-config' file to get the include directory for the compiler,
      and (b) the documented way for header inclusion like

        #include <ft2build.h>
        #include FT_FREETYPE_H
        ...

      don't need any change to the source code.
</quote>
<http://lists.nongnu.org/archive/html/freetype-announce/2013-11/msg00001.html>

Despite detecting 'freetype-config' correctly when rerunning configure, inkscape trunk r12832 failed to build on OS X 10.7.5 after upgrading freetype to 2.5.1. Running 'make -k' fails with these errors:

  CXX sp-text.o
In file included from sp-text.cpp:31:
./libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [sp-text.o] Error 1

  CXX display/drawing-text.o
In file included from ./libnrtype/font-instance.h:8,
                 from display/drawing-text.cpp:19:
./libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [display/drawing-text.o] Error 1

  CXX extension/internal/pdfinput/svg-builder.o
In file included from ./libnrtype/font-instance.h:8,
                 from extension/internal/pdfinput/svg-builder.cpp:40:
./libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [extension/internal/pdfinput/svg-builder.o] Error 1

  CXX libnrtype/FontFactory.o
In file included from libnrtype/FontFactory.cpp:19:
./libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [libnrtype/FontFactory.o] Error 1
  CXX libnrtype/FontInstance.o
In file included from ./libnrtype/font-instance.h:8,
                 from libnrtype/FontInstance.cpp:26:
./libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [libnrtype/FontInstance.o] Error 1
  CXX libnrtype/font-lister.o
In file included from ./libnrtype/font-instance.h:8,
                 from libnrtype/font-lister.cpp:8:
./libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [libnrtype/font-lister.o] Error 1
  CXX libnrtype/TextWrapper.o
In file included from ./libnrtype/font-instance.h:8,
                 from libnrtype/TextWrapper.cpp:12:
./libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [libnrtype/TextWrapper.o] Error 1
  CXX libnrtype/Layout-TNG-Compute.o
In file included from libnrtype/font-instance.h:8,
                 from libnrtype/Layout-TNG-Compute.cpp:13:
libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [libnrtype/Layout-TNG-Compute.o] Error 1
  CXX libnrtype/Layout-TNG-Input.o
In file included from libnrtype/Layout-TNG-Input.cpp:20:
libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [libnrtype/Layout-TNG-Input.o] Error 1
  CXX libnrtype/Layout-TNG-OutIter.o
In file included from libnrtype/font-instance.h:8,
                 from libnrtype/Layout-TNG-OutIter.cpp:13:
libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [libnrtype/Layout-TNG-OutIter.o] Error 1
  CXX libnrtype/Layout-TNG-Output.o
In file included from libnrtype/font-instance.h:8,
                 from libnrtype/Layout-TNG-Output.cpp:18:
libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [libnrtype/Layout-TNG-Output.o] Error 1

  CXX widgets/font-selector.o
In file included from ./libnrtype/font-instance.h:8,
                 from widgets/font-selector.cpp:25:
./libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [widgets/font-selector.o] Error 1

  CXX widgets/text-toolbar.o
In file included from widgets/../libnrtype/font-instance.h:8,
                 from widgets/text-toolbar.cpp:66:
widgets/../libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [widgets/text-toolbar.o] Error 1

  CXX ui/dialog/font-substitution.o
In file included from ui/dialog/font-substitution.cpp:48:
./libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [ui/dialog/font-substitution.o] Error 1

  CXX ui/dialog/glyphs.o
In file included from ./libnrtype/font-instance.h:8,
                 from ui/dialog/glyphs.cpp:35:
./libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [ui/dialog/glyphs.o] Error 1

  CXX ui/dialog/text-edit.o
In file included from ./libnrtype/font-instance.h:8,
                 from ui/dialog/text-edit.cpp:24:
./libnrtype/FontFactory.h:33:31: error: freetype/freetype.h: No such file or directory
make[3]: *** [ui/dialog/text-edit.o] Error 1

su_v (suv-lp) wrote :

Proposed patch (based on the comments in the release notes), tested successfully with Inkscape r12832, freetype 2.5.0 and 2.5.1 on OS X 10.7.5. Please review!

su_v (suv-lp) wrote :

Same fix backported to lp:inkscape/0.48.x: r9987+patch compiled successfully with freetype 2.4.10 and 2.5.1 on OS X 10.7.5. Please review.

su_v (suv-lp) wrote :

The new header layout has been planned in advanced. From the official tutorial:
<quote>

 1. Locate the FreeType 2 include directory.

 2. Include the file named ft2build.h.

 3. Include the main FreeType 2 API header file.

    You should do that using the macro FT_FREETYPE_H, like in the
    following example:

    #include <ft2build.h>
    #include FT_FREETYPE_H

    FT_FREETYPE_H is a special macro defined in the file ftheader.h. It
    contains some installation-specific macros to name other public
    header files of the FreeType 2 API.

<...>

 NOTE: Starting with FreeType 2.1.6, the old header file inclusion scheme
 is no longer supported. This means that you now get an error if you do
 something like the following:

   #include <freetype/freetype.h>
   #include <freetype/ftglyph.h>

</quote>
<http://www.freetype.org/freetype2/docs/tutorial/step1.html>

Possibly Inkscape needs to check for freetype >= 2.1.6 … (?)

su_v (suv-lp) wrote :

@JazzyNico - any chance you could test the patch on Windows?

--
(a similar patch has been just accepted and committed for GIMP stable and master, too)

jazzynico (jazzynico) wrote :

Patch tested successfully on Windows XP with Inkscape trunk revision 12832 and freetype-2.4.10.

I'm going to test with freetype-2.5.1 (not compiled yet).

jazzynico (jazzynico) wrote :

Tested successfully on Windows XP with freetype-2.5.1 (devlibs-gtk3).

Changed in inkscape:
assignee: nobody → ~suv (suv-lp)
importance: Undecided → Medium
milestone: none → 0.49
status: New → In Progress
su_v (suv-lp) wrote :

@JazzyNico - thx for testing!

Committed to trunk in r12833 and to stable 0.48.x in r9988.

Changed in inkscape:
milestone: 0.49 → 0.48.5
status: In Progress → Fix Committed
zoon01 (michael-zoon) on 2013-12-26
Changed in inkscape:
status: Fix Committed → New
jazzynico (jazzynico) wrote :

@zoon01 - The bug is fixed in the branch, but the patched version is not released yet. Please don't change the bug status unless you can tell us why.

Changed in inkscape:
status: New → Fix Committed
Changed in inkscape (Debian):
status: Unknown → Fix Released
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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