php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64405 Use freetype-config for determining freetype2 dir(s)
Submitted: 2013-03-11 12:45 UTC Modified: 2013-12-11 22:04 UTC
From: olemarkus@php.net Assigned: aharvey (profile)
Status: Closed Package: GD related
PHP Version: 5.4.12 OS:
Private report: No CVE-ID: None
 [2013-03-11 12:45 UTC] olemarkus@php.net
Description:
------------
Currently PHP does not use pkg-config to determine the location of freetype2 
header files. Instead it looks for freetype.h in a set of dirs. On e.g multilib 
systems this causes ./configure to fail when using --with-freetype-dir

pkg-config --cflags freetype2                                                                                                                                                                                                           
-I/usr/lib64/freetype2/include/freetype2 -I/usr/lib64/freetype2/include 

And header files like:
/usr/lib64/freetype2/include/ft2build.h
/usr/lib64/freetype2/include/freetype2/freetype/freetype.h

Downstream bug: https://bugs.gentoo.org/show_bug.cgi?id=459598


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-11 21:19 UTC] pgnet dot dev+phpbugs at gmail dot com
referencing my duplicate #66259, pkg-config or freetype-config are flexible options.  here, they produce different results:

	pkg-config --cflags --libs freetype2
		-I/usr/include/freetype2  -lfreetype  

	freetype-config --cflags --libs
		-I/usr/include/freetype2
		-lfreetype -lz -lpng15


a quick workaround @ php config-time, changing both

	perl -pi -e 's|(FREETYPE2_INC_DIR)=.*|$1=\$i/include|g'               ./configure
	perl -pi -e 's|freetype2/freetype/freetype.h|freetype2/freetype.h|g'  ./configure

and

	export CPPFLAGS="`pkg-config --cflags freetype2`"

which 'fixes' missing incorrect path references in GD ext, allows config & build to complete.
 [2013-12-11 22:04 UTC] aharvey@php.net
-Summary: Use pkg-config for determining freetype2 dir(s) +Summary: Use freetype-config for determining freetype2 dir(s) -Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 [2013-12-11 22:04 UTC] aharvey@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2013-12-20 03:23 UTC] vidurri at hotmail dot com
Solution in bug #66328 by Rafael Rocha Vidaurri

SOLUTION:
Let's search for the file on both directories replacing (on PHP "configure" file):
if test -f "$i/include/freetype2/freetype/freetype.h"; then

For:
if test -f "$i/include/freetype2/freetype/freetype.h" || test -f "$i/include/freetype2/freetype.h";  then


Bye ;)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 10 11:01:27 2024 UTC