5
5
# - iOS - build everything for iOS
6
6
# - tvOS - build everything for tvOS
7
7
# - watchOS - build everything for watchOS
8
+ # - visionOS - build everything for visionOS
8
9
9
10
# Current directory
10
11
PROJECT_DIR =$(shell pwd)
@@ -18,7 +19,7 @@ BUILD_NUMBER=custom
18
19
# of a release cycle, as official binaries won't be published.
19
20
# PYTHON_MICRO_VERSION is the full version number, without any alpha/beta/rc suffix. (e.g., 3.10.0)
20
21
# PYTHON_VER is the major/minor version (e.g., 3.10)
21
- PYTHON_VERSION =3.13.5
22
+ PYTHON_VERSION =3.13.7
22
23
PYTHON_PKG_VERSION =$(PYTHON_VERSION )
23
24
PYTHON_MICRO_VERSION =$(shell echo $(PYTHON_VERSION ) | grep -Eo "\d+\.\d+\.\d+")
24
25
PYTHON_PKG_MICRO_VERSION =$(shell echo $(PYTHON_PKG_VERSION ) | grep -Eo "\d+\.\d+\.\d+")
@@ -33,32 +34,37 @@ OPENSSL_VERSION=3.0.16-2
33
34
XZ_VERSION =5.6.4-2
34
35
35
36
# Supported OS
36
- OS_LIST =macOS iOS tvOS watchOS
37
+ OS_LIST =macOS iOS tvOS watchOS visionOS
37
38
38
39
CURL_FLAGS =--disable --fail --location --create-dirs --progress-bar
39
40
40
41
# macOS targets
41
42
TARGETS-macOS =macosx.x86_64 macosx.arm64
42
43
TRIPLE_OS-macOS =macos
44
+ PLATFORM_NAME-macOS =macOS
43
45
VERSION_MIN-macOS =11.0
44
46
45
47
# iOS targets
46
48
TARGETS-iOS =iphonesimulator.x86_64 iphonesimulator.arm64 iphoneos.arm64
47
49
TRIPLE_OS-iOS =ios
50
+ PLATFORM_NAME-iOS =iOS
48
51
VERSION_MIN-iOS =13.0
49
52
50
53
# tvOS targets
51
54
TARGETS-tvOS =appletvsimulator.x86_64 appletvsimulator.arm64 appletvos.arm64
52
55
TRIPLE_OS-tvOS =tvos
56
+ PLATFORM_NAME-tvOS =tvOS
53
57
VERSION_MIN-tvOS =12.0
54
58
55
59
# watchOS targets
56
60
TARGETS-watchOS =watchsimulator.x86_64 watchsimulator.arm64 watchos.arm64_32
57
61
TRIPLE_OS-watchOS =watchos
62
+ PLATFORM_NAME-watchOS =watchOS
58
63
VERSION_MIN-watchOS =4.0
59
64
60
65
TARGETS-visionOS =xrsimulator.arm64 xros.arm64
61
66
TRIPLE_OS-visionOS =xros
67
+ PLATFORM_NAME-visionOS =xrOS
62
68
VERSION_MIN-visionOS =2.0
63
69
64
70
# The architecture of the machine doing the build
@@ -94,7 +100,7 @@ update-patch:
94
100
# call
95
101
if [ -z " $( PYTHON_REPO_DIR) " ]; then echo " \n\nPYTHON_REPO_DIR must be set to the root of your Python github checkout\n\n" ; fi
96
102
cd $(PYTHON_REPO_DIR ) && \
97
- git diff -D v$(PYTHON_VERSION ) $(PYTHON_VER ) -patched \
103
+ git diff --no-renames - D v$(PYTHON_VERSION ) $(PYTHON_VER ) -patched \
98
104
| PATH=" /usr/local/bin:/opt/homebrew/bin:$( PATH) " filterdiff \
99
105
-X $(PROJECT_DIR ) /patch/Python/diff.exclude -p 1 --clean \
100
106
> $(PROJECT_DIR ) /patch/Python/Python.patch
@@ -286,15 +292,15 @@ $$(PYTHON_SRCDIR-$(target))/configure: \
286
292
# Apply target Python patches
287
293
cd $$(PYTHON_SRCDIR-$(target ) ) && patch -p1 < $(PROJECT_DIR ) /patch/Python/Python.patch
288
294
# Make sure the binary scripts are executable
289
- chmod 755 $$(PYTHON_SRCDIR-$(target ) ) /$(os ) /Resources/bin/*
295
+ chmod 755 $$(PYTHON_SRCDIR-$(target ) ) /Apple/ $(os ) /Resources/bin/*
290
296
# Touch the configure script to ensure that Make identifies it as up to date.
291
297
touch $$(PYTHON_SRCDIR-$(target ) ) /configure
292
298
293
299
$$(PYTHON_SRCDIR-$(target ) ) /Makefile : \
294
300
$$(PYTHON_SRCDIR-$(target ) ) /configure
295
301
# Configure target Python
296
302
cd $$(PYTHON_SRCDIR-$(target ) ) && \
297
- PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/$( os) /Resources/bin:$( PATH) " \
303
+ PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/Apple/ $( os) /Resources/bin:$( PATH) " \
298
304
./configure \
299
305
LIBLZMA_CFLAGS=" -I$$ (XZ_INSTALL-$( target) )/include" \
300
306
LIBLZMA_LIBS=" -L$$ (XZ_INSTALL-$( target) )/lib -llzma" \
@@ -316,14 +322,14 @@ $$(PYTHON_SRCDIR-$(target))/Makefile: \
316
322
$$(PYTHON_SRCDIR-$(target ) ) /python.exe : $$(PYTHON_SRCDIR-$(target ) ) /Makefile
317
323
@echo " >>> Build Python for $( target) "
318
324
cd $$(PYTHON_SRCDIR-$(target ) ) && \
319
- PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/$( os) /Resources/bin:$( PATH) " \
325
+ PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/Apple/ $( os) /Resources/bin:$( PATH) " \
320
326
make -j8 all \
321
327
2>&1 | tee -a ../python-$(PYTHON_VERSION ) .build.log
322
328
323
329
$$(PYTHON_LIB-$(target ) ) : $$(PYTHON_SRCDIR-$(target ) ) /python.exe
324
330
@echo " >>> Install Python for $( target) "
325
331
cd $$(PYTHON_SRCDIR-$(target ) ) && \
326
- PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/$( os) /Resources/bin:$( PATH) " \
332
+ PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/Apple/ $( os) /Resources/bin:$( PATH) " \
327
333
make install \
328
334
2>&1 | tee -a ../python-$(PYTHON_VERSION ) .install.log
329
335
@@ -489,15 +495,11 @@ $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h: $$(PYTHON_LIB-$(sdk))
489
495
mkdir -p $$(PYTHON_INSTALL-$(sdk))/include
490
496
ln -si ../Python.framework/Headers $$(PYTHON_INSTALL-$(sdk))/include/python$(PYTHON_VER)
491
497
492
- ifeq ($(os ) , visionOS)
493
- echo "Skipping arch-specific header copying for visionOS"
494
- else
495
498
# Add the individual headers from each target in an arch-specific name
496
499
$$(foreach target,$$(SDK_TARGETS-$(sdk)),cp $$(PYTHON_INCLUDE-$$(target))/pyconfig.h $$(PYTHON_INCLUDE-$(sdk))/pyconfig-$$(ARCH-$$(target)).h; )
497
500
498
501
# Copy the cross-target header from the source folder of the first target in the $(sdk) SDK
499
- cp $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$(sdk))))/$(os)/Resources/pyconfig.h $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h
500
- endif
502
+ cp $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$(sdk))))/Apple/$(os)/Resources/pyconfig.h $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h
501
503
502
504
503
505
$$(PYTHON_STDLIB-$(sdk ) ) /LICENSE.TXT : $$(PYTHON_LIB-$(sdk ) ) $$(PYTHON_FRAMEWORK-$(sdk ) ) /Info.plist $$(PYTHON_INCLUDE-$(sdk ) ) /pyconfig.h $$(foreach target,$$(SDK_TARGETS-$(sdk ) ) ,$$(PYTHON_PLATFORM_SITECUSTOMIZE-$$(target ) ) )
@@ -663,6 +665,11 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \
663
665
-output $$(PYTHON_XCFRAMEWORK-$(os ) ) $$(foreach sdk,$$(SDKS-$(os ) ) ,-framework $$(PYTHON_FRAMEWORK-$$(sdk ) ) ) \
664
666
2>&1 | tee -a support/$(PYTHON_VER ) /python-$(os ) .xcframework.log
665
667
668
+ @echo ">>> Install build tools for $(os)"
669
+ mkdir $$(PYTHON_XCFRAMEWORK-$(os))/build
670
+ cp $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$$(firstword $$(SDKS-$(os))))))/Apple/testbed/Python.xcframework/build/utils.sh $$(PYTHON_XCFRAMEWORK-$(os))/build
671
+ cp $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$$(firstword $$(SDKS-$(os))))))/Apple/testbed/Python.xcframework/build/$$(PLATFORM_NAME-$(os))-dylib-Info-template.plist $$(PYTHON_XCFRAMEWORK-$(os))/build
672
+
666
673
@echo ">>> Install PYTHONHOME for $(os)"
667
674
$$(foreach sdk,$$(SDKS-$(os)),cp -r $$(PYTHON_INSTALL-$$(sdk))/include $$(PYTHON_XCFRAMEWORK-$(os))/$$(SDK_SLICE-$$(sdk)); )
668
675
$$(foreach sdk,$$(SDKS-$(os)),cp -r $$(PYTHON_INSTALL-$$(sdk))/bin $$(PYTHON_XCFRAMEWORK-$(os))/$$(SDK_SLICE-$$(sdk)); )
@@ -671,9 +678,9 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \
671
678
# Disable dSYM production (for now)
672
679
# $$(foreach sdk,$$(SDKS-$(os)),cp -r $$(PYTHON_INSTALL-$$(sdk))/Python.dSYM $$(PYTHON_XCFRAMEWORK-$(os))/$$(SDK_SLICE-$$(sdk)); )
673
680
674
- ifeq ($(filter $(os ) ,iOS visionOS) ,$(os ) )
681
+ ifeq ($(filter $(os ) ,iOS tvOS visionOS) ,$(os ) )
675
682
@echo ">>> Clone testbed project for $(os)"
676
- $(HOST_PYTHON) $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$$(firstword $$(SDKS-$(os))))))/$(os) /testbed clone --framework $$(PYTHON_XCFRAMEWORK-$(os)) support/$(PYTHON_VER)/$(os)/testbed
683
+ $(HOST_PYTHON) $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$$(firstword $$(SDKS-$(os))))))/Apple /testbed clone --platform $(os) --framework $$(PYTHON_XCFRAMEWORK-$(os)) support/$(PYTHON_VER)/$(os)/testbed
677
684
endif
678
685
679
686
@echo ">>> Create VERSIONS file for $(os)"
0 commit comments