Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use freetype-config if pkg-config is not installed #1941

Merged
merged 1 commit into from Apr 24, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 12 additions & 4 deletions setupext.py
Expand Up @@ -270,16 +270,23 @@ def set_pkgconfig_path(self):
os.environ['PKG_CONFIG_PATH'] = pkgconfig_path

def setup_extension(self, ext, package, default_include_dirs=[],
default_library_dirs=[], default_libraries=[]):
default_library_dirs=[], default_libraries=[],
alt_exec=None):
"""
Add parameters to the given `ext` for the given `package`.
"""
flag_map = {
'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}
command = "pkg-config --libs --cflags " + package

use_defaults = True
executable = alt_exec
if self.has_pkgconfig:
executable = 'pkg-config {0}'.format(package)

use_defaults = True

if executable is not None:
command = "{0} --libs --cflags ".format(executable)

try:
output = check_output(command, shell=True)
except subprocess.CalledProcessError:
Expand Down Expand Up @@ -752,7 +759,8 @@ def add_flags(self, ext):
'lib/freetype2/include/freetype2'],
default_library_dirs=[
'freetype2/lib'],
default_libraries=['freetype', 'z'])
default_libraries=['freetype', 'z'],
alt_exec='freetype-config')


class FT2Font(SetupPackage):
Expand Down