@@ -427,7 +427,9 @@ def _check_for_pkg_config(self, package, include_file, min_version=None,
427
427
`min_version` is the minimum version required.
428
428
429
429
`version` will override the found version if this package
430
- requires an alternate method for that.
430
+ requires an alternate method for that. Set version='unknown'
431
+ if the version is not known but you still want to disabled
432
+ pkg_config version check.
431
433
"""
432
434
if version is None :
433
435
version = pkg_config .get_version (package )
@@ -441,7 +443,7 @@ def _check_for_pkg_config(self, package, include_file, min_version=None,
441
443
raise CheckFailed (
442
444
"Requires patches that have not been merged upstream." )
443
445
444
- if min_version :
446
+ if min_version and version != 'unknown' :
445
447
if (not is_min_version (version , min_version )):
446
448
raise CheckFailed (
447
449
"Requires %s %s or later. Found %s." %
@@ -956,12 +958,15 @@ def check(self):
956
958
if version is None or 'No such file or directory\n grep:' in version :
957
959
version = self .version_from_header ()
958
960
961
+ # pkg_config returns the libtool version rather than the
962
+ # freetype version so we need to explicitly pass the version
963
+ # to _check_for_pkg_config
959
964
return self ._check_for_pkg_config (
960
965
'freetype2' , 'ft2build.h' ,
961
966
min_version = '2.3' , version = version )
962
967
963
968
def version_from_header (self ):
964
- version = 'Failed to identify version. '
969
+ version = 'unknown '
965
970
ext = self .get_extension ()
966
971
if ext is None :
967
972
return version
0 commit comments