@@ -4,14 +4,25 @@ PROJECT_DIR=$(shell pwd)
4
4
BUILD_NUMBER =custom
5
5
6
6
# Version of packages that will be compiled by this meta-package
7
- PYTHON_VERSION =3.8.6
7
+ # PYTHON_VERSION is the full version number (e.g., 3.10.0b3)
8
+ # PYTHON_MICRO_VERSION is the full version number, without any alpha/beta/rc suffix. (e.g., 3.10.0)
9
+ # PYTHON_VER is the major/minor version (e.g., 3.10)
10
+ PYTHON_VERSION =3.8.13
11
+ PYTHON_MICRO_VERSION =$(shell echo $(PYTHON_VERSION ) | grep -Po "\d+\.\d+\.\d+")
8
12
PYTHON_VER =$(basename $(PYTHON_VERSION ) )
13
+
9
14
ARCH =$(shell uname -m)
10
15
11
16
all :
12
17
@echo " ***** Building $( PYTHON_VERSION) $( ARCH) build $( BUILD_NUMBER) *****"
18
+ rm -rf build
13
19
docker build -t beeware/python-linux-$(ARCH ) -support .
14
- docker run -e BUILD_NUMBER=$(BUILD_NUMBER ) -v $(PROJECT_DIR ) /downloads:/local/downloads -v $(PROJECT_DIR ) /dist:/local/dist beeware/python-linux-$(ARCH ) -support
20
+ docker run -e \
21
+ BUILD_NUMBER=$(BUILD_NUMBER ) \
22
+ -v $(PROJECT_DIR ) /downloads:/local/downloads \
23
+ -v $(PROJECT_DIR ) /dist:/local/dist \
24
+ -v $(PROJECT_DIR ) /build:/local/build \
25
+ beeware/python-linux-$(ARCH ) -support
15
26
16
27
# Clean all builds
17
28
clean :
@@ -33,7 +44,10 @@ downloads: downloads/Python-$(PYTHON_VERSION).tgz dependencies
33
44
# Download original Python source code archive.
34
45
downloads/Python-$(PYTHON_VERSION ) .tgz :
35
46
mkdir -p downloads
36
- if [ ! -e downloads/Python-$( PYTHON_VERSION) .tgz ]; then curl -L https://www.python.org/ftp/python/$( PYTHON_VERSION) /Python-$( PYTHON_VERSION) .tgz > downloads/Python-$( PYTHON_VERSION) .tgz; fi
47
+ if [ ! -e downloads/Python-$( PYTHON_VERSION) .tgz ]; then \
48
+ curl --fail -L https://www.python.org/ftp/python/$(PYTHON_MICRO_VERSION ) /Python-$(PYTHON_VERSION ) .tgz \
49
+ -o downloads/Python-$(PYTHON_VERSION ) .tgz; \
50
+ fi
37
51
38
52
build :
39
53
mkdir build
@@ -49,10 +63,21 @@ build/Python-$(PYTHON_VERSION)/Makefile: build downloads
49
63
# Configure target Python
50
64
cd build/Python-$(PYTHON_VERSION) && ./configure \
51
65
--prefix=$(PROJECT_DIR)/build/python \
52
- --without-doc-strings --enable-ipv6 --without-ensurepip
53
-
54
- build/python/bin/python$(PYTHON_VER ) m : build/Python-$(PYTHON_VERSION ) /Makefile
55
- cd build/Python-$(PYTHON_VERSION ) && make install
66
+ --enable-ipv6 \
67
+ --enable-shared \
68
+ --without-doc-strings \
69
+ --without-ensurepip \
70
+ 2>&1 | tee -a ../python-$(PYTHON_VERSION).config.log
71
+
72
+ build/Python-$(PYTHON_VERSION ) /python.exe : build/Python-$(PYTHON_VERSION ) /Makefile
73
+ cd build/Python-$(PYTHON_VERSION ) && \
74
+ make \
75
+ 2>&1 | tee -a ../python-$(PYTHON_VERSION ) .build.log
76
+
77
+ build/python/bin/python$(PYTHON_VER ) : build/Python-$(PYTHON_VERSION ) /python.exe
78
+ cd build/Python-$(PYTHON_VERSION ) && \
79
+ make install \
80
+ 2>&1 | tee -a ../python-$(PYTHON_VERSION ) .install.log
56
81
57
82
build/python/VERSIONS : dependencies
58
83
echo " Python version: $( PYTHON_VERSION) " > build/python/VERSIONS
@@ -62,7 +87,7 @@ build/python/VERSIONS: dependencies
62
87
echo " OpenSSL: $$ (awk '$$ 2==" openssl" { print $$ 3 }' downloads/system.versions)" >> build/python/VERSIONS
63
88
echo " XZ: $$ (awk '$$ 2==" liblzma5:amd64" { print $$ 3 }' downloads/system.versions)" >> build/python/VERSIONS
64
89
65
- dist/Python-$(PYTHON_VER ) -linux-$(ARCH ) -support.$(BUILD_NUMBER ) .tar.gz : dist build/python/bin/python$(PYTHON_VER ) m build/python/VERSIONS
90
+ dist/Python-$(PYTHON_VER ) -linux-$(ARCH ) -support.$(BUILD_NUMBER ) .tar.gz : dist build/python/bin/python$(PYTHON_VER ) build/python/VERSIONS
66
91
tar zcvf $@ -X exclude.list -C build/python ` ls -A build/python`
67
92
68
93
Python : dist/Python-$(PYTHON_VER ) -linux-$(ARCH ) -support.$(BUILD_NUMBER ) .tar.gz
0 commit comments