diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8fd9eb9..fc4a013 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -121,7 +121,7 @@ jobs: make ${{ matrix.target }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }} - name: Upload build artefacts - uses: actions/upload-artifact@v4.4.0 + uses: actions/upload-artifact@v4.4.3 with: name: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz path: dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz diff --git a/Makefile b/Makefile index fc1e8f5..36326ff 100644 --- a/Makefile +++ b/Makefile @@ -129,8 +129,10 @@ ARCH-$(target)=$$(subst .,,$$(suffix $(target))) ifneq ($(os),macOS) ifeq ($$(findstring simulator,$$(SDK-$(target))),) TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(OS_LOWER-$(target))$$(VERSION_MIN-$(os)) +IS_SIMULATOR-$(target)="False" else TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(OS_LOWER-$(target))$$(VERSION_MIN-$(os))-simulator +IS_SIMULATOR-$(target)="True" endif endif @@ -323,6 +325,9 @@ $$(PYTHON_SITECUSTOMIZE-$(target)): cat $(PROJECT_DIR)/patch/Python/sitecustomize.$(os).py \ | sed -e "s/{{os}}/$(os)/g" \ | sed -e "s/{{arch}}/$$(ARCH-$(target))/g" \ + | sed -e "s/{{version_min}}/$$(VERSION_MIN-$(os))/g" \ + | sed -e "s/{{is_simulator}}/$$(IS_SIMULATOR-$(target))/g" \ + | sed -e "s/{{multiarch}}/$$(ARCH-$(target))-$$(SDK-$(target))/g" \ | sed -e "s/{{tag}}/$$(OS_LOWER-$(target))-$$(VERSION_MIN-$(os))-$$(ARCH-$(target))-$$(SDK-$(target))/g" \ > $$(PYTHON_SITECUSTOMIZE-$(target)) diff --git a/patch/Python/sitecustomize.iOS.py b/patch/Python/sitecustomize.iOS.py index d7d86e3..ccc291f 100644 --- a/patch/Python/sitecustomize.iOS.py +++ b/patch/Python/sitecustomize.iOS.py @@ -2,6 +2,7 @@ # packages cross-platform. If the folder containing this file is on # your PYTHONPATH when you invoke pip, pip will behave as if it were # running on {{os}}. +import collections import distutils.ccompiler import distutils.unixccompiler import os @@ -16,7 +17,21 @@ def custom_system(): platform.system = custom_system -# Make sysconfig.get_platform() return "{{tag}}" +# Make platform.ios_ver() return an appropriate namedtuple +IOSVersionInfo = collections.namedtuple( + "IOSVersionInfo", + ["system", "release", "model", "is_simulator"] +) + +def custom_ios_ver(system="", release="", model="", is_simulator=False): + return IOSVersionInfo("{{os}}", "{{version_min}}", "iPhone", {{is_simulator}}) + +platform.ios_ver = custom_ios_ver + +# Make sys.implementation._multiarch return the multiarch description +sys.implementation._multiarch = "{{multiarch}}" + +# Make sysconfig.get_platform() return the platform tag def custom_get_platform(): return "{{tag}}"