Skip to content

Commit 0e9db31

Browse files
committedMar 4, 2016
Add UCS-2 builds of Python. /opt/<major> links to the UCS-4 builds, but
/opt/<major><soabi_flags> and /opt/<full><soabi_flags> are the more specific paths.
1 parent 221d0ce commit 0e9db31

File tree

2 files changed

+32
-13
lines changed

2 files changed

+32
-13
lines changed
 

‎docker/build_scripts/build.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,11 @@ yum -y clean all > /dev/null 2>&1
6666
yum list installed
6767

6868
for PYVER in $PY_VERS; do
69-
/opt/$PYVER/bin/python $MY_DIR/manylinux1-check.py
69+
soabi_flags_list="m"
70+
if [ $(lex_pyver $PYVER) -lt $(lex_pyver 3.3) ]; then
71+
soabi_flags_list="mu m"
72+
fi
73+
for soabi_flags in $soabi_flags_list; do
74+
/opt/${PYVER}${soabi_flags}/bin/python $MY_DIR/manylinux1-check.py
75+
done
7076
done

‎docker/build_scripts/build_utils.sh

+25-12
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,18 @@ function lex_pyver {
2626
function do_python_build {
2727
local py_ver=$1
2828
check_var $py_ver
29-
mkdir -p /opt/$py_ver/lib
29+
local soabi_flags=$2
30+
check_var $soabi_flags
31+
mkdir -p /opt/${py_ver}${soabi_flags}/lib
3032
if [ $(lex_pyver $py_ver) -lt $(lex_pyver 3.3) ]; then
31-
local unicode_flags="--enable-unicode=ucs4"
33+
if [ $soabi_flags = "mu" ]; then
34+
local unicode_flags="--enable-unicode=ucs4"
35+
else
36+
local unicode_flags="--enable-unicode=ucs2"
37+
fi
3238
fi
3339
# -Wformat added for https://bugs.python.org/issue17547 on Python 2.6
34-
CFLAGS="-Wformat" LDFLAGS="-Wl,-rpath /opt/$py_ver/lib" ./configure --prefix=/opt/$py_ver --disable-shared $unicode_flags > /dev/null
40+
CFLAGS="-Wformat" LDFLAGS="-Wl,-rpath /opt/${py_ver}${soabi_flags}/lib" ./configure --prefix=/opt/${py_ver}${soabi_flags} --disable-shared $unicode_flags > /dev/null
3541
make -j2 > /dev/null
3642
make install > /dev/null
3743
}
@@ -43,15 +49,22 @@ function build_python {
4349
local py_ver2="$(echo $py_ver | cut -d. -f 1,2)"
4450
check_var $PYTHON_DOWNLOAD_URL
4551
wget -q $PYTHON_DOWNLOAD_URL/$py_ver/Python-$py_ver.tgz
46-
tar -xzf Python-$py_ver.tgz
47-
(cd Python-$py_ver && do_python_build $py_ver)
48-
if [ $(lex_pyver $py_ver) -ge $(lex_pyver 3) ]; then \
49-
ln -s /opt/$py_ver/bin/python3 /opt/$py_ver/bin/python;
50-
fi;
51-
ln -s /opt/$py_ver/ /opt/$py_ver2
52-
/opt/$py_ver/bin/python get-pip.py
53-
/opt/$py_ver/bin/pip install wheel
54-
rm -rf Python-$py_ver.tgz Python-$py_ver
52+
if [ $(lex_pyver $py_ver) -lt $(lex_pyver 3.3) ]; then
53+
local soabi_flags_list="mu m"
54+
fi
55+
for soabi_flags in ${soabi_flags_list:-m}; do
56+
tar -xzf Python-$py_ver.tgz
57+
(cd Python-$py_ver && do_python_build $py_ver $soabi_flags)
58+
if [ $(lex_pyver $py_ver) -ge $(lex_pyver 3) ]; then \
59+
ln -s /opt/${py_ver}${soabi_flags}/bin/python3 /opt/${py_ver}${soabi_flags}/bin/python;
60+
fi;
61+
ln -s /opt/${py_ver}${soabi_flags}/ /opt/${py_ver2}${soabi_flags}
62+
[ ! -h /opt/${py_ver2} ] && ln -s /opt/${py_ver}${soabi_flags}/ /opt/$py_ver2
63+
/opt/${py_ver}${soabi_flags}/bin/python get-pip.py
64+
/opt/${py_ver}${soabi_flags}/bin/pip install wheel
65+
rm -rf Python-$py_ver
66+
done
67+
rm -f Python-$py_ver.tgz
5568
}
5669

5770

0 commit comments

Comments
 (0)