diff options
author | Russell Keith-Magee <russell@keith-magee.com> | 2024-03-28 07:59:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-28 07:59:33 (GMT) |
commit | f006338017cfbf846e8f7391b9ee5f69df8dc620 (patch) | |
tree | 6db12f901d882f53401dc2d3fafbe101c2b8fdbc /Lib/sysconfig | |
parent | b44898299a2ed97045c270f6474785da2ff07ced (diff) | |
download | cpython-f006338017cfbf846e8f7391b9ee5f69df8dc620.zip cpython-f006338017cfbf846e8f7391b9ee5f69df8dc620.tar.gz cpython-f006338017cfbf846e8f7391b9ee5f69df8dc620.tar.bz2 |
gh-114099: Additions to standard library to support iOS (GH-117052)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Ned Deily <nad@python.org>
Diffstat (limited to 'Lib/sysconfig')
-rw-r--r-- | Lib/sysconfig/__init__.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py index 07ab27c..70bdecf 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py @@ -21,6 +21,7 @@ __all__ = [ # Keys for get_config_var() that are never converted to Python integers. _ALWAYS_STR = { + 'IPHONEOS_DEPLOYMENT_TARGET', 'MACOSX_DEPLOYMENT_TARGET', } @@ -57,6 +58,7 @@ _INSTALL_SCHEMES = { 'scripts': '{base}/Scripts', 'data': '{base}', }, + # Downstream distributors can overwrite the default install scheme. # This is done to support downstream modifications where distributors change # the installation layout (eg. different site-packages directory). @@ -114,8 +116,8 @@ def _getuserbase(): if env_base: return env_base - # Emscripten, VxWorks, and WASI have no home directories - if sys.platform in {"emscripten", "vxworks", "wasi"}: + # Emscripten, iOS, tvOS, VxWorks, WASI, and watchOS have no home directories + if sys.platform in {"emscripten", "ios", "tvos", "vxworks", "wasi", "watchos"}: return None def joinuser(*args): @@ -290,6 +292,7 @@ def _get_preferred_schemes(): 'home': 'posix_home', 'user': 'osx_framework_user', } + return { 'prefix': 'posix_prefix', 'home': 'posix_home', @@ -623,10 +626,15 @@ def get_platform(): if m: release = m.group() elif osname[:6] == "darwin": - import _osx_support - osname, release, machine = _osx_support.get_platform_osx( - get_config_vars(), - osname, release, machine) + if sys.platform == "ios": + release = get_config_vars().get("IPHONEOS_DEPLOYMENT_TARGET", "12.0") + osname = sys.platform + machine = sys.implementation._multiarch + else: + import _osx_support + osname, release, machine = _osx_support.get_platform_osx( + get_config_vars(), + osname, release, machine) return f"{osname}-{release}-{machine}" |