Skip to content

Commit

Permalink
Fix freetype include path lookup -- don't use freetype-config since it
Browse files Browse the repository at this point in the history
seems to be broken.  Use that only for version determination.  Warn if
pkg-config is not present.
  • Loading branch information
mdboom committed Oct 7, 2014
1 parent fd9451c commit 8915c96
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions setupext.py
Expand Up @@ -253,6 +253,11 @@ def __init__(self):
self.set_pkgconfig_path()
status, output = getstatusoutput("pkg-config --help")
self.has_pkgconfig = (status == 0)
if not self.has_pkgconfig:
print("IMPORTANT WARNING:")
print(
" pkg-config is not installed.\n"
" matplotlib may not be able to find some of its dependencies")

def set_pkgconfig_path(self):
pkgconfig_path = sysconfig.get_config_var('LIBDIR')
Expand Down Expand Up @@ -981,19 +986,13 @@ def add_flags(self, ext):
pkg_config.setup_extension(
ext, 'freetype2',
default_include_dirs=[
'freetype2', 'lib/freetype2/include',
'include/freetype2', 'freetype2',
'lib/freetype2/include',
'lib/freetype2/include/freetype2'],
default_library_dirs=[
'freetype2/lib'],
default_libraries=['freetype', 'z'],
alt_exec='freetype-config')
default_libraries=['freetype', 'z'])

def get_extension(self):
if sys.platform == 'win32':
return None
ext = make_extension('freetype2', [])
self.add_flags(ext)
return ext


class FT2Font(SetupPackage):
Expand Down

2 comments on commit 8915c96

@frol
Copy link

@frol frol commented on 8915c96 Jul 19, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You seem to have broken FreeType again with this change. See this commit: #3067

The latest matplotlib looks for ft2build.h in .../include/ folders, but has to search in .../include/freetype2/.

The things are broken only for FreeType2 and only in case there is no installed pkg-config. This thing is broken for me on Ubuntu and OS X.

@tacaswell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going forward pkg-config is required to build matplotlib, this was added to the docs in #4463 but has not made it into a built version of the docs yet.

Please sign in to comment.