Skip to content

Commit 4a20e4b

Browse files
authored
Merge pull request pypa#161 from jcfr/build-scripts-cleanup
Build scripts cleanup
2 parents 5aa69f9 + 8efa4ef commit 4a20e4b

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

docker/build_scripts/build.sh

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,30 @@ rpm -Uvh --replacepkgs epel-release-5*.rpm
5555
rm -f epel-release-5*.rpm
5656

5757
# Development tools and libraries
58-
yum -y install bzip2 make patch unzip bison yasm diffutils \
59-
automake which file cmake28 \
58+
yum -y install \
59+
automake \
60+
bison \
61+
bzip2 \
62+
cmake28 \
63+
devtoolset-2-binutils \
64+
devtoolset-2-gcc \
65+
devtoolset-2-gcc-c++ \
66+
devtoolset-2-gcc-gfortran \
67+
diffutils \
68+
expat-devel \
69+
gettext \
6070
kernel-devel-`uname -r` \
61-
expat-devel gettext \
62-
devtoolset-2-binutils devtoolset-2-gcc \
63-
devtoolset-2-gcc-c++ devtoolset-2-gcc-gfortran \
71+
file \
72+
make \
73+
patch \
74+
unzip \
75+
which \
76+
yasm \
6477
${PYTHON_COMPILE_DEPS}
6578

6679
# Build an OpenSSL for both curl and the Pythons. We'll delete this at the end.
6780
build_openssl $OPENSSL_ROOT $OPENSSL_HASH
81+
6882
# Install curl so we can have TLS 1.2 in this ancient container.
6983
build_curl $CURL_ROOT $CURL_HASH
7084
hash -r
@@ -92,8 +106,7 @@ curl -fsSLO https://sqlite.org/2017/$SQLITE_AUTOCONF_VERSION.tar.gz
92106
check_sha256sum $SQLITE_AUTOCONF_VERSION.tar.gz $SQLITE_AUTOCONF_HASH
93107
tar xfz $SQLITE_AUTOCONF_VERSION.tar.gz
94108
cd $SQLITE_AUTOCONF_VERSION
95-
./configure
96-
make install
109+
do_standard_install
97110
cd ..
98111
rm -rf $SQLITE_AUTOCONF_VERSION*
99112

@@ -126,26 +139,34 @@ rm -rf /usr/local/ssl
126139
curl -fsSL -o patchelf.tar.gz https://github.com/NixOS/patchelf/archive/$PATCHELF_VERSION.tar.gz
127140
check_sha256sum patchelf.tar.gz $PATCHELF_HASH
128141
tar -xzf patchelf.tar.gz
129-
(cd patchelf-$PATCHELF_VERSION && ./bootstrap.sh && ./configure && make && make install)
142+
(cd patchelf-$PATCHELF_VERSION && ./bootstrap.sh && do_standard_install)
130143
rm -rf patchelf.tar.gz patchelf-$PATCHELF_VERSION
131144

132145
ln -s $PY36_BIN/auditwheel /usr/local/bin/auditwheel
133146

134147
# Clean up development headers and other unnecessary stuff for
135148
# final image
136-
yum -y erase wireless-tools gtk2 libX11 hicolor-icon-theme \
137-
avahi freetype bitstream-vera-fonts \
138-
expat-devel gettext \
149+
yum -y erase \
150+
avahi \
151+
bitstream-vera-fonts \
152+
freetype \
153+
gtk2 \
154+
hicolor-icon-theme \
155+
libX11 \
156+
wireless-tools \
139157
${PYTHON_COMPILE_DEPS} > /dev/null 2>&1
140158
yum -y install ${MANYLINUX1_DEPS}
141159
yum -y clean all > /dev/null 2>&1
142160
yum list installed
161+
143162
# we don't need libpython*.a, and they're many megabytes
144163
find /opt/_internal -name '*.a' -print0 | xargs -0 rm -f
164+
145165
# Strip what we can -- and ignore errors, because this just attempts to strip
146166
# *everything*, including non-ELF files:
147167
find /opt/_internal -type f -print0 \
148168
| xargs -0 -n1 strip --strip-unneeded 2>/dev/null || true
169+
149170
# We do not need the Python test suites, or indeed the precompiled .pyc and
150171
# .pyo files. Partially cribbed from:
151172
# https://github.com/docker-library/python/blob/master/3.4/slim/Dockerfile

0 commit comments

Comments
 (0)