2018-08-03 09:21:03 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
2022-12-24 20:49:50 -03:00
|
|
|
# Copyright (c) 2018-2022 The Bitcoin Core developers
|
2018-08-03 09:21:03 -04:00
|
|
|
# Distributed under the MIT software license, see the accompanying
|
|
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2018-08-07 05:50:05 -04:00
|
|
|
export LC_ALL=C.UTF-8
|
2018-08-03 09:21:03 -04:00
|
|
|
|
2019-10-14 18:00:49 -03:00
|
|
|
# Make sure default datadir does not exist and is never read by creating a dummy file
|
2020-11-08 07:28:24 -03:00
|
|
|
if [ "$CI_OS_NAME" == "macos" ]; then
|
2021-11-07 09:13:39 -03:00
|
|
|
echo > "${HOME}/Library/Application Support/Bitcoin"
|
2019-10-14 18:00:49 -03:00
|
|
|
else
|
2022-01-31 08:09:37 -03:00
|
|
|
CI_EXEC echo \> \$HOME/.bitcoin
|
2022-10-06 16:06:29 -03:00
|
|
|
CI_EXEC_ROOT echo \> \$HOME/.bitcoin
|
2019-10-14 18:00:49 -03:00
|
|
|
fi
|
2018-08-03 09:21:03 -04:00
|
|
|
|
2022-01-31 08:09:37 -03:00
|
|
|
CI_EXEC mkdir -p "${DEPENDS_DIR}/SDKs" "${DEPENDS_DIR}/sdk-sources"
|
2018-08-03 09:21:03 -04:00
|
|
|
|
2021-11-25 14:32:22 -03:00
|
|
|
OSX_SDK_BASENAME="Xcode-${XCODE_VERSION}-${XCODE_BUILD_ID}-extracted-SDK-with-libcxx-headers"
|
2020-06-18 18:05:22 -04:00
|
|
|
|
2021-11-25 14:32:22 -03:00
|
|
|
if [ -n "$XCODE_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${OSX_SDK_BASENAME}" ]; then
|
|
|
|
OSX_SDK_FILENAME="${OSX_SDK_BASENAME}.tar.gz"
|
|
|
|
OSX_SDK_PATH="${DEPENDS_DIR}/sdk-sources/${OSX_SDK_FILENAME}"
|
|
|
|
if [ ! -f "$OSX_SDK_PATH" ]; then
|
2022-01-31 08:09:37 -03:00
|
|
|
CI_EXEC curl --location --fail "${SDK_URL}/${OSX_SDK_FILENAME}" -o "$OSX_SDK_PATH"
|
2021-11-25 14:32:22 -03:00
|
|
|
fi
|
2022-01-31 08:09:37 -03:00
|
|
|
CI_EXEC tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH"
|
2019-10-17 12:31:20 -03:00
|
|
|
fi
|
2020-06-01 04:12:33 -04:00
|
|
|
|
2021-11-25 14:32:22 -03:00
|
|
|
if [ -n "$ANDROID_HOME" ] && [ ! -d "$ANDROID_HOME" ]; then
|
|
|
|
ANDROID_TOOLS_PATH=${DEPENDS_DIR}/sdk-sources/android-tools.zip
|
|
|
|
if [ ! -f "$ANDROID_TOOLS_PATH" ]; then
|
2022-01-31 08:09:37 -03:00
|
|
|
CI_EXEC curl --location --fail "${ANDROID_TOOLS_URL}" -o "$ANDROID_TOOLS_PATH"
|
2021-11-25 14:32:22 -03:00
|
|
|
fi
|
2022-05-31 06:50:19 -04:00
|
|
|
CI_EXEC mkdir -p "$ANDROID_HOME"
|
|
|
|
CI_EXEC unzip -o "$ANDROID_TOOLS_PATH" -d "$ANDROID_HOME"
|
|
|
|
CI_EXEC "yes | ${ANDROID_HOME}/cmdline-tools/bin/sdkmanager --sdk_root=\"${ANDROID_HOME}\" --install \"build-tools;${ANDROID_BUILD_TOOLS_VERSION}\" \"platform-tools\" \"platforms;android-${ANDROID_API_LEVEL}\" \"ndk;${ANDROID_NDK_VERSION}\""
|
2020-08-28 05:11:39 -04:00
|
|
|
fi
|
|
|
|
|
2019-10-17 12:31:20 -03:00
|
|
|
if [ -z "$NO_DEPENDS" ]; then
|
2022-01-31 07:19:23 -03:00
|
|
|
if [[ $DOCKER_NAME_TAG == *centos* ]]; then
|
2020-03-03 03:58:57 -03:00
|
|
|
# CentOS has problems building the depends if the config shell is not explicitly set
|
2020-01-08 19:36:46 -03:00
|
|
|
# (i.e. for libevent a Makefile with an empty SHELL variable is generated, leading to
|
|
|
|
# an error as the first command is executed)
|
2022-02-01 06:14:50 -03:00
|
|
|
SHELL_OPTS="LC_ALL=en_US.UTF-8 CONFIG_SHELL=/bin/dash"
|
2020-01-08 19:36:46 -03:00
|
|
|
else
|
|
|
|
SHELL_OPTS="CONFIG_SHELL="
|
|
|
|
fi
|
2022-01-03 10:06:46 -03:00
|
|
|
CI_EXEC "$SHELL_OPTS" make "$MAKEJOBS" -C depends HOST="$HOST" "$DEP_OPTS" LOG=1
|
2018-08-03 09:21:03 -04:00
|
|
|
fi
|
2022-07-20 12:24:17 -04:00
|
|
|
if [ "$DOWNLOAD_PREVIOUS_RELEASES" = "true" ]; then
|
|
|
|
CI_EXEC test/get_previous_releases.py -b -t "$PREVIOUS_RELEASES_DIR"
|
2019-01-05 16:20:42 -03:00
|
|
|
fi
|