diff --git a/tools/wheel/image/dependencies/projects.cmake b/tools/wheel/image/dependencies/projects.cmake index 7709663b80f1..13fbe88b47a6 100644 --- a/tools/wheel/image/dependencies/projects.cmake +++ b/tools/wheel/image/dependencies/projects.cmake @@ -4,6 +4,12 @@ if(NOT APPLE) set(libxcrypt_url "https://github.com/besser82/libxcrypt/archive/v${libxcrypt_version}/libxcrypt-${libxcrypt_version}.tar.gz") set(libxcrypt_md5 "4828b1530f5bf35af0b45b35acc4db1d") list(APPEND ALL_PROJECTS libxcrypt) + + # patchelf + set(patchelf_version 0.12) + set(patchelf_url "https://github.com/NixOS/patchelf/tarball/99c24238981b7b1084313aca8f5c493bb46f302c") + set(patchelf_md5 "9fa63224f9b73060ef6bd37f8effea8c") + list(APPEND ALL_PROJECTS patchelf) endif() # zlib diff --git a/tools/wheel/image/dependencies/projects/patchelf.cmake b/tools/wheel/image/dependencies/projects/patchelf.cmake new file mode 100644 index 000000000000..97d857743a05 --- /dev/null +++ b/tools/wheel/image/dependencies/projects/patchelf.cmake @@ -0,0 +1,17 @@ +ExternalProject_Add(patchelf + URL ${patchelf_url} + URL_MD5 ${patchelf_md5} + ${COMMON_EP_ARGS} + BUILD_IN_SOURCE 1 + PATCH_COMMAND ./bootstrap.sh + CONFIGURE_COMMAND ./configure + --prefix=${CMAKE_INSTALL_PREFIX} + --disable-shared + CFLAGS=-fPIC + CXXFLAGS=-fPIC + BUILD_COMMAND make + INSTALL_COMMAND make install + ) + +# Note: patchelf is only used at build time, so there is no need to extract the +# license for redistribution. diff --git a/tools/wheel/image/provision-python.sh b/tools/wheel/image/provision-python.sh index 254f93a04991..51c5c747ed00 100755 --- a/tools/wheel/image/provision-python.sh +++ b/tools/wheel/image/provision-python.sh @@ -48,7 +48,3 @@ pip install \ setuptools \ wheel \ auditwheel - -if [[ "$(uname)" == "Linux" ]]; then - pip install patchelf -fi