diff --git a/docker/Dockerfile b/docker/Dockerfile index 5ba824a0..33c0eebe 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -32,6 +32,12 @@ COPY build_scripts/build_utils.sh /build_scripts/ COPY build_scripts/build_env_runtime.sh /build_scripts/ RUN manylinux-entrypoint /build_scripts/install-runtime-packages.sh +COPY build_scripts/install-patchelf.sh /build_scripts/ +RUN export PATCHELF_VERSION=0.12 && \ + export PATCHELF_HASH=3dca33fb862213b3541350e1da262249959595903f559eae0fbc68966e9c3f56 && \ + export PATCHELF_DOWNLOAD_URL=https://github.com/NixOS/patchelf/archive && \ + manylinux-entrypoint /build_scripts/install-patchelf.sh + COPY build_scripts/install-libxcrypt.sh /build_scripts/ RUN export LIBXCRYPT_VERSION=4.4.17 && \ export LIBXCRYPT_HASH=7665168d0409574a03f7b484682e68334764c29c21ca5df438955a381384ca07 && \ diff --git a/docker/build_scripts/build_env_runtime.sh b/docker/build_scripts/build_env_runtime.sh index cd2bb0a7..f4ede4f0 100644 --- a/docker/build_scripts/build_env_runtime.sh +++ b/docker/build_scripts/build_env_runtime.sh @@ -1,9 +1,5 @@ # source me -PATCHELF_VERSION=0.12 -PATCHELF_HASH=3dca33fb862213b3541350e1da262249959595903f559eae0fbc68966e9c3f56 -PATCHELF_DOWNLOAD_URL=https://github.com/NixOS/patchelf/archive - AUTOMAKE_ROOT=automake-1.16.2 AUTOMAKE_HASH=b2f361094b410b4acbf4efba7337bdb786335ca09eb2518635a09fb7319ca5c1 AUTOMAKE_DOWNLOAD_URL=http://ftp.gnu.org/gnu/automake diff --git a/docker/build_scripts/build_utils.sh b/docker/build_scripts/build_utils.sh index 88acdc73..45f0e75c 100755 --- a/docker/build_scripts/build_utils.sh +++ b/docker/build_scripts/build_utils.sh @@ -159,17 +159,3 @@ function build_libtool { (cd ${libtool_fname} && do_standard_install) rm -rf ${libtool_fname} ${libtool_fname}.tar.gz } - - -function build_patchelf { - local patchelf_version=$1 - local patchelf_hash=$2 - check_var ${patchelf_version} - check_var ${patchelf_hash} - check_var ${PATCHELF_DOWNLOAD_URL} - fetch_source ${patchelf_version}.tar.gz ${PATCHELF_DOWNLOAD_URL} - check_sha256sum ${patchelf_version}.tar.gz $patchelf_hash - tar -xzf ${patchelf_version}.tar.gz - (cd patchelf-$patchelf_version && ./bootstrap.sh && do_standard_install) - rm -rf ${patchelf_version}.tar.gz patchelf-$patchelf_version -} diff --git a/docker/build_scripts/install-patchelf.sh b/docker/build_scripts/install-patchelf.sh new file mode 100755 index 00000000..b6062c59 --- /dev/null +++ b/docker/build_scripts/install-patchelf.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Top-level build script called from Dockerfile + +# Stop at any error, show all commands +set -exuo pipefail + +# Get script directory +MY_DIR=$(dirname "${BASH_SOURCE[0]}") + +# Get build utilities +source $MY_DIR/build_utils.sh + +# Install patchelf (latest with unreleased bug fixes) and apply our patches +check_var ${PATCHELF_VERSION} +check_var ${PATCHELF_HASH} +check_var ${PATCHELF_DOWNLOAD_URL} +fetch_source ${PATCHELF_VERSION}.tar.gz ${PATCHELF_DOWNLOAD_URL} +check_sha256sum ${PATCHELF_VERSION}.tar.gz ${PATCHELF_HASH} +tar -xzf ${PATCHELF_VERSION}.tar.gz +pushd patchelf-${PATCHELF_VERSION} +./bootstrap.sh +do_standard_install +popd +rm -rf ${PATCHELF_VERSION}.tar.gz patchelf-${PATCHELF_VERSION} + + +patchelf --version diff --git a/docker/build_scripts/install-runtime-packages.sh b/docker/build_scripts/install-runtime-packages.sh index 137b5dac..cd662aaa 100755 --- a/docker/build_scripts/install-runtime-packages.sh +++ b/docker/build_scripts/install-runtime-packages.sh @@ -130,9 +130,6 @@ automake --version build_libtool $LIBTOOL_ROOT $LIBTOOL_HASH libtool --version -# Install patchelf (latest with unreleased bug fixes) and apply our patches -build_patchelf $PATCHELF_VERSION $PATCHELF_HASH - # Strip what we can -- and ignore errors, because this just attempts to strip # *everything*, including non-ELF files: find /usr/local -type f -print0 | xargs -0 -n1 strip --strip-unneeded 2>/dev/null || true