@@ -10,14 +10,14 @@ MY_DIR=$(dirname "${BASH_SOURCE[0]}")
1010
1111# Dependencies for compiling Python that we want to remove from
1212# the final image after compiling Python
13- PYTHON_COMPILE_DEPS=" zlib-devel bzip2-devel expat-devel ncurses-devel readline-devel tk-devel gdbm-devel db4 -devel libpcap-devel xz-devel"
13+ PYTHON_COMPILE_DEPS=" zlib-devel bzip2-devel expat-devel ncurses-devel readline-devel tk-devel gdbm-devel libdb -devel libpcap-devel xz-devel openssl-devel keyutils-libs-devel krb5-devel libcom_err-devel libidn-devel curl-devel perl -devel"
1414
15- # Libraries that are allowed as part of the manylinux2010 profile
16- # Extract from PEP: https://www.python.org/dev/peps/pep-0571 /#the-manylinux2010 -policy
15+ # Libraries that are allowed as part of the manylinux2014 profile
16+ # Extract from PEP: https://www.python.org/dev/peps/pep-0599 /#the-manylinux2014 -policy
1717# On RPM-based systems, they are provided by these packages:
1818# Package: Libraries
1919# glib2: libglib-2.0.so.0, libgthread-2.0.so.0, libgobject-2.0.so.0
20- # glibc: libresolv.so.2, libutil.so.1, libnsl.so.1, librt.so.1, libcrypt.so.1, libpthread.so.0, libdl.so.2, libm.so.6, libc.so.6
20+ # glibc: libresolv.so.2, libutil.so.1, libnsl.so.1, librt.so.1, libpthread.so.0, libdl.so.2, libm.so.6, libc.so.6
2121# libICE: libICE.so.6
2222# libX11: libX11.so.6
2323# libXext: libXext.so.6
@@ -28,7 +28,7 @@ PYTHON_COMPILE_DEPS="zlib-devel bzip2-devel expat-devel ncurses-devel readline-d
2828#
2929# PEP is missing the package for libSM.so.6 for RPM based system
3030# Install development packages (except for libgcc which is provided by gcc install)
31- MANYLINUX2010_DEPS =" glibc-devel libstdc++-devel glib2-devel libX11-devel libXext-devel libXrender-devel mesa-libGL-devel libICE-devel libSM-devel"
31+ MANYLINUX_DEPS =" glibc-devel libstdc++-devel glib2-devel libX11-devel libXext-devel libXrender-devel mesa-libGL-devel libICE-devel libSM-devel"
3232
3333# Get build utilities
3434source $MY_DIR /build_utils.sh
5151# Decided not to clean at this point: https://github.com/pypa/manylinux/pull/129
5252yum -y update
5353
54- # EPEL support (for cmake28 & yasm)
55- yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
56-
57- case $AUDITWHEEL_ARCH in
58- x86_64)
59- # Install devtoolset-8
60- yum -y install centos-release-scl
61- yum -y install \
62- devtoolset-8-binutils \
63- devtoolset-8-gcc \
64- devtoolset-8-gcc-c++ \
65- devtoolset-8-gcc-gfortran \
66- ;;
67- i686)
68- # Install devtoolset-7 (binutils, gcc, gcc-c++, gcc-gfortran)
69- devtoolset7s=(
70- " devtoolset-7-runtime-7.1-4.el6.i686.rpm"
71- " devtoolset-7-binutils-2.28-11.el6.i686.rpm"
72- " devtoolset-7-gcc-7.3.1-5.10.el6.i686.rpm"
73- " devtoolset-7-libstdc++-devel-7.3.1-5.10.el6.i686.rpm"
74- " devtoolset-7-gcc-c++-7.3.1-5.10.el6.i686.rpm"
75- " devtoolset-7-libquadmath-devel-7.3.1-5.10.el6.i686.rpm"
76- " devtoolset-7-gcc-gfortran-7.3.1-5.10.el6.i686.rpm"
77- )
78- for rpm in " ${devtoolset7s[@]} " ; do
79- yum install -y " https://www.repo.cloudlinux.com/cloudlinux/6.10/sclo/devtoolset-7/i386/$rpm "
80- done
81- ;;
82- esac
54+ DEVTOOLSET8_TOOLCHAIN_DEPS=" devtoolset-8-binutils devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-gcc-gfortran"
55+ DEFAULT_TOOLCHAIN_DEPS=" gcc gcc-c++ gcc-gfortran"
56+ if [ " ${AUDITWHEEL_ARCH} " == " x86_64" ]; then
57+ # Software collection (for devtoolset-8)
58+ yum -y install centos-release-scl-rh
59+ # EPEL support (for yasm)
60+ yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
61+ YASM=yasm
62+ TOOLCHAIN_DEPS=${DEVTOOLSET8_TOOLCHAIN_DEPS}
63+ elif [ " ${AUDITWHEEL_ARCH} " == " aarch64" ]; then
64+ # Software collection (for devtoolset-8)
65+ yum -y install centos-release-scl-rh
66+ TOOLCHAIN_DEPS=${DEVTOOLSET8_TOOLCHAIN_DEPS}
67+ elif [ " ${AUDITWHEEL_ARCH} " == " i686" ]; then
68+ # No yasm, no devtoolset-8 on i686
69+ TOOLCHAIN_DEPS=${DEFAULT_TOOLCHAIN_DEPS}
70+ fi
8371
8472# Development tools and libraries
8573yum -y install \
8674 automake \
8775 bison \
8876 bzip2 \
89- cmake28 \
77+ ${TOOLCHAIN_DEPS} \
9078 diffutils \
9179 gettext \
9280 file \
@@ -96,17 +84,12 @@ yum -y install \
9684 patch \
9785 unzip \
9886 which \
99- yasm \
87+ ${YASM} \
10088 ${PYTHON_COMPILE_DEPS}
10189
102- # Install a git we link against system OpenSSL/Curl
103- yum -y install openssl-devel keyutils-libs-devel krb5-devel libcom_err-devel libidn-devel curl-devel perl-devel
90+ # Install git
10491build_git $GIT_ROOT $GIT_HASH
10592git version
106- yum -y erase openssl-devel keyutils-libs-devel krb5-devel libcom_err-devel libidn-devel curl-devel perl-devel
107-
108- # Build an OpenSSL for Pythons. We'll delete this at the end.
109- build_openssl $OPENSSL_ROOT $OPENSSL_HASH
11093
11194# Install newest autoconf
11295build_autoconf $AUTOCONF_ROOT $AUTOCONF_HASH
@@ -155,8 +138,6 @@ ln -s $($PY37_BIN/python -c 'import certifi; print(certifi.where())') \
155138# Dockerfiles:
156139export SSL_CERT_FILE=/opt/_internal/certs.pem
157140
158- # Now we can delete our built OpenSSL headers/static libs since we've linked everything we need
159- rm -rf /usr/local/ssl
160141
161142# Install patchelf (latest with unreleased bug fixes)
162143curl -fsSL -o patchelf.tar.gz https://github.com/NixOS/patchelf/archive/$PATCHELF_VERSION .tar.gz
@@ -179,7 +160,7 @@ yum -y erase \
179160 libX11 \
180161 wireless-tools \
181162 ${PYTHON_COMPILE_DEPS} > /dev/null 2>&1
182- yum -y install ${MANYLINUX2010_DEPS }
163+ yum -y install ${MANYLINUX_DEPS }
183164yum -y clean all > /dev/null 2>&1
184165yum list installed
185166
@@ -211,9 +192,11 @@ find /opt/_internal -depth \
211192# Fix libc headers to remain compatible with C99 compilers.
212193find /usr/include/ -type f -exec sed -i ' s/\bextern _*inline_*\b/extern __inline __attribute__ ((__gnu_inline__))/g' {} +
213194
214- # remove useless things that have been installed by devtoolset
215- rm -rf $DEVTOOLSET_ROOTPATH /usr/share/man
216- find $DEVTOOLSET_ROOTPATH /usr/share/locale -mindepth 1 -maxdepth 1 -not \( -name ' en*' -or -name ' locale.alias' \) | xargs rm -rf
195+ if [ " ${DEVTOOLSET_ROOTPATH:- } " != " " ]; then
196+ # remove useless things that have been installed by devtoolset
197+ rm -rf $DEVTOOLSET_ROOTPATH /usr/share/man
198+ find $DEVTOOLSET_ROOTPATH /usr/share/locale -mindepth 1 -maxdepth 1 -not \( -name ' en*' -or -name ' locale.alias' \) | xargs rm -rf
199+ fi
217200rm -rf /usr/share/backgrounds
218201# if we updated glibc, we need to strip locales again...
219202localedef --list-archive | grep -v -i ^en_US.utf8 | xargs localedef --delete-from-archive
0 commit comments