From vivek@kciLink.com  Mon Jan 27 14:34:06 2014
Return-Path: <vivek@kciLink.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 7156C776
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 27 Jan 2014 14:34:06 +0000 (UTC)
Received: from yertle.kcilink.com (yertle-comcast.kcilink.com [74.92.149.58])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 3B8D51EEC
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 27 Jan 2014 14:34:05 +0000 (UTC)
Received: from vk-dev.int.kcilink.com (vk-dev.int.kcilink.com [192.168.7.96])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by yertle.kcilink.com (Postfix) with ESMTPS id E3C318A01B
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 27 Jan 2014 09:33:58 -0500 (EST)
Received: by vk-dev.int.kcilink.com (Postfix, from userid 1002)
	id E39686D425; Mon, 27 Jan 2014 09:33:41 -0500 (EST)
Message-Id: <20140127143341.E39686D425@vk-dev.int.kcilink.com>
Date: Mon, 27 Jan 2014 09:33:41 -0500 (EST)
From: Vivek Khera <vivek@khera.org>
Reply-To: Vivek Khera <vivek@khera.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: ImageMagick does not find freetype headers
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         186170
>Category:       ports
>Synopsis:       graphics/ImageMagick does not find freetype headers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    riggs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 27 14:40:01 UTC 2014
>Closed-Date:    Sun Feb 02 22:50:06 UTC 2014
>Last-Modified:  Sun Feb 02 22:50:06 UTC 2014
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->riggs 
Responsible-Changed-By: riggs 
Responsible-Changed-When: Sun Feb 2 16:26:53 UTC 2014 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=186170 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/186170: commit references a PR
Date: Sun,  2 Feb 2014 22:44:29 +0000 (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"
 
State-Changed-From-To: open->closed 
State-Changed-By: riggs 
State-Changed-When: Sun Feb 2 22:50:05 UTC 2014 
State-Changed-Why:  
Fix has been committed, see 
http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/186171 

http://www.freebsd.org/cgi/query-pr.cgi?pr=186170 
>Unformatted:
