25
25
# Current director
26
26
PROJECT_DIR =$(shell pwd)
27
27
28
- BUILD_NUMBER =3
28
+ BUILD_NUMBER =custom
29
29
30
30
MACOSX_DEPLOYMENT_TARGET =10.8
31
31
@@ -34,12 +34,12 @@ PYTHON_VERSION=3.7.6
34
34
PYTHON_VER =$(basename $(PYTHON_VERSION ) )
35
35
36
36
OPENSSL_VERSION_NUMBER =1.1.1
37
- OPENSSL_REVISION =d
37
+ OPENSSL_REVISION =g
38
38
OPENSSL_VERSION =$(OPENSSL_VERSION_NUMBER )$(OPENSSL_REVISION )
39
39
40
40
BZIP2_VERSION =1.0.8
41
41
42
- XZ_VERSION =5.2.4
42
+ XZ_VERSION =5.2.5
43
43
44
44
# Supported OS
45
45
OS =macOS iOS tvOS watchOS
@@ -50,20 +50,22 @@ CFLAGS-macOS=-mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)
50
50
51
51
# iOS targets
52
52
TARGETS-iOS =iphonesimulator.x86_64 iphoneos.arm64
53
- CFLAGS-iOS=-mios-version-min =8.0
54
- CFLAGS-iphoneos.arm64 =-fembed-bitcode
55
- CFLAGS-iphonesimulator.x86_64 =-fembed-bitcode
53
+ CFLAGS-iOS=-mios-version-min =8.0 -fembed-bitcode
54
+ CFLAGS-iphoneos.arm64 =
55
+ CFLAGS-iphonesimulator.x86_64 =
56
56
57
57
# tvOS targets
58
58
TARGETS-tvOS =appletvsimulator.x86_64 appletvos.arm64
59
- CFLAGS-tvOS=-mtvos-version-min =9.0
60
- CFLAGS-appletvos.arm64 =-fembed-bitcode
59
+ CFLAGS-tvOS=-mtvos-version-min =9.0 -fembed-bitcode
60
+ CFLAGS-appletvos.arm64 =
61
+ CFLAGS-appletvsimulator.x86_64 =
61
62
PYTHON_CONFIGURE-tvOS=ac_cv_func_sigaltstack =no
62
63
63
64
# watchOS targets
64
65
TARGETS-watchOS =watchsimulator.i386 watchos.armv7k
65
- CFLAGS-watchOS=-mwatchos-version-min =4.0
66
- CFLAGS-watchos.armv7k =-fembed-bitcode
66
+ CFLAGS-watchOS=-mwatchos-version-min =4.0 -fembed-bitcode
67
+ CFLAGS-watchsimulator.i386 =
68
+ CFLAGS-watchos.armv7k =
67
69
PYTHON_CONFIGURE-watchOS=ac_cv_func_sigaltstack =no
68
70
69
71
# override machine types for arm64
@@ -88,9 +90,6 @@ update-patch:
88
90
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
89
91
cd $(PYTHON_REPO_DIR ) && git diff -D v$(PYTHON_VERSION ) $(PYTHON_VER ) | filterdiff -X $(PROJECT_DIR ) /patch/Python/diff-exclude.lst -p 1 --clean > $(PROJECT_DIR ) /patch/Python/Python.patch
90
92
91
- upload : $(foreach os,$(OS ) ,$(os ) )
92
- python tools/upload.py b$(BUILD_NUMBER )
93
-
94
93
# ##########################################################################
95
94
# OpenSSL
96
95
# These build instructions adapted from the scripts developed by
@@ -228,16 +227,12 @@ endif
228
227
229
228
# Build OpenSSL
230
229
$$(OPENSSL_DIR-$1 ) /libssl.a $$(OPENSSL_DIR-$1 ) /libcrypto.a: $$(OPENSSL_DIR-$1 ) /Makefile
231
- # Installing multiple times causes problems with the man directory.
232
- # Since we're just overwriting anyway, and we're not going to keep the man files
233
- # delete the man directory (if it exists) first.
234
- rm -rf $(PROJECT_DIR ) /build/$2/openssl/man
235
- # Make the build
230
+ # Make the build, and install just the software (not the docs)
236
231
cd $$(OPENSSL_DIR-$1 ) && \
237
232
CC="$$(CC-$1 ) " \
238
233
CROSS_TOP="$$(dir $$(SDK_ROOT-$1 ) ) .." \
239
234
CROSS_SDK="$$(notdir $$(SDK_ROOT-$1 ) ) " \
240
- make all && make install
235
+ make all && make install_sw
241
236
242
237
# Unpack BZip2
243
238
$$(BZIP2_DIR-$1 ) /Makefile: downloads/bzip2-$(BZIP2_VERSION ) .tgz
@@ -277,17 +272,22 @@ $$(PYTHON_DIR-$1)/Makefile: downloads/Python-$(PYTHON_VERSION).tgz $$(PYTHON_HOS
277
272
tar zxf downloads/Python-$(PYTHON_VERSION ) .tgz --strip-components 1 -C $$(PYTHON_DIR-$1 )
278
273
# Apply target Python patches
279
274
cd $$(PYTHON_DIR-$1 ) && patch -p1 < $(PROJECT_DIR ) /patch/Python/Python.patch
280
- cp -f $(PROJECT_DIR ) /patch/Python/Setup.embedded $$(PYTHON_DIR-$1 ) /Modules/Setup.embedded
281
-
282
275
# Configure target Python
283
276
ifeq ($2,macOS)
277
+ # A locally hosted Python requires a full Setup.local configuration
278
+ # because there's no PYTHON_HOST_PLATFORM to cause Setup.local to be
279
+ # generated
280
+ cat $(PROJECT_DIR)/patch/Python/Setup.embedded $(PROJECT_DIR)/patch/Python/Setup.macOS-x86_64 > $$(PYTHON_DIR-$1)/Modules/Setup.local
284
281
# Make a fully embedded macOS build
285
- cat $$(PYTHON_DIR-$1)/Modules/Setup.embedded $(PROJECT_DIR)/patch/Python/Setup.macOS-x86_64 > $$(PYTHON_DIR-$1)/Modules/Setup.local
286
282
cd $$(PYTHON_DIR-$1) && MACOSX_DEPLOYMENT_TARGET=$$(MACOSX_DEPLOYMENT_TARGET) ./configure \
287
283
--prefix=$(PROJECT_DIR)/$$(PYTHON_DIR-$1)/dist \
288
284
--without-doc-strings --enable-ipv6 --without-ensurepip \
289
285
$$(PYTHON_CONFIGURE-$2)
290
286
else
287
+ # Copy in the embedded and platform/arch configuration
288
+ cp -f $(PROJECT_DIR)/patch/Python/Setup.embedded $$(PYTHON_DIR-$1)/Modules/Setup.embedded
289
+ if [ -e "$(PROJECT_DIR)/patch/Python/Setup.$2-$$(ARCH-$1)" ]; then \
290
+ cp -f $(PROJECT_DIR)/patch/Python/Setup.$2-$$(ARCH-$1) $$(PYTHON_DIR-$1)/Modules/Setup.$2-$$(ARCH-$1); fi
291
291
cd $$(PYTHON_DIR-$1) && PATH=$(PROJECT_DIR)/$(PYTHON_DIR-macOS)/dist/bin:$(PATH) ./configure \
292
292
CC="$$(CC-$1)" LD="$$(CC-$1)" \
293
293
--host=$$(MACHINE_DETAILED-$1)-apple-$(shell echo $2 | tr '[:upper:]' '[:lower:]') \
@@ -328,12 +328,12 @@ XZ_FRAMEWORK-$1=build/$1/Support/XZ
328
328
PYTHON_FRAMEWORK-$1=build/$1/Support/Python
329
329
PYTHON_RESOURCES-$1=$$(PYTHON_FRAMEWORK-$1 ) /Resources
330
330
331
- $1: dist/Python-$(PYTHON_VER ) -$1-support.b $(BUILD_NUMBER ) .tar.gz
331
+ $1: dist/Python-$(PYTHON_VER ) -$1-support.$(BUILD_NUMBER ) .tar.gz
332
332
333
333
clean-$1:
334
334
rm -rf build/$1
335
335
336
- dist/Python-$(PYTHON_VER ) -$1-support.b $(BUILD_NUMBER ) .tar.gz: $$(BZIP2_FRAMEWORK-$1 ) $$(XZ_FRAMEWORK-$1 ) $$(OPENSSL_FRAMEWORK-$1 ) $$(PYTHON_FRAMEWORK-$1 )
336
+ dist/Python-$(PYTHON_VER ) -$1-support.$(BUILD_NUMBER ) .tar.gz: $$(BZIP2_FRAMEWORK-$1 ) $$(XZ_FRAMEWORK-$1 ) $$(OPENSSL_FRAMEWORK-$1 ) $$(PYTHON_FRAMEWORK-$1 )
337
337
mkdir -p dist
338
338
echo "Python version: $(PYTHON_VERSION ) " > build/$1/Support/VERSIONS
339
339
echo "Build: $(BUILD_NUMBER ) " >> build/$1/Support/VERSIONS
@@ -344,9 +344,12 @@ dist/Python-$(PYTHON_VER)-$1-support.b$(BUILD_NUMBER).tar.gz: $$(BZIP2_FRAMEWORK
344
344
ifeq ($1,macOS)
345
345
cp -r build/$1/Python-$(PYTHON_VERSION)-macosx.x86_64/dist build/$1/python
346
346
mv build/$1/Support/VERSIONS build/$1/python/VERSIONS
347
- tar zcvf $$@ -C build/$1/python `ls -A build/$1/python`
347
+ tar zcvf $$@ -X patch/Python/exclude.macOS - C build/$1/python `ls -A build/$1/python`
348
348
else
349
- tar zcvf $$@ -C build/$1/Support `ls -A build/$1/Support`
349
+ # Build a "full" tarball with all content for test purposes
350
+ tar zcvf dist/Python-$(PYTHON_VER)-$1-support.test-$(BUILD_NUMBER).tar.gz -X patch/Python/test-exclude.embedded -C build/$1/Support `ls -A build/$1/Support`
351
+ # Build a distributable tarball
352
+ tar zcvf $$@ -X patch/Python/exclude.embedded -C build/$1/Support `ls -A build/$1/Support`
350
353
endif
351
354
352
355
# Build OpenSSL
@@ -411,7 +414,7 @@ build/$1/xz/lib/liblzma.a: $$(foreach target,$$(TARGETS-$1),$$(XZ_DIR-$$(target)
411
414
412
415
$1: Python-$1
413
416
414
- Python-$1: dist/Python-$(PYTHON_VER ) -$1-support.b $(BUILD_NUMBER ) .tar.gz
417
+ Python-$1: dist/Python-$(PYTHON_VER ) -$1-support.$(BUILD_NUMBER ) .tar.gz
415
418
416
419
# Build Python
417
420
$$(PYTHON_FRAMEWORK-$1 ) : build/$1/libpython$(PYTHON_VER ) m.a $$(foreach target,$$(TARGETS-$1 ) ,build/$1/$$(pyconfig.h-$$(target ) ) )
@@ -432,16 +435,7 @@ endif
432
435
cp -f -r $$(PYTHON_FRAMEWORK-$1 ) /Headers/Python.h $$(PYTHON_RESOURCES-$1 ) /include/python$(PYTHON_VER ) m
433
436
434
437
# Copy the standard library from the simulator build
435
- ifneq ($(TEST ) ,)
436
438
cp -f -r $$(PYTHON_DIR-$$(firstword $$(TARGETS-$1 ) ) ) /dist/lib $$(PYTHON_RESOURCES-$1 )
437
- # Remove the pieces of the resources directory that aren't needed:
438
- rm -f $$(PYTHON_RESOURCES-$1)/lib/libpython$(PYTHON_VER)m.a
439
- rm -rf $$(PYTHON_RESOURCES-$1)/lib/pkgconfig
440
- else
441
- mkdir -p $$(PYTHON_RESOURCES-$1)/lib
442
- cd $$(PYTHON_DIR-$$(firstword $$(TARGETS-$1)))/dist/lib/python$(PYTHON_VER) && \
443
- zip -x@$(PROJECT_DIR)/patch/Python/lib-exclude.lst -r $(PROJECT_DIR)/$$(PYTHON_RESOURCES-$1)/lib/python$(subst .,,$(PYTHON_VER)) *
444
- endif
445
439
446
440
# Copy fat library
447
441
cp -f $$(filter % .a,$$^ ) $$(PYTHON_FRAMEWORK-$1 ) /libPython.a
0 commit comments