Files
qt5/coin/provisioning/common/unix/install-patchelf.sh
Elias Toivola 4dcaf6ec01 Android: move platform dependency from RHEL 8 to RHEL 9
Pick-to: 6.10 6.8 6.5
Task-number: QTQAINFRA-7498
Change-Id: I48a72860fe9d06cde1f014298e68fa28caff730d
Reviewed-by: Tero Heikkinen <tero.heikkinen@qt.io>
2025-10-30 13:52:12 +02:00

36 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
source "${BASH_SOURCE%/*}/../unix/InstallFromCompressedFileFromURL.sh"
# version 0.18.0 doesn't work correctly for Android binaries, so we use 0.17.2
# See patchelf bugreport: https://github.com/NixOS/patchelf/issues/576.
patchelf_version="0.17.2"
url_cached="https://ci-files01-hki.ci.qt.io/input/android/patchelf/$patchelf_version.tar.gz"
url_public="https://github.com/NixOS/patchelf/archive/refs/tags/$patchelf_version.tar.gz"
sha1="ddd46a2e2a16a308245c008721d877455b23bba8"
target_source_dir="$HOME/patchelf-$patchelf_version"
if [ ! -d "$target_source_dir" ]; then
InstallFromCompressedFileFromURL "$url_cached" "$url_public" "$sha1" "$HOME" ""
fi
pushd "$target_source_dir" || exit
./bootstrap.sh
./configure
make
sudo make install
popd || exit
if [[ "$(uname -s)" = "Linux" && -f /etc/redhat-release ]]; then
# RHEL-9 with sudo or non-interactive shells do not include /usr/local/bin/ in PATH
# Add a symlink so patchelf is found in later scripts
echo "Creating symlink for patchelf in /usr/bin"
sudo ln -sf /usr/local/bin/patchelf /usr/bin/patchelf
fi