Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions setupext.py
Original file line number Diff line number Diff line change
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