Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Strip out pkg-config machinery for agg and libqhull. #11984

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

Merged
merged 1 commit into from
Oct 12, 2018
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
71 changes: 23 additions & 48 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,6 @@ def _check_for_pkg_config(self, package, include_file, min_version=None,
"pkg-config information for '%s' could not be found." %
package)

if min_version == 'PATCH':
raise CheckFailed(
"Requires patches that have not been merged upstream.")

if min_version and version != 'unknown':
if not is_min_version(version, min_version):
raise CheckFailed(
Expand Down Expand Up @@ -893,33 +889,23 @@ def get_install_requires(self):
class LibAgg(SetupPackage):
name = 'libagg'

def check(self):
self.__class__.found_external = True
try:
return self._check_for_pkg_config(
'libagg', 'agg2/agg_basics.h', min_version='PATCH')
except CheckFailed as e:
self.__class__.found_external = False
return str(e) + ' Using local copy.'

def add_flags(self, ext, add_sources=True):
if self.found_external:
pkg_config.setup_extension(ext, 'libagg')
else:
ext.include_dirs.insert(0, 'extern/agg24-svn/include')
if add_sources:
agg_sources = [
'agg_bezier_arc.cpp',
'agg_curves.cpp',
'agg_image_filters.cpp',
'agg_trans_affine.cpp',
'agg_vcgen_contour.cpp',
'agg_vcgen_dash.cpp',
'agg_vcgen_stroke.cpp',
'agg_vpgen_segmentator.cpp'
]
ext.sources.extend(
os.path.join('extern', 'agg24-svn', 'src', x) for x in agg_sources)
# We need a patched Agg not available elsewhere, so always use the
# vendored version.
ext.include_dirs.insert(0, 'extern/agg24-svn/include')
if add_sources:
agg_sources = [
'agg_bezier_arc.cpp',
'agg_curves.cpp',
'agg_image_filters.cpp',
'agg_trans_affine.cpp',
'agg_vcgen_contour.cpp',
'agg_vcgen_dash.cpp',
'agg_vcgen_stroke.cpp',
'agg_vpgen_segmentator.cpp'
]
ext.sources.extend(os.path.join('extern', 'agg24-svn', 'src', x)
for x in agg_sources)


class FreeType(SetupPackage):
Expand Down Expand Up @@ -1202,25 +1188,14 @@ def get_extension(self):
class Qhull(SetupPackage):
name = "qhull"

def check(self):
self.__class__.found_external = True
try:
return self._check_for_pkg_config(
'libqhull', 'libqhull/qhull_a.h', min_version='2015.2')
except CheckFailed as e:
self.__class__.found_pkgconfig = False
self.__class__.found_external = False
return str(e) + ' Using local copy.'

def add_flags(self, ext):
if self.found_external:
pkg_config.setup_extension(ext, 'qhull',
default_libraries=['qhull'])
else:
ext.include_dirs.insert(0, 'extern')
ext.sources.extend(sorted(glob.glob('extern/libqhull/*.c')))
if sysconfig.get_config_var('LIBM') == '-lm':
ext.libraries.extend('m')
# Qhull doesn't distribute pkg-config info, so we have no way of
# knowing whether a system install is recent enough. Thus, always use
# the vendored version.
ext.include_dirs.insert(0, 'extern')
ext.sources.extend(sorted(glob.glob('extern/libqhull/*.c')))
if sysconfig.get_config_var('LIBM') == '-lm':
ext.libraries.extend('m')


class TTConv(SetupPackage):
Expand Down