Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jan 2014 09:33:41 -0500 (EST)
From:      Vivek Khera <vivek@khera.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/186170: ImageMagick does not find freetype headers
Message-ID:  <20140127143341.E39686D425@vk-dev.int.kcilink.com>
Resent-Message-ID: <201401271440.s0REe2tf065194@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         186170
>Category:       ports
>Synopsis:       ImageMagick does not find freetype headers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 27 14:40:01 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Vivek Khera
>Release:        FreeBSD 9.2-RELEASE-p3 amd64
>Organization:
>Environment:
System: FreeBSD vk-dev.int.kcilink.com 9.2-RELEASE-p3 FreeBSD 9.2-RELEASE-p3 #0 r260688: Wed Jan 15 12:29:34 EST 2014 khera@yertle.int.kcilink.com:/usr/obj/u/yertle1/sources/usr9/src/sys/KCI64 amd64


	
>Description:
	
The current version of Freetype installs headers into
/usr/local/include/freetype2, but the ImageMagick configure script looks for
them using a relative #incude <freetype/freetype.h> and cannot see them.

The old version of the library installed them into
/usr/local/include/freetype2/freetype. This permitted ImageMagick to find the
freetype2 headers, since the freetype-config adds
-I/usr/local/include/freetype2 to the config used for compiling against it.

With the new world order, ImageMagic determines that Freetype is not installed
and disables those features.  However, the dependency on freetype is still
maintained in the installed package.

Compare the output of the known "delegations" from the convert command, which
shows it no longer knows how to render fonts using freetype:

old version: ImageMagick-nox11-6.8.0.7_2 freetype2-2.5.0.1

% convert -list configure | grep DELEGATES
  DELEGATES     bzlib fftw fpx fontconfig freetype jbig jpeg jng jp2
  lcms2 lqr png tiff wmf zlib


new version: ImageMagick-nox11-6.8.0.7_4,1 freetype2-2.5.2

% convert -list configure | grep DELEGATES
  DELEGATES     bzlib fftw fpx fontconfig jbig jpeg jng jp2 lcms2 lqr
  png tiff wmf zlib


You can also see the configure script fails to find freetype during build:

checking for FreeType 2.0 ...
checking for freetype-config... /usr/local/bin/freetype-config
checking for FT_Init_FreeType in -lfreetype... yes
checking ft2build.h usability... yes
checking ft2build.h presence... yes
checking for ft2build.h... yes
checking for freetype/freetype.h... no
checking if FreeType package is complete... no -- some components failed test


>How-To-Repeat:
	

Build current ImageMagick-nox11 against freetype2-2.5.2 port and try to run
any command that renders fonts, such as this:

convert foo.jpg -background Orange -font Palatino-Roman label:'Faerie Dragon' +swap -gravity Center -append palatino.jpg

It will spew errors that look like this:

web: delegate library support not built-in
  `/usr/local/share/ghostscript/fonts/p052003l.pfb' (Freetype) @
  warning/annotate.c/RenderFreetype/1529.
web: delegate library support not built-in
  `/usr/local/share/ghostscript/fonts/p052003l.pfb' (Freetype) @
  warning/annotate.c/RenderFreetype/1529.
web: delegate library support not built-in

and the fonts will not be properly rendered.

>Fix:

	

My quick hack to fix my app server was to create a symlink
/usr/local/include/freetype that points to /usr/local/include/freetype2. This
results in ImageMagick finding the freetype headers, and thus building with
support for it:

checking for FreeType 2.0 ...
checking for freetype-config... /usr/local/bin/freetype-config
checking for FT_Init_FreeType in -lfreetype... yes
checking ft2build.h usability... yes
checking ft2build.h presence... yes
checking for ft2build.h... yes
checking for freetype/freetype.h... yes
checking if FreeType package is complete... yes

After building this way, the DELEGATES line from above shows freetype, and the
fonts show up in annotations requested from the library.
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140127143341.E39686D425>