summaryrefslogtreecommitdiffstats
path: root/coin
diff options
context:
space:
mode:
authorJuha Karjalainen <juha.karjalainen@qt.io>2019-04-16 10:16:41 +0300
committerHeikki Halmet <heikki.halmet@qt.io>2019-07-31 09:44:53 +0300
commit38e416be664dc216b332e6b4ff8d38905dfdc1e9 (patch)
tree480bb178c2dd81d909386eb8ca1981fb455ff1d4 /coin
parente6823acbc7b4690f6adcc9fd1cd5c0a2b37564e4 (diff)
Add webAssembly build for windows and macos
Provision emsdk and its dependecies to windows and macos. Task-number: QTBUG-63917 Task-number: QTQAINFRA-2835 Done-with: Juha Karjalainen <juha.karjalainen@qt.io> Change-Id: I24ea9cbc4f7cc95e6952765099d5e46247470011 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Diffstat (limited to 'coin')
-rw-r--r--coin/platform_configs/qt5.txt2
-rwxr-xr-xcoin/provisioning/common/unix/emsdk.sh (renamed from coin/provisioning/common/linux/emsdk.sh)48
-rwxr-xr-xcoin/provisioning/common/windows/emsdk.ps1121
-rw-r--r--coin/provisioning/common/windows/msys.ps12
-rwxr-xr-xcoin/provisioning/qtci-linux-openSUSE-15.0-x86_64/55-emsdk.sh4
-rw-r--r--coin/provisioning/qtci-macos-10.13-x86_64/36-emsdk.sh6
-rwxr-xr-xcoin/provisioning/qtci-windows-10-x86_64/80-emsdk.ps12
7 files changed, 166 insertions, 19 deletions
diff --git a/coin/platform_configs/qt5.txt b/coin/platform_configs/qt5.txt
index dfa6a2e3..0a216167 100644
--- a/coin/platform_configs/qt5.txt
+++ b/coin/platform_configs/qt5.txt
@@ -22,3 +22,5 @@ qtci-windows-10-x86_64-14 QNX_700 armv8 Mingw73
qtci-windows-10-x86_64-14 QNX_700 x86_64 Mingw73 Packaging DisableTests -opensource -confirm-license -verbose -prefix c:\Users\qt\work\install -release -opengl es2 -nomake examples -nomake tests -no-sql-mysql -xplatform qnx-x86-64-qcc
qtci-linux-RHEL-7.6-x86_64 QNX_700 armv8 GCC Packaging DisableTests -opensource -confirm-license -verbose -prefix /home/qt/work/install -release -opengl es2 -no-use-gold-linker -nomake examples -nomake tests -no-sql-mysql -qpa qnx -xplatform qnx-aarch64le-qcc
qtci-linux-RHEL-7.6-x86_64 QNX_700 x86_64 GCC Packaging DisableTests -opensource -confirm-license -verbose -prefix /home/qt/work/install -release -opengl es2 -no-use-gold-linker -nomake examples -nomake tests -no-sql-mysql -qpa qnx -xplatform qnx-x86-64-qcc
+qtci-windows-10-x86_64-14 WebAssembly Mingw73 Packaging DisableTests -opensource -confirm-license -verbose -prefix c:\Users\qt\work\install -release -nomake examples -nomake tests -no-feature-thread -static -no-dbus -no-headersclean -no-ssl -no-warnings-are-errors -no-pch -platform win32-g++ -xplatform wasm-emscripten
+qtci-macos-10.13-x86_64-2 WebAssembly Clang Packaging DisableTests -opensource -confirm-license -verbose -prefix /Users/qt/work/install -release -nomake examples -nomake tests -no-feature-thread -static -no-dbus -no-headersclean -no-ssl -no-warnings-are-errors -no-pch -xplatform wasm-emscripten
diff --git a/coin/provisioning/common/linux/emsdk.sh b/coin/provisioning/common/unix/emsdk.sh
index 7ccfe0a5..17af067c 100755
--- a/coin/provisioning/common/linux/emsdk.sh
+++ b/coin/provisioning/common/unix/emsdk.sh
@@ -32,25 +32,41 @@
##
#############################################################################
-# shellcheck source=../unix/InstallFromCompressedFileFromURL.sh
-source "${BASH_SOURCE%/*}/../unix/InstallFromCompressedFileFromURL.sh"
-# shellcheck source=../unix/SetEnvVar.sh
-source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh"
-# shellcheck source=../unix/DownloadURL.sh
-source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh"
+# shellcheck source=./InstallFromCompressedFileFromURL.sh
+source "${BASH_SOURCE%/*}/InstallFromCompressedFileFromURL.sh"
+# shellcheck source=./SetEnvVar.sh
+source "${BASH_SOURCE%/*}/SetEnvVar.sh"
+# shellcheck source=./DownloadURL.sh
+source "${BASH_SOURCE%/*}/DownloadURL.sh"
version="1.38.27"
version_node="8.9.1"
-urlEmscriptenCache="http://ci-files01-hki.intra.qt.io/input/emsdk/emscripten-$version.tar.gz"
+urlOfficial="https://s3.amazonaws.com/mozilla-games/emscripten/packages"
+urlCache="http://ci-files01-hki.intra.qt.io/input/emsdk"
+targetFolder="/opt/emsdk"
+
+urlEmscriptenCache="$urlCache/emscripten-$version.tar.gz"
urlEmscriptenExternal="https://github.com/kripken/emscripten/archive/$version.tar.gz"
-urlEmscriptenLlvmCache="http://ci-files01-hki.intra.qt.io/input/emsdk/emscripten-llvm-e$version.tar.gz"
-urlEmscriptenLlvmExternal="https://s3.amazonaws.com/mozilla-games/emscripten/packages/llvm/tag/linux_64bit/emscripten-llvm-e$version.tar.gz"
-urlNodeCache="http://ci-files01-hki.intra.qt.io/input/emsdk/node-v$version_node-linux-x64.tar.xz"
-urlNodeExternal="https://s3.amazonaws.com/mozilla-games/emscripten/packages/node-v$version_node-linux-x64.tar.xz"
sha1Emscripten="ff9748a8f6b8eaa8192cce9fe2befc801443a161"
-sha1EmscriptenLlvm="8f5cd026c98cd40e53e6d11fbc32b116280ef9bb"
-sha1Node="eaec5de2af934f7ebc7f9597983e71c5d5a9a726"
-targetFolder="/opt/emsdk"
+
+if uname -a |grep -q Darwin; then
+ urlEmscriptenLlvmCache="$urlCache/macos/emscripten-llvm-e$version.tar.gz"
+ urlEmscriptenLlvmExternal="$urlOfficial/llvm/tag/osx_64bit/emscripten-llvm-e$version.tar.gz"
+ urlNodeCache="$urlCache/macos/node-v$version_node-darwin-x64.tar.gz"
+ urlNodeExternal="$urlOfficial/node-v$version_node-darwin-x64.tar.gz"
+ sha1EmscriptenLlvm="66dffbc44cfcb7bcb1ed0d2658b519276c3077fa"
+ sha1Node="b9ec6fe9701d385e385886a4b171ba02bb6aead7"
+ node_js="$targetFolder/node-v$version_node-darwin-x64/bin"
+else
+ urlEmscriptenLlvmCache="$urlCache/linux/emscripten-llvm-e$version.tar.gz"
+ urlEmscriptenLlvmExternal="$urlOfficial/llvm/tag/linux_64bit/emscripten-llvm-e$version.tar.gz"
+ urlNodeCache="$urlCache/linux/node-v$version_node-linux-x64.tar.xz"
+ urlNodeExternal="$urlOfficial/node-v$version_node-linux-x64.tar.xz"
+ sha1EmscriptenLlvm="8f5cd026c98cd40e53e6d11fbc32b116280ef9bb"
+ sha1Node="eaec5de2af934f7ebc7f9597983e71c5d5a9a726"
+ node_js="$targetFolder/node-v$version_node-linux-x64/bin"
+fi
+
sudo mkdir "$targetFolder"
InstallFromCompressedFileFromURL "$urlEmscriptenCache" "$urlEmscriptenExternal" "$sha1Emscripten" "$targetFolder" ""
@@ -64,7 +80,7 @@ cat <<EOM >"$targetFolder/.emscripten"
LLVM_ROOT='$targetFolder/emscripten-llvm-e$version/'
EMSCRIPTEN_NATIVE_OPTIMIZER='$targetFolder/emscripten-llvm-e$version/optimizer'
BINARYEN_ROOT='$targetFolder/emscripten-llvm-e$version/binaryen'
-NODE_JS='$targetFolder/node-v$version_node-linux-x64/bin/node'
+NODE_JS='$node_js/node'
EMSCRIPTEN_ROOT='$targetFolder/emscripten-$version'
SPIDERMONKEY_ENGINE = ''
V8_ENGINE = ''
@@ -73,7 +89,7 @@ COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]
EOM
-SetEnvVar "PATH" "\"$targetFolder/emscripten-llvm-e$version/:$targetFolder/node-v$version_node-linux-x64/bin:$targetFolder/emscripten-$version:\$PATH\""
+SetEnvVar "PATH" "\"$targetFolder/emscripten-llvm-e$version/:$node_js:$targetFolder/emscripten-$version:\$PATH\""
SetEnvVar "EMSCRIPTEN" "$targetFolder/emscripten-$version"
SetEnvVar "EM_CONFIG" "$targetFolder/.emscripten"
diff --git a/coin/provisioning/common/windows/emsdk.ps1 b/coin/provisioning/common/windows/emsdk.ps1
new file mode 100755
index 00000000..2ce2754f
--- /dev/null
+++ b/coin/provisioning/common/windows/emsdk.ps1
@@ -0,0 +1,121 @@
+############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the provisioning scripts of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:LGPL21$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see http://www.qt.io/terms-conditions. For further
+## information use the contact form at http://www.qt.io/contact-us.
+##
+## GNU Lesser General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU Lesser
+## General Public License version 2.1 or version 3 as published by the Free
+## Software Foundation and appearing in the file LICENSE.LGPLv21 and
+## LICENSE.LGPLv3 included in the packaging of this file. Please review the
+## following information to ensure the GNU Lesser General Public License
+## requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+##
+## As a special exception, The Qt Company gives you certain additional
+## rights. These rights are described in The Qt Company LGPL Exception
+## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+##
+## $QT_END_LICENSE$
+##
+############################################################################
+
+. "$PSScriptRoot\helpers.ps1"
+
+# This script will install emscripten needed by WebAssembly
+
+$version = "1.38.27"
+$versionNode = "8.9.1"
+$versionWinPython = "2.7.13"
+$versionJre = "8_update_152"
+
+$urlOfficialMozilla = "https://s3.amazonaws.com/mozilla-games/emscripten/packages"
+$urlCache = "http://ci-files01-hki.intra.qt.io/input/emsdk"
+
+$urlOfficialEmscriptenLlvm = "$urlOfficialMozilla/llvm/tag/win_64bit/emscripten-llvm-e$version.zip"
+$urlCacheEmscriptenLlvm = "$urlCache/windows/emscripten-llvm-e$version.zip"
+$sha1EmscriptenLlvm = "1cd950feec50f1f3265f04ab01fb270250eb4232"
+
+$urlOfficialNode = "$urlOfficialMozilla/node-v$versionNode-win-x64.zip"
+$urlCacheNode = "$urlCache/windows/node-v$versionNode-win-x64.zip"
+$sha1Node = "249c840f7b953e4cb7ac9db89aa92a98daa1dc63"
+
+$urlOfficialWinPython = "$urlOfficialMozilla/WinPython-64bit-$versionWinPython.1Zero.zip"
+$urlCacheWinPython = "$urlCache/windows/WinPython-64bit-$versionWinPython.1Zero.zip"
+$sha1WinPython = "7e5a021878e0165ba0603e995b013e244d6e10cb"
+
+$urlOfficialProtableJre = "$urlOfficialMozilla/portable_jre_${versionJre}_64bit.zip"
+$urlCacheProtableJre = "$urlCache/windows/portable_jre_${versionJre}_64bit.zip"
+$sha1ProtableJre = "6830524ec8b16742f956897abb6b6f5ef890a1c2"
+
+$urlOfficialEmscripten = "https://github.com/kripken/emscripten/archive/$version.zip"
+$urlCacheEmscripten = "$urlCache/windows/emscripten-$version.zip"
+$sha1Emscripten = "22d78a0af48b50271ab183fd3d8ea2f9ba311ee7"
+
+$installLocationEmsdk = "C:\\Utils\\emsdk"
+$temp = "C:\Windows\Temp"
+
+function Install {
+
+ Param (
+ [string] $urlOfficial = $(BadParam("Official url path")),
+ [string] $urlCache = $(BadParam("Cached url path")),
+ [string] $sha1 = $(BadParam("SHA1 checksum of the file")),
+ [string] $location = $(BadParam("Download location")),
+ [string] $installLocation = $(BadParam("Install location"))
+ )
+
+ Download $urlOfficial $urlCache $location
+ Verify-Checksum $location $sha1
+ Extract-7Zip $location $installLocation
+
+}
+
+New-Item -ItemType directory -Force -Path "$installLocationEmsdk"
+
+Install $urlOfficialEmscriptenLlvm $urlCacheEmscriptenLlvm $sha1EmscriptenLlvm "$temp\emscripten-llvm-e$version.zip" "$installLocationEmsdk\emscripten-llvm-e$version"
+Install $urlOfficialNode $urlCacheNode $sha1Node "$temp\node-v$versionNode-win-x64.zip" "$installLocationEmsdk"
+Install $urlOfficialWinPython $urlCacheWinPython $sha1WinPython "$temp\WinPython-64bit-$versionWinPython.1Zero.zip" "$installLocationEmsdk"
+Install $urlOfficialProtableJre $urlCacheProtableJre $sha1ProtableJre "$temp\portable_jre_$versionJre_64bit.zip" "$installLocationEmsdk"
+Install $urlOfficialEmscripten $urlCacheEmscripten $sha1Emscripten "$temp\emscripten-$version.zip" "$installLocationEmsdk"
+
+cd $installLocationEmsdk
+"LLVM_ROOT='$installLocationEmsdk\\emscripten-llvm-e$version'" | Out-File '.emscripten' -Encoding ASCII
+"EMSCRIPTEN_NATIVE_OPTIMIZER='$installLocationEmsdk\\emscripten-llvm-e$version\\optimizer'" | Out-File '.emscripten' -Append -Encoding ASCII
+"BINARYEN_ROOT='$installLocationEmsdk\\emscripten-llvm-e$version\\binaryen'" | Out-File '.emscripten' -Append -Encoding ASCII
+"NODE_JS='$installLocationEmsdk\\node-v$versionNode-win-x64\\bin\\node'" | Out-File '.emscripten' -Append -Encoding ASCII
+"EMSCRIPTEN_ROOT='$installLocationEmsdk\emscripten-$version'" | Out-File '.emscripten' -Append -Encoding ASCII
+"SPIDERMONKEY_ENGINE = ''" | Out-File '.emscripten' -Append -Encoding ASCII
+"V8_ENGINE = ''" | Out-File '.emscripten' -Append -Encoding ASCII
+"TEMP_DIR = '/tmp'" | Out-File '.emscripten' -Append -Encoding ASCII
+"COMPILER_ENGINE = NODE_JS" | Out-File '.emscripten' -Append -Encoding ASCII
+"JS_ENGINES = [NODE_JS]" | Out-File '.emscripten' -Append -Encoding ASCII
+
+Set-EnvironmentVariable "EMSDK" "$installLocationEmsdk"
+Set-EnvironmentVariable "EM_CONFIG" "$installLocationEmsdk\.emscripten"
+Set-EnvironmentVariable "EMSDK_LLVM_ROOT" "$installLocationEmsdk\emscripten-llvm-e$version"
+Set-EnvironmentVariable "EMSCRIPTEN_NATIVE_OPTIMIZER" "$installLocationEmsdk\emscripten-llvm-e$version\optimizer.exe"
+Set-EnvironmentVariable "BINARYEN_ROOT" "$installLocationEmsdk\emscripten-llvm-e$version\binaryen"
+Set-EnvironmentVariable "EMSDK_NODE" "$installLocationEmsdk\node$versionNode-win-x64\bin\node.exe"
+Set-EnvironmentVariable "EMSDK_PYTHON" "$installLocationEmsdk\WinPython-64bit-$versionWinPython.1Zero\python-$versionWinPython.amd64\python.exe"
+Set-EnvironmentVariable "EMSDK_JAVA_HOME" "$installLocationEmsdk\java64"
+Set-EnvironmentVariable "EMSCRIPTEN" "$installLocationEmsdk\emscripten-$version"
+Set-EnvironmentVariable "EMSCRIPTEN_ROOT" "$installLocationEmsdk\emscripten-$version"
+Set-EnvironmentVariable "EMSDK_PATH" "$installLocationEmsdk\emscripten-$version;$installLocationEmsdk;$installLocationEmsdk\node$versionNode-win-x64\bin;$installLocationEmsdk\emscripten-llvm-e$version;$installLocationEmsdk\WinPython-64bit-$versionWinPython.1Zero\python-$versionWinPython.amd64;$installLocationEmsdk\java64\bin"
+
+Write-Output "emsdk = $version" >> ~/versions.txt
+Write-Output "emsdk llvm = $version" >> ~/versions.txt
+Write-Output "emsdk NodeJs = $versionNode" >> ~/versions.txt
+Write-Output "emsdk WinPython 64bit = $versionWinPython" >> ~/versions.txt
+Write-Output "emsdk portable jre = $versionJre" >> ~/versions.txt
diff --git a/coin/provisioning/common/windows/msys.ps1 b/coin/provisioning/common/windows/msys.ps1
index df67cc20..f004bb49 100644
--- a/coin/provisioning/common/windows/msys.ps1
+++ b/coin/provisioning/common/windows/msys.ps1
@@ -12,5 +12,5 @@ $destination = "C:\msys"
Download $url $url $zip
Verify-Checksum $zip $sha1
C:\Utils\sevenzip\7z.exe x $zip -oC:\
-
+Set-EnvironmentVariable "MSYS_PATH" "$destination\\1.0\\bin"
Write-Output "Msys = $version" >> ~/versions.txt
diff --git a/coin/provisioning/qtci-linux-openSUSE-15.0-x86_64/55-emsdk.sh b/coin/provisioning/qtci-linux-openSUSE-15.0-x86_64/55-emsdk.sh
index 09a76778..44cf1b80 100755
--- a/coin/provisioning/qtci-linux-openSUSE-15.0-x86_64/55-emsdk.sh
+++ b/coin/provisioning/qtci-linux-openSUSE-15.0-x86_64/55-emsdk.sh
@@ -35,5 +35,5 @@
set -ex
-# shellcheck source=../common/linux/emsdk.sh
-source "${BASH_SOURCE%/*}/../common/linux/emsdk.sh"
+# shellcheck source=../common/unix/emsdk.sh
+source "${BASH_SOURCE%/*}/../common/unix/emsdk.sh"
diff --git a/coin/provisioning/qtci-macos-10.13-x86_64/36-emsdk.sh b/coin/provisioning/qtci-macos-10.13-x86_64/36-emsdk.sh
new file mode 100644
index 00000000..7396d336
--- /dev/null
+++ b/coin/provisioning/qtci-macos-10.13-x86_64/36-emsdk.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+set -ex
+
+# shellcheck source=../common/unix/emsdk.sh
+source "${BASH_SOURCE%/*}/../common/unix/emsdk.sh"
diff --git a/coin/provisioning/qtci-windows-10-x86_64/80-emsdk.ps1 b/coin/provisioning/qtci-windows-10-x86_64/80-emsdk.ps1
new file mode 100755
index 00000000..b72470a2
--- /dev/null
+++ b/coin/provisioning/qtci-windows-10-x86_64/80-emsdk.ps1
@@ -0,0 +1,2 @@
+. "$PSScriptRoot\..\common\windows\emsdk.ps1"
+