mirror of
git://code.qt.io/qt/qt5.git
synced 2026-02-24 16:05:36 +08:00
Update Emscripten to 3.1.56 for Qt 6.8 release.
Change-Id: Ic5054aa7b00fba1f155824a710b9562d2a8a2f95
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit e4f7db1379)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
55 lines
1.6 KiB
Bash
Executable File
55 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copyright (C) 2023 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
|
|
|
|
# shellcheck source=./SetEnvVar.sh
|
|
source "${BASH_SOURCE%/*}/SetEnvVar.sh"
|
|
|
|
# shellcheck source=./DownloadURL.sh
|
|
source "${BASH_SOURCE%/*}/DownloadURL.sh"
|
|
|
|
version="3.1.56"
|
|
versionNode="v16.20.0"
|
|
tarBallVersion="${version//./_}"
|
|
if uname -a |grep -q Darwin; then
|
|
tarBallPackage="emsdk_macos_${tarBallVersion}.tar.gz"
|
|
sha="24c49db971da4fd7c68f6b71984c3d7775fdfb84"
|
|
else
|
|
tarBallPackage="emsdk_linux_${tarBallVersion}.tar.gz"
|
|
sha="410c93bb2ab3b244190c2cb5f0ff1ce5d6ac4eb5"
|
|
fi
|
|
cacheUrl="https://ci-files01-hki.ci.qt.io/input/emsdk/${tarBallPackage}"
|
|
target="/tmp/${tarBallPackage}"
|
|
|
|
mkdir -p /opt
|
|
cd /opt
|
|
echo "URL: $cacheUrl"
|
|
|
|
if DownloadURL "$cacheUrl" "" "$sha" "$target"; then
|
|
sudo tar -xzf "$target" -C /opt/
|
|
sudo rm -f "$target"
|
|
else
|
|
echo "Emsdk isn't cached. Cloning it"
|
|
sudo git clone https://github.com/emscripten-core/emsdk.git
|
|
cd emsdk
|
|
sudo ./emsdk install "$version"
|
|
sudo ./emsdk activate "$version"
|
|
fi
|
|
|
|
# platform-specific toolchain and node binaries. urls obtained from "emsdk install"
|
|
if uname -a |grep -q Darwin; then
|
|
pathNodeExecutable="node-$versionNode-darwin-x64/bin/node"
|
|
else
|
|
pathNodeExecutable="node-$versionNode-linux-x64/bin/node"
|
|
fi
|
|
|
|
emsdkPath="/opt/emsdk/"
|
|
emscriptenPath="${emsdkPath}upstream/emscripten/"
|
|
|
|
SetEnvVar "PATH" "\"\$PATH:${emscriptenPath}\""
|
|
SetEnvVar "EMSCRIPTEN" "${emscriptenPath}"
|
|
SetEnvVar "EMSDK" "${emsdkPath}"
|
|
SetEnvVar "EMSDK_NODE" "${emsdkPath}${pathNodeExecutable}"
|
|
|
|
echo "Emsdk = $version" >> ~/versions.txt
|