Skip to content

Commit 3d02e52

Browse files
committed
Use a separate OS.
1 parent fd14da2 commit 3d02e52

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

Makefile

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,45 @@ OPENSSL_VERSION=3.0.16-2
3434
XZ_VERSION=5.6.4-2
3535

3636
# Supported OS
37-
OS_LIST=macOS iOS tvOS watchOS visionOS
37+
OS_LIST=macOS iOS tvOS watchOS visionOS MacCatalyst
3838

3939
CURL_FLAGS=--disable --fail --location --create-dirs --progress-bar
4040

4141
# macOS targets
4242
TARGETS-macOS=macosx.x86_64 macosx.arm64
4343
TRIPLE_OS-macOS=macos
4444
VERSION_MIN-macOS=11.0
45+
CONFIGFLAGS-macOS=
4546

4647
# iOS targets
47-
TARGETS-iOS=iphonesimulator.x86_64 iphonesimulator.arm64 iphoneos.arm64 macabi.x86_64 macabi.arm64
48+
TARGETS-iOS=iphonesimulator.x86_64 iphonesimulator.arm64 iphoneos.arm64
4849
TRIPLE_OS-iOS=ios
4950
VERSION_MIN-iOS=13.0
50-
VERSION_MIN_OVERRIDE-macabi=14.2
51-
CONFIGFLAGS-macabi=--with-catalyst-macos-version=11.2
51+
CONFIGFLAGS-iOS=
5252

5353
# tvOS targets
5454
TARGETS-tvOS=appletvsimulator.x86_64 appletvsimulator.arm64 appletvos.arm64
5555
TRIPLE_OS-tvOS=tvos
5656
VERSION_MIN-tvOS=12.0
57+
CONFIGFLAGS-tvOS=
5758

5859
# watchOS targets
5960
TARGETS-watchOS=watchsimulator.x86_64 watchsimulator.arm64 watchos.arm64_32
6061
TRIPLE_OS-watchOS=watchos
6162
VERSION_MIN-watchOS=4.0
63+
CONFIGFLAGS-watchOS=
6264

65+
# visionOS targets
6366
TARGETS-visionOS=xrsimulator.arm64 xros.arm64
6467
TRIPLE_OS-visionOS=xros
6568
VERSION_MIN-visionOS=2.0
69+
CONFIGFLAGS-visionOS=
70+
71+
# Mac Catalyst Targets
72+
TARGETS-MacCatalyst=macabi.x86_64 macabi.arm64
73+
TRIPLE_OS-MacCatalyst=ios
74+
VERSION_MIN-MacCatalyst=14.2
75+
CONFIGFLAGS-MacCatalyst=--with-catalyst-macos-version=11.2
6676

6777
# The architecture of the machine doing the build
6878
HOST_ARCH=$(shell uname -m)
@@ -138,30 +148,17 @@ BASE-$(target)=$$(basename $(target))
138148
SDK-$(target)=$$(subst macabi,macosx,$$(BASE-$(target)))
139149
ARCH-$(target)=$$(subst .,,$$(suffix $(target)))
140150

141-
# Compute version minimum for the target
142-
VERSION_MIN-$(target)=$$(VERSION_MIN-$(os))
143-
ifdef VERSION_MIN_OVERRIDE-$$(BASE-$(target))
144-
VERSION_MIN-$(target)=$$(VERSION_MIN_OVERRIDE-$$(BASE-$(target)))
145-
endif
146-
147-
# Inherit the basename for the configure flags.
148-
ifdef CONFIGFLAGS-$$(BASE-$(target))
149-
CONFIGFLAGS-$(target)=$$(CONFIGFLAGS-$$(BASE-$(target)))
150-
else
151-
CONFIGFLAGS-$(target)=
152-
endif
153-
154151
ifneq ($(os),macOS)
155152
ifeq ($$(findstring simulator,$$(BASE-$(target))),)
156153
ifeq ($$(findstring macabi,$$(BASE-$(target))),)
157-
TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(TRIPLE_OS-$(os))$$(VERSION_MIN-$(target))
154+
TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(TRIPLE_OS-$(os))$$(VERSION_MIN-$(os))
158155
IS_SIMULATOR-$(target)=False
159156
else
160-
TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(TRIPLE_OS-$(os))$$(VERSION_MIN-$(target))-macabi
157+
TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(TRIPLE_OS-$(os))$$(VERSION_MIN-$(os))-macabi
161158
IS_SIMULATOR-$(target)=False
162159
endif
163160
else
164-
TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(TRIPLE_OS-$(os))$$(VERSION_MIN-$(target))-simulator
161+
TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(TRIPLE_OS-$(os))$$(VERSION_MIN-$(os))-simulator
165162
IS_SIMULATOR-$(target)=True
166163
endif
167164
endif
@@ -347,7 +344,7 @@ $$(PYTHON_SRCDIR-$(target))/Makefile: \
347344
--with-openssl="$$(OPENSSL_INSTALL-$(target))" \
348345
--enable-framework="$$(PYTHON_INSTALL-$(target))" \
349346
--with-system-libmpdec \
350-
$$(CONFIGFLAGS-$(target)) \
347+
$$(CONFIGFLAGS-$(os)) \
351348
2>&1 | tee -a ../python-$(PYTHON_VERSION).config.log
352349

353350
$$(PYTHON_SRCDIR-$(target))/python.exe: $$(PYTHON_SRCDIR-$(target))/Makefile
@@ -386,7 +383,7 @@ $$(PYTHON_PLATFORM_SITECUSTOMIZE-$(target)):
386383
| sed -e "s/{{platform}}/$$(OS_LOWER-$(target))/g" \
387384
| sed -e "s/{{arch}}/$$(ARCH-$(target))/g" \
388385
| sed -e "s/{{sdk}}/$$(SDK-$(target))/g" \
389-
| sed -e "s/{{version_min}}/$$(VERSION_MIN-$(target))/g" \
386+
| sed -e "s/{{version_min}}/$$(VERSION_MIN-$(os))/g" \
390387
| sed -e "s/{{is_simulator}}/$$(IS_SIMULATOR-$(target))/g" \
391388
> $$(PYTHON_PLATFORM_CONFIG-$(target))/_cross_$$(ARCH-$(target))_$$(SDK-$(target)).py
392389
cat $(PROJECT_DIR)/patch/Python/sitecustomize.py.tmpl \
@@ -407,8 +404,6 @@ vars-$(target):
407404
@echo "BASE-$(target): $$(BASE-$(target))"
408405
@echo "SDK-$(target): $$(SDK-$(target))"
409406
@echo "ARCH-$(target): $$(ARCH-$(target))"
410-
@echo "CONFIGFLAGS-$(target): $$(CONFIGFLAGS-$(target))"
411-
@echo "VERSION_MIN-$(target): $$(VERSION_MIN-$(target))"
412407
@echo "TARGET_TRIPLE-$(target): $$(TARGET_TRIPLE-$(target))"
413408
@echo "SDK_ROOT-$(target): $$(SDK_ROOT-$(target))"
414409
@echo "BZIP2_INSTALL-$(target): $$(BZIP2_INSTALL-$(target))"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# This is a list of support package path patterns that we exclude
2+
# from all Python-Apple-support tarballs.
3+
# It is used by `tar -X` during the Makefile build.
4+
# Remove pyc files. These take up space, but since most stdlib modules are
5+
# never imported by user code, they mostly have no value.
6+
*/__pycache__

0 commit comments

Comments
 (0)