python: detect Python from custom Xcode installations (#27023)
This commit is contained in:
parent
9094d6bb68
commit
80ba7040f8
1 changed files with 11 additions and 0 deletions
|
@ -797,6 +797,14 @@ def libs(self):
|
|||
# install libraries into a Frameworks directory
|
||||
frameworkprefix = self.config_vars['PYTHONFRAMEWORKPREFIX']
|
||||
|
||||
# Get the active Xcode environment's Framework location.
|
||||
macos_developerdir = os.environ.get('DEVELOPER_DIR')
|
||||
if macos_developerdir and os.path.exists(macos_developerdir):
|
||||
macos_developerdir = os.path.join(
|
||||
macos_developerdir, 'Library', 'Frameworks')
|
||||
else:
|
||||
macos_developerdir = ''
|
||||
|
||||
if '+shared' in self.spec:
|
||||
ldlibrary = self.config_vars['LDLIBRARY']
|
||||
|
||||
|
@ -806,6 +814,9 @@ def libs(self):
|
|||
return LibraryList(os.path.join(libpl, ldlibrary))
|
||||
elif os.path.exists(os.path.join(frameworkprefix, ldlibrary)):
|
||||
return LibraryList(os.path.join(frameworkprefix, ldlibrary))
|
||||
elif macos_developerdir and \
|
||||
os.path.exists(os.path.join(macos_developerdir, ldlibrary)):
|
||||
return LibraryList(os.path.join(macos_developerdir, ldlibrary))
|
||||
else:
|
||||
msg = 'Unable to locate {0} libraries in {1}'
|
||||
raise RuntimeError(msg.format(ldlibrary, libdir))
|
||||
|
|
Loading…
Reference in a new issue