makepanda: Backport Python 3.13t build fixes
This commit is contained in:
parent
12bb7d12bb
commit
dbeab0b97b
|
|
@ -876,7 +876,7 @@ def MakeInstallerFreeBSD(version, runtime=False, python_versions=[], **kwargs):
|
|||
oscmd("rm -f %s/tmp/python_dep" % outputdir)
|
||||
|
||||
if "PYTHONVERSION" in SDK:
|
||||
pyver_nodot = SDK["PYTHONVERSION"][6:].rstrip('dmu').replace('.', '')
|
||||
pyver_nodot = SDK["PYTHONVERSION"][6:].rstrip('dmut').replace('.', '')
|
||||
else:
|
||||
pyver_nodot = "%d%d" % (sys.version_info[:2])
|
||||
|
||||
|
|
|
|||
|
|
@ -2252,11 +2252,15 @@ def SdkLocatePython(prefer_thirdparty_python=False):
|
|||
sysroot = SDK.get("MACOSX", "")
|
||||
version = locations.get_python_version()
|
||||
|
||||
py_fwx = "{0}/System/Library/Frameworks/Python.framework/Versions/{1}".format(sysroot, version)
|
||||
framework_name = "Python"
|
||||
if 't' in abiflags:
|
||||
framework_name += "T"
|
||||
|
||||
py_fwx = "{0}/System/Library/Frameworks/{1}.framework/Versions/{2}".format(sysroot, framework_name, version)
|
||||
|
||||
if not os.path.exists(py_fwx):
|
||||
# Fall back to looking on the system.
|
||||
py_fwx = "/Library/Frameworks/Python.framework/Versions/" + version
|
||||
py_fwx = "/Library/Frameworks/{0}.framework/Versions/{1}".format(framework_name, version)
|
||||
|
||||
if not os.path.exists(py_fwx):
|
||||
# Newer macOS versions use this scheme.
|
||||
|
|
@ -3505,10 +3509,12 @@ def GetExtensionSuffix():
|
|||
else:
|
||||
dllext = ''
|
||||
|
||||
gil_disabled = locations.get_config_var("Py_GIL_DISABLED")
|
||||
suffix = 't' if gil_disabled and int(gil_disabled) else ''
|
||||
if GetTargetArch() == 'x64':
|
||||
return dllext + '.cp%d%d-win_amd64.pyd' % (sys.version_info[:2])
|
||||
return dllext + '.cp%d%d%s-win_amd64.pyd' % (sys.version_info[0], sys.version_info[1], suffix)
|
||||
else:
|
||||
return dllext + '.cp%d%d-win32.pyd' % (sys.version_info[:2])
|
||||
return dllext + '.cp%d%d%s-win32.pyd' % (sys.version_info[0], sys.version_info[1], suffix)
|
||||
|
||||
elif sys.version_info >= (3, 0):
|
||||
import _imp
|
||||
|
|
@ -3526,6 +3532,11 @@ def GetPythonABI():
|
|||
|
||||
soabi = 'cpython-%d%d' % (sys.version_info[:2])
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
gil_disabled = locations.get_config_var("Py_GIL_DISABLED")
|
||||
if gil_disabled and int(gil_disabled):
|
||||
return soabi + 't'
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
return soabi
|
||||
|
||||
|
|
@ -3655,7 +3666,7 @@ def GetCurrentPythonVersionInfo():
|
|||
return
|
||||
|
||||
return {
|
||||
"version": SDK["PYTHONVERSION"][6:].rstrip('dmu'),
|
||||
"version": SDK["PYTHONVERSION"][6:].rstrip('dmut'),
|
||||
"soabi": GetPythonABI(),
|
||||
"ext_suffix": GetExtensionSuffix(),
|
||||
"executable": sys.executable,
|
||||
|
|
|
|||
|
|
@ -20,6 +20,17 @@ from sysconfig import get_platform
|
|||
|
||||
|
||||
def get_abi_tag():
|
||||
if sys.version_info >= (3, 13):
|
||||
ver = 'cp%d%d' % sys.version_info[:2]
|
||||
if hasattr(sys, 'abiflags'):
|
||||
return ver + sys.abiflags
|
||||
|
||||
gil_disabled = get_config_var("Py_GIL_DISABLED")
|
||||
if gil_disabled and int(gil_disabled):
|
||||
return ver + 't'
|
||||
|
||||
return ver
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
soabi = get_config_var('SOABI')
|
||||
if soabi and soabi.startswith('cpython-'):
|
||||
|
|
@ -432,7 +443,8 @@ class WheelFile(object):
|
|||
continue
|
||||
new_dep = os.path.join(deps_path, os.path.relpath(target_dep, os.path.dirname(target_path)))
|
||||
|
||||
elif dep.startswith('/Library/Frameworks/Python.framework/'):
|
||||
elif dep.startswith('/Library/Frameworks/Python.framework/') or \
|
||||
dep.startswith('/Library/Frameworks/PythonT.framework/'):
|
||||
# Add this dependency if it's in the Python directory.
|
||||
target_dep = os.path.dirname(target_path) + '/' + os.path.basename(dep)
|
||||
target_dep = self.consider_add_dependency(target_dep, dep, loader_path)
|
||||
|
|
|
|||
Loading…
Reference in New Issue