Bug 186170 - graphics/ImageMagick does not find freetype headers
graphics/ImageMagick does not find freetype headers
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: Thomas Zander
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-27 14:40 UTC by Vick Khera
Modified: 2014-02-02 22:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vick Khera 2014-01-27 14:40:01 UTC
	
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

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.
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.
Comment 1 Thomas Zander freebsd_committer 2014-02-02 16:26:53 UTC
Responsible Changed
From-To: freebsd-ports-bugs->riggs

I'll take it.
Comment 2 dfilter freebsd_committer 2014-02-02 22:44:29 UTC
Author: riggs
Date: Sun Feb  2 22:44:22 2014
New Revision: 342371
URL: http://svnweb.freebsd.org/changeset/ports/342371
QAT: https://qat.redports.org/buildarchive/r342371/

Log:
  - Adjust location of freetype headers in ImageMagick sources
  - Bump PORTREVISION
  
  Note that this is a stop-gap to avoid runtime errors with ImageMagick.
  It allows for working pkg builds with default PREFIX/LOCALBASE.
  A more substantial rework and upgrade of the ImageMagick port needs to be conducted.
  
  PR:		ports/186170, ports/186171
  Submitted by:	Vivek Khera <vivek@khera.org>, Alexander Panyushkin <vsityz@gmail.com>
  Approved by:	mentor (thierry)
  MFH:		2014Q1

Modified:
  head/graphics/ImageMagick/Makefile

Modified: head/graphics/ImageMagick/Makefile
==============================================================================
--- head/graphics/ImageMagick/Makefile	Sun Feb  2 22:31:11 2014	(r342370)
+++ head/graphics/ImageMagick/Makefile	Sun Feb  2 22:44:22 2014	(r342371)
@@ -2,7 +2,7 @@
 
 PORTNAME=	ImageMagick
 DISTVERSION=	6.8.0-7
-PORTREVISION=	4
+PORTREVISION=	5
 PORTEPOCH=	1
 CATEGORIES=	graphics perl5
 MASTER_SITES=	http://www.imagemagick.org/download/ \
@@ -397,6 +397,12 @@ post-patch:
 # deprecated gvCleanup
 	@${REINPLACE_CMD} -e "s|gvCleanup|gvFreeContext|g" \
 		${WRKSRC}/coders/dot.c
+# freetype headers are in freetype2/ nowadays
+	@${REINPLACE_CMD} -e "s|freetype/|freetype2/|g" \
+		${WRKSRC}/configure \
+		${WRKSRC}/coders/ttf.c \
+		${WRKSRC}/magick/annotate.c \
+		${WRKSRC}/www/api/MagickCore/annotate_8c.html
 
 pre-configure:
 .if defined(_IMAGEMAGICK_THREADS_PERL_MSG)
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Thomas Zander freebsd_committer 2014-02-02 22:50:05 UTC
State Changed
From-To: open->closed

Fix has been committed, see 
http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/186171