@@ -15,16 +15,17 @@ BUILD_NUMBER=custom
15
15
# PYTHON_VERSION is the full version number (e.g., 3.10.0b3)
16
16
# PYTHON_MICRO_VERSION is the full version number, without any alpha/beta/rc suffix. (e.g., 3.10.0)
17
17
# PYTHON_VER is the major/minor version (e.g., 3.10)
18
- PYTHON_VERSION =3.13.0a1
18
+ PYTHON_VERSION =3.13.0b4
19
19
PYTHON_MICRO_VERSION =$(shell echo $(PYTHON_VERSION ) | grep -Eo "\d+\.\d+\.\d+")
20
20
PYTHON_VER =$(basename $(PYTHON_VERSION ) )
21
21
22
22
# The binary releases of dependencies, published at:
23
23
# https://github.com/beeware/cpython-apple-source-deps/releases
24
24
BZIP2_VERSION =1.0.8-1
25
- XZ_VERSION =5.4.4-1
26
- OPENSSL_VERSION =3.0.12-1
27
- LIBFFI_VERSION =3.4.4-1
25
+ MPDECIMAL_VERSION =4.0.0-1
26
+ OPENSSL_VERSION =3.0.14-1
27
+ XZ_VERSION =5.4.7-1
28
+ LIBFFI_VERSION =3.4.6-1
28
29
29
30
# Supported OS
30
31
OS_LIST =macOS iOS tvOS watchOS
@@ -37,17 +38,15 @@ VERSION_MIN-macOS=11.0
37
38
38
39
# iOS targets
39
40
TARGETS-iOS =iphonesimulator.x86_64 iphonesimulator.arm64 iphoneos.arm64
40
- VERSION_MIN-iOS =12 .0
41
+ VERSION_MIN-iOS =13 .0
41
42
42
43
# tvOS targets
43
44
TARGETS-tvOS =appletvsimulator.x86_64 appletvsimulator.arm64 appletvos.arm64
44
- VERSION_MIN-tvOS =9.0
45
- PYTHON_CONFIGURE-tvOS=ac_cv_func_sigaltstack =no
45
+ VERSION_MIN-tvOS =12.0
46
46
47
47
# watchOS targets
48
48
TARGETS-watchOS =watchsimulator.x86_64 watchsimulator.arm64 watchos.arm64_32
49
49
VERSION_MIN-watchOS =4.0
50
- PYTHON_CONFIGURE-watchOS=ac_cv_func_sigaltstack =no
51
50
52
51
# The architecture of the machine doing the build
53
52
HOST_ARCH =$(shell uname -m)
@@ -82,7 +81,7 @@ update-patch:
82
81
# call
83
82
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
84
83
cd $(PYTHON_REPO_DIR ) && \
85
- git diff -D v$(PYTHON_VERSION ) $(PYTHON_VER ) \
84
+ git diff -D v$(PYTHON_VERSION ) $(PYTHON_VER ) -patched \
86
85
| PATH=" /usr/local/bin:/opt/homebrew/bin:$( PATH) " filterdiff \
87
86
-X $(PROJECT_DIR ) /patch/Python/diff.exclude -p 1 --clean \
88
87
> $(PROJECT_DIR ) /patch/Python/Python.patch
@@ -122,8 +121,6 @@ OS_LOWER-$(target)=$(shell echo $(os) | tr '[:upper:]' '[:lower:]')
122
121
SDK-$(target ) =$$(basename $(target ) )
123
122
ARCH-$(target ) =$$(subst .,,$$(suffix $(target ) ) )
124
123
125
- WHEEL_TAG-$(target ) =py3-none-$$(shell echo $$(OS_LOWER-$(target ) ) _$$(VERSION_MIN-$(os ) ) _$(target ) | sed "s/\./_/g")
126
-
127
124
ifneq ($(os ) ,macOS)
128
125
ifeq ($$(findstring simulator,$$(SDK-$(target))),)
129
126
TARGET_TRIPLE-$(target) =$$(ARCH-$(target ) ) -apple-$$(OS_LOWER-$(target ) )$$(VERSION_MIN-$(os ) )
@@ -176,6 +173,26 @@ $$(XZ_LIB-$(target)): downloads/xz-$(XZ_VERSION)-$(target).tar.gz
176
173
# Ensure the target is marked as clean.
177
174
touch $$(XZ_LIB-$(target ) )
178
175
176
+ # ##########################################################################
177
+ # Target: mpdecimal
178
+ # ##########################################################################
179
+
180
+ MPDECIMAL_INSTALL-$(target ) =$(PROJECT_DIR ) /install/$(os ) /$(target ) /mpdecimal-$(MPDECIMAL_VERSION )
181
+ MPDECIMAL_LIB-$(target ) =$$(MPDECIMAL_INSTALL-$(target ) ) /lib/libmpdec.a
182
+
183
+ downloads/mpdecimal-$(MPDECIMAL_VERSION ) -$(target ) .tar.gz:
184
+ @echo ">>> Download mpdecimal for $(target ) "
185
+ mkdir -p downloads
186
+ curl $(CURL_FLAGS ) -o $$@ \
187
+ https://github.com/beeware/cpython-apple-source-deps/releases/download/mpdecimal-$(MPDECIMAL_VERSION ) /mpdecimal-$(MPDECIMAL_VERSION ) -$(target ) .tar.gz
188
+
189
+ $$(MPDECIMAL_LIB-$(target ) ) : downloads/mpdecimal-$(MPDECIMAL_VERSION ) -$(target ) .tar.gz
190
+ @echo ">>> Install mpdecimal for $(target ) "
191
+ mkdir -p $$(MPDECIMAL_INSTALL-$(target ) )
192
+ cd $$(MPDECIMAL_INSTALL-$(target ) ) && tar zxvf $(PROJECT_DIR ) /downloads/mpdecimal-$(MPDECIMAL_VERSION ) -$(target ) .tar.gz
193
+ # Ensure the target is marked as clean.
194
+ touch $$(MPDECIMAL_LIB-$(target ) )
195
+
179
196
# ##########################################################################
180
197
# Target: OpenSSL
181
198
# ##########################################################################
@@ -245,6 +262,7 @@ $$(PYTHON_SRCDIR-$(target))/configure: \
245
262
$$(BZIP2_LIB-$(target ) ) \
246
263
$$(XZ_LIB-$(target ) ) \
247
264
$$(OPENSSL_SSL_LIB-$(target ) ) \
265
+ $$(MPDECIMAL_LIB-$(target ) ) \
248
266
$$(LIBFFI_LIB-$(target ) )
249
267
@echo " >>> Unpack and configure Python for $( target) "
250
268
mkdir -p $$(PYTHON_SRCDIR-$(target ) )
@@ -270,25 +288,24 @@ $$(PYTHON_SRCDIR-$(target))/Makefile: \
270
288
LIBLZMA_LIBS=" -L$$ (XZ_INSTALL-$( target) )/lib -llzma" \
271
289
BZIP2_CFLAGS=" -I$$ (BZIP2_INSTALL-$( target) )/include" \
272
290
BZIP2_LIBS=" -L$$ (BZIP2_INSTALL-$( target) )/lib -lbz2" \
291
+ LIBMPDEC_CFLAGS=" -I$$ (MPDECIMAL_INSTALL-$( target) )/include" \
292
+ LIBMPDEC_LIBS=" -L$$ (MPDECIMAL_INSTALL-$( target) )/lib -lmpdec" \
273
293
LIBFFI_CFLAGS=" -I$$ (LIBFFI_INSTALL-$( target) )/include" \
274
294
LIBFFI_LIBS=" -L$$ (LIBFFI_INSTALL-$( target) )/lib -lffi" \
275
295
--host=$$(TARGET_TRIPLE-$(target ) ) \
276
296
--build=$(HOST_ARCH ) -apple-darwin \
277
297
--with-build-python=$(HOST_PYTHON ) \
278
298
--enable-ipv6 \
279
299
--with-openssl=" $$ (OPENSSL_INSTALL-$( target) )" \
280
- --without-ensurepip \
281
300
--enable-framework=" $$ (PYTHON_INSTALL-$( target) )" \
282
- ac_cv_file__dev_ptmx=no \
283
- ac_cv_file__dev_ptc=no \
284
- $$(PYTHON_CONFIGURE-$(os ) ) \
301
+ --with-system-libmpdec \
285
302
2>&1 | tee -a ../python-$(PYTHON_VERSION ) .config.log
286
303
287
304
$$(PYTHON_SRCDIR-$(target ) ) /python.exe : $$(PYTHON_SRCDIR-$(target ) ) /Makefile
288
305
@echo " >>> Build Python for $( target) "
289
306
cd $$(PYTHON_SRCDIR-$(target ) ) && \
290
307
PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/$( os) /Resources/bin:$( PATH) " \
291
- make all \
308
+ make -j8 all \
292
309
2>&1 | tee -a ../python-$(PYTHON_VERSION ) .build.log
293
310
294
311
$$(PYTHON_LIB-$(target ) ) : $$(PYTHON_SRCDIR-$(target ) ) /python.exe
@@ -308,7 +325,7 @@ $$(PYTHON_SITECUSTOMIZE-$(target)):
308
325
cat $(PROJECT_DIR ) /patch/Python/sitecustomize.$(os ) .py \
309
326
| sed -e "s/{{os}}/$(os ) /g" \
310
327
| sed -e "s/{{arch}}/$$(ARCH-$(target ) ) /g" \
311
- | sed -e "s/{{tag}}/$$(OS_LOWER-$(target ) ) -$$(VERSION_MIN-$(os ) ) -$$(SDK -$(target ) ) -$$(ARCH -$(target ) ) /g" \
328
+ | sed -e "s/{{tag}}/$$(OS_LOWER-$(target ) ) -$$(VERSION_MIN-$(os ) ) -$$(ARCH -$(target ) ) -$$(SDK -$(target ) ) /g" \
312
329
> $$(PYTHON_SITECUSTOMIZE-$(target ) )
313
330
314
331
$(target ) : $$(PYTHON_SITECUSTOMIZE-$(target ) ) $$(PYTHON_LIB-$(target ) )
@@ -329,6 +346,8 @@ vars-$(target):
329
346
@echo "XZ_LIB-$(target ) : $$(XZ_LIB-$(target ) ) "
330
347
@echo "OPENSSL_INSTALL-$(target ) : $$(OPENSSL_INSTALL-$(target ) ) "
331
348
@echo "OPENSSL_SSL_LIB-$(target ) : $$(OPENSSL_SSL_LIB-$(target ) ) "
349
+ @echo "MPDECIMAL_INSTALL-$(target ) : $$(MPDECIMAL_INSTALL-$(target ) ) "
350
+ @echo "MPDECIMAL_LIB-$(target ) : $$(MPDECIMAL_LIB-$(target ) ) "
332
351
@echo "LIBFFI_INSTALL-$(target ) : $$(LIBFFI_INSTALL-$(target ) ) "
333
352
@echo "LIBFFI_LIB-$(target ) : $$(LIBFFI_LIB-$(target ) ) "
334
353
@echo "PYTHON_SRCDIR-$(target ) : $$(PYTHON_SRCDIR-$(target ) ) "
@@ -524,20 +543,14 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \
524
543
tar zxf build/macOS/macosx/python-$(PYTHON_VERSION)/Python_Framework.pkgPython_Framework.pkg/PayloadPython_Framework.pkgPython_Framework.pkg/PayloadPython_Framework.pkgPython_Framework.pkg/Payload -C $$(PYTHON_FRAMEWORK-macosx) -X patch/Python/release.macOS.exclude
525
544
526
545
# Rewrite the framework to make it standalone
527
- python3 patch/make-macho-standalone.py $$(PYTHON_FRAMEWORK-macosx) \
528
- 2>&1 | tee $$(PYTHON_INSTALL-macosx)/python-$(PY_VERSION).make-macho-standalone.log
529
-
530
- # Remove the "development" versions of the libs
531
- rm -f $$(PYTHON_INSTALL_VERSION-macosx)/lib/*.dylib
532
- rm -f $$(PYTHON_INSTALL_VERSION-macosx)/lib/*.a
533
- rm -rf $$(PYTHON_INSTALL_VERSION-macosx)/lib/python$(PY_VERSION)/config-*
546
+ patch/make-relocatable.sh $$(PYTHON_INSTALL_VERSION-macosx) 2>&1 > /dev/null
534
547
535
548
# Re-apply the signature on the binaries.
536
549
codesign -s - --preserve-metadata=identifier,entitlements,flags,runtime -f $$(PYTHON_LIB-macosx) \
537
550
2>&1 | tee $$(PYTHON_INSTALL-macosx)/python-$(os).codesign.log
538
- find install/macOS/macosx/python-3.13.0a1/Python.framework -name "*.dylib" -type f -exec codesign -s - --preserve-metadata=identifier,entitlements,flags,runtime -f {} \; \
551
+ find $$(PYTHON_FRAMEWORK-macosx) -name "*.dylib" -type f -exec codesign -s - --preserve-metadata=identifier,entitlements,flags,runtime -f {} \; \
539
552
2>&1 | tee -a $$(PYTHON_INSTALL-macosx)/python-$(os).codesign.log
540
- find install/macOS/macosx/python-3.13.0a1/Python.framework -name "*.so" -type f -exec codesign -s - --preserve-metadata=identifier,entitlements,flags,runtime -f {} \; \
553
+ find $$(PYTHON_FRAMEWORK-macosx) -name "*.so" -type f -exec codesign -s - --preserve-metadata=identifier,entitlements,flags,runtime -f {} \; \
541
554
2>&1 | tee -a $$(PYTHON_INSTALL-macosx)/python-$(os).codesign.log
542
555
codesign -s - --preserve-metadata=identifier,entitlements,flags,runtime -f $$(PYTHON_FRAMEWORK-macosx) \
543
556
2>&1 | tee -a $$(PYTHON_INSTALL-macosx)/python-$(os).codesign.log
@@ -588,6 +601,7 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \
588
601
echo "libFFI: $(LIBFFI_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
589
602
echo "BZip2: $(BZIP2_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
590
603
echo "OpenSSL: $(OPENSSL_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
604
+ echo "mpdecimal: $(MPDECIMAL_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
591
605
echo "XZ: $(XZ_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
592
606
593
607
dist/Python-$(PYTHON_VER ) -$(os ) -support.$(BUILD_NUMBER ) .tar.gz : \
0 commit comments