@@ -428,7 +428,9 @@ def _check_for_pkg_config(self, package, include_file, min_version=None,
428
428
`min_version` is the minimum version required.
429
429
430
430
`version` will override the found version if this package
431
- requires an alternate method for that.
431
+ requires an alternate method for that. Set version='unknown'
432
+ if the version is not known but you still want to disabled
433
+ pkg_config version check.
432
434
"""
433
435
if version is None :
434
436
version = pkg_config .get_version (package )
@@ -442,7 +444,7 @@ def _check_for_pkg_config(self, package, include_file, min_version=None,
442
444
raise CheckFailed (
443
445
"Requires patches that have not been merged upstream." )
444
446
445
- if min_version :
447
+ if min_version and version != 'unknown' :
446
448
if (not is_min_version (version , min_version )):
447
449
raise CheckFailed (
448
450
"Requires %s %s or later. Found %s." %
@@ -895,12 +897,15 @@ def check(self):
895
897
if version is None or 'No such file or directory\n grep:' in version :
896
898
version = self .version_from_header ()
897
899
900
+ # pkg_config returns the libtool version rather than the
901
+ # freetype version so we need to explicitly pass the version
902
+ # to _check_for_pkg_config
898
903
return self ._check_for_pkg_config (
899
904
'freetype2' , 'ft2build.h' ,
900
905
min_version = '2.3' , version = version )
901
906
902
907
def version_from_header (self ):
903
- version = 'Failed to identify version. '
908
+ version = 'unknown '
904
909
ext = self .get_extension ()
905
910
if ext is None :
906
911
return version
0 commit comments