diff options
Diffstat (limited to 'coin/provisioning/common')
24 files changed, 377 insertions, 95 deletions
diff --git a/coin/provisioning/common/linux/disable-ntp_linux.sh b/coin/provisioning/common/linux/disable-ntp_linux.sh index b73e44a5..06d17be0 100755 --- a/coin/provisioning/common/linux/disable-ntp_linux.sh +++ b/coin/provisioning/common/linux/disable-ntp_linux.sh @@ -39,6 +39,8 @@ echo "Disable Network Time Protocol (NTP)" if uname -a |grep -q "Ubuntu"; then sudo timedatectl set-ntp false +elif cat /etc/os-release | grep "PRETTY_NAME" | grep -q "Leap 15"; then + (sudo systemctl stop chronyd && sudo systemctl disable chronyd) else (systemctl &>/dev/null && sudo systemctl disable ntpd) || sudo /sbin/chkconfig ntpd off fi diff --git a/coin/provisioning/common/linux/docker.sh b/coin/provisioning/common/linux/docker.sh index 16af0a0a..1d9e8419 100755 --- a/coin/provisioning/common/linux/docker.sh +++ b/coin/provisioning/common/linux/docker.sh @@ -2,7 +2,7 @@ ############################################################################# ## -## Copyright (C) 2017 The Qt Company Ltd. +## Copyright (C) 2018 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the provisioning scripts of the Qt Toolkit. @@ -48,5 +48,8 @@ sudo docker info sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose +# Install Avahi to discover Docker containers in the test network +sudo apt-get install avahi-daemon -y + # Start testserver provisioning -source "${BASH_SOURCE%/*}/testserver/docker_testserver.sh" +source "${BASH_SOURCE%/*}/docker_testserver.sh" diff --git a/coin/provisioning/common/linux/testserver/docker_testserver.sh b/coin/provisioning/common/linux/docker_testserver.sh index 2534c416..2d5d9611 100755 --- a/coin/provisioning/common/linux/testserver/docker_testserver.sh +++ b/coin/provisioning/common/linux/docker_testserver.sh @@ -2,7 +2,7 @@ ############################################################################# ## -## Copyright (C) 2017 The Qt Company Ltd. +## Copyright (C) 2018 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the provisioning scripts of the Qt Toolkit. @@ -35,35 +35,28 @@ set -ex +case ${BASH_SOURCE[0]} in + */linux/*) SERVER_PATH="${BASH_SOURCE[0]%/linux/*}/shared/testserver" ;; + */*) SERVER_PATH="${BASH_SOURCE[0]%/*}/../shared/testserver" ;; + *) SERVER_PATH="../shared/testserver" ;; +esac + +# testserver shared scripts +source "$SERVER_PATH/testserver_util.sh" + # Using SHA-1 of each server context as the tag of docker images. A tag labels a # specific image version. It is used by docker compose file (docker-compose.yml) # to launch the corresponding docker containers. If one of the server contexts # (./apache2, ./danted, ...) gets changes, all the related compose files in # qtbase should be updated as well. -# -# For example, here's how to get the SHA-1 of apache test server. -# find ./apache2 -type f -print0 | sort -z | xargs -r0 sha1sum | \ -# awk '{ print $1 }' | sha1sum | awk '{ print $1 }' -testserver='apache2 squid vsftpd ftp-proxy danted' +source "$SERVER_PATH/settings.sh" for server in $testserver do - context="${BASH_SOURCE%/*}/$server" - sha1=$(find $context -type f -print0 | sort -z | xargs -r0 sha1sum | awk '{ print $1 }' | \ - sha1sum | awk '{ print $1 }') - sudo docker build -t qt-test-server-$server:$sha1 $context - - # transition - The fixed tag is temporarily used by CI to pass the qtbase testing. - case $server in - apache2) fixed_tag="cc9ea678b92bdda33acb9fa0159bb4ad0f3cd947" ;; - squid) fixed_tag="577d99307eea9a8cccfec944d25be2bce2fe99cc" ;; - vsftpd) fixed_tag="18896604c7e90b543e56d80c8a8aabdb65a590d0" ;; - ftp-proxy) fixed_tag="2c6c8f1ab6a364b540c43d705fb6f15a585cb2af" ;; - danted) fixed_tag="327dd56c3c35db85b26fac93213a5a1918475bc7" ;; - esac - [ -z "$fixed_tag" ] || \ - sudo docker tag qt-test-server-$server:$sha1 qt-test-server-$server:$fixed_tag + context="$SERVER_PATH/$server" + # Sort files by their SHA-1 and use the accumulated result as the TAG + sudo docker build -t qt-test-server-$server:$(sha1tree $context) $context done sudo docker images diff --git a/coin/provisioning/common/linux/qnx_700.sh b/coin/provisioning/common/linux/qnx_700.sh index 3c821fec..02cd57d3 100755 --- a/coin/provisioning/common/linux/qnx_700.sh +++ b/coin/provisioning/common/linux/qnx_700.sh @@ -41,8 +41,8 @@ set -ex source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" targetFolder="/opt/" -sourceFile="http://ci-files01-hki.intra.qt.io/input/qnx/qnx700-20180801-linux.tar.xz" -sha1="5d2c8f531823b1f7a2e20968dc698c187c7de94c" +sourceFile="http://ci-files01-hki.intra.qt.io/input/qnx/qnx700-20190325-linux.tar.xz" +sha1="a278234bf38cc70ead98fc0a8d2e63070fb69621" folderName="qnx700" targetFile="qnx700.tar.xz" wget --tries=5 --waitretry=5 --progress=dot:giga --output-document="$targetFile" "$sourceFile" diff --git a/coin/provisioning/common/macos/python2.sh b/coin/provisioning/common/macos/python2.sh index f4016f8d..4ab914de 100755 --- a/coin/provisioning/common/macos/python2.sh +++ b/coin/provisioning/common/macos/python2.sh @@ -42,9 +42,9 @@ source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" # shellcheck source=./pip.sh source "${BASH_SOURCE%/*}/pip.sh" -PrimaryUrl="http://ci-files01-hki.intra.qt.io/input/mac/python-2.7.14-macosx10.6.pkg" -AltUrl="https://www.python.org/ftp/python/2.7.14/python-2.7.14-macosx10.6.pkg" -SHA1="fa2bb77243ad0cb611aa3295204fab403bb0fa09" +PrimaryUrl="http://ci-files01-hki.intra.qt.io/input/mac/python-2.7.16-macosx10.6.pkg" +AltUrl="https://www.python.org/ftp/python/2.7.16/python-2.7.16-macosx10.6.pkg" +SHA1="895a8327a58e7c0e58852638ab3d84843643535b" DestDir="/" InstallPKGFromURL "$PrimaryUrl" "$AltUrl" "$SHA1" "$DestDir" @@ -55,5 +55,5 @@ InstallPip python2.7 SetEnvVar "PATH" "/Library/Frameworks/Python.framework/Versions/2.7/bin/:\$PATH" -echo "python2 = 2.7.14" >> ~/versions.txt +echo "python2 = 2.7.16" >> ~/versions.txt diff --git a/coin/provisioning/common/linux/testserver/apache2/Dockerfile b/coin/provisioning/common/shared/testserver/apache2/Dockerfile index b39eb21e..b39eb21e 100644 --- a/coin/provisioning/common/linux/testserver/apache2/Dockerfile +++ b/coin/provisioning/common/shared/testserver/apache2/Dockerfile diff --git a/coin/provisioning/common/linux/testserver/danted/Dockerfile b/coin/provisioning/common/shared/testserver/danted/Dockerfile index 67c1159b..67c1159b 100644 --- a/coin/provisioning/common/linux/testserver/danted/Dockerfile +++ b/coin/provisioning/common/shared/testserver/danted/Dockerfile diff --git a/coin/provisioning/common/linux/testserver/danted/danted b/coin/provisioning/common/shared/testserver/danted/danted index 1da8203e..1da8203e 100755 --- a/coin/provisioning/common/linux/testserver/danted/danted +++ b/coin/provisioning/common/shared/testserver/danted/danted diff --git a/coin/provisioning/common/linux/testserver/danted/danted-authenticating b/coin/provisioning/common/shared/testserver/danted/danted-authenticating index 7aa35db6..7aa35db6 100755 --- a/coin/provisioning/common/linux/testserver/danted/danted-authenticating +++ b/coin/provisioning/common/shared/testserver/danted/danted-authenticating diff --git a/coin/provisioning/common/shared/testserver/docker_machine.sh b/coin/provisioning/common/shared/testserver/docker_machine.sh new file mode 100755 index 00000000..601056a4 --- /dev/null +++ b/coin/provisioning/common/shared/testserver/docker_machine.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash + +############################################################################# +## +## Copyright (C) 2018 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$ +## +############################################################################# + +set -ex + +TestMachine='qt-test-server' + +# Deploy docker virtual machine (Boot2Docker) into VirtualBox only if it doesn't exist +if [ -z $(docker-machine ls -q --filter "name=$TestMachine") ] +then + docker-machine create -d virtualbox $TestMachine + docker-machine ip $TestMachine +fi + +# Switch the docker engine to $TestMachine +eval $(docker-machine env $TestMachine) + +docker-machine ls diff --git a/coin/provisioning/common/linux/testserver/ftp-proxy/Dockerfile b/coin/provisioning/common/shared/testserver/ftp-proxy/Dockerfile index c719c1eb..c719c1eb 100644 --- a/coin/provisioning/common/linux/testserver/ftp-proxy/Dockerfile +++ b/coin/provisioning/common/shared/testserver/ftp-proxy/Dockerfile diff --git a/coin/provisioning/common/shared/testserver/settings.sh b/coin/provisioning/common/shared/testserver/settings.sh new file mode 100644 index 00000000..041661f2 --- /dev/null +++ b/coin/provisioning/common/shared/testserver/settings.sh @@ -0,0 +1,37 @@ +############################################################################# +## +## Copyright (C) 2018 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$ +## +############################################################################# + +set -ex + +# A list of test servers to be provisioned +testserver='apache2 squid vsftpd ftp-proxy danted' diff --git a/coin/provisioning/common/linux/testserver/squid/Dockerfile b/coin/provisioning/common/shared/testserver/squid/Dockerfile index f0ed68b3..f0ed68b3 100644 --- a/coin/provisioning/common/linux/testserver/squid/Dockerfile +++ b/coin/provisioning/common/shared/testserver/squid/Dockerfile diff --git a/coin/provisioning/common/shared/testserver/testserver_util.sh b/coin/provisioning/common/shared/testserver/testserver_util.sh new file mode 100644 index 00000000..c42fb5e0 --- /dev/null +++ b/coin/provisioning/common/shared/testserver/testserver_util.sh @@ -0,0 +1,41 @@ +############################################################################# +## +## Copyright (C) 2018 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$ +## +############################################################################# + +set -ex + +# Sort files by their SHA-1, and then return the accumulated result +sha1tree () { + find "$@" -type f -print0 | \ + xargs -0 shasum | cut -d ' ' -f 1 | \ + sort | shasum | cut -d ' ' -f 1 +} diff --git a/coin/provisioning/common/linux/testserver/vsftpd/Dockerfile b/coin/provisioning/common/shared/testserver/vsftpd/Dockerfile index af6cd7c7..af6cd7c7 100644 --- a/coin/provisioning/common/linux/testserver/vsftpd/Dockerfile +++ b/coin/provisioning/common/shared/testserver/vsftpd/Dockerfile diff --git a/coin/provisioning/common/linux/emsdk.sh b/coin/provisioning/common/unix/emsdk.sh index 55f5a8c9..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.16" +version="1.38.27" version_node="8.9.1" -urlEmscriptenCache="http://ci-files01-hki.intra.qt.io/input/emsdk/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="353ad7bf614f73b73ed1d05aedd66321d679e03d" -sha1EmscriptenLlvm="e132c26ad657c07f88cc550fd23f1d6f1b6c0673" -sha1Node="eaec5de2af934f7ebc7f9597983e71c5d5a9a726" +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" +sha1Emscripten="ff9748a8f6b8eaa8192cce9fe2befc801443a161" + +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/09-install-openssl.sh b/coin/provisioning/common/windows/09-install-openssl.sh new file mode 100755 index 00000000..4f1d3768 --- /dev/null +++ b/coin/provisioning/common/windows/09-install-openssl.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -ex + +# shellcheck source=../common/unix/install-openssl.sh +source "${BASH_SOURCE%/*}/../common/unix/install-openssl.sh" "linux" diff --git a/coin/provisioning/common/windows/msvc_2015_update3_patch.ps1 b/coin/provisioning/common/windows/50-openssl_for_android_linux.sh index bfbb397a..81ea3b17 100644..100755 --- a/coin/provisioning/common/windows/msvc_2015_update3_patch.ps1 +++ b/coin/provisioning/common/windows/50-openssl_for_android_linux.sh @@ -1,3 +1,5 @@ +#!/bin/bash + ############################################################################# ## ## Copyright (C) 2017 The Qt Company Ltd. @@ -30,38 +32,8 @@ ## $QT_END_LICENSE$ ## ############################################################################# -. "$PSScriptRoot\helpers.ps1" - -# Install Cumulative Servicing Release Visual Studio 2015 update 3 -# Original download page: https://msdn.microsoft.com/en-us/library/mt752379.aspx - -$version = "2015 update3 (KB3165756)" -$packagePath = "C:\Windows\Temp" -$package = $packagePath + "\vs14-kb3165756.exe" -$url_cache = "http://ci-files01-hki.intra.qt.io/input/windows/vs14-kb3165756.exe" -$url_official = "http://go.microsoft.com/fwlink/?LinkID=816878" -$sha1 = "6a21d9b291ca75d44baad95e278fdc0d05d84c02" -$preparedPackage = "\\ci-files01-hki.intra.qt.io\provisioning\windows\vs14-kb3165756-update" - -if (Test-Path $preparedPackage) { - # The prepared package contains updated packages so that not everything has to be downloaded - Write-Host "Using prepared package" - Copy-Item -Recurse $preparedPackage $packagePath - # Remove the whole downloaded folder - $toRemove = $packagePath + "\vs14-kb3165756-update" - $executable = "$toRemove\vs14-kb3165756.exe" -} else { - Write-Host "Fetching patch for Visual Studio $version..." - Download $url_official $url_cache $package - $executable = $package - # Remove the downloaded executable - $toRemove = $executable -} - -Verify-Checksum $executable $sha1 -Write-Host "Installing patch for Visual Studio $version..." -Run-Executable $executable "/norestart /passive" -Remove-Item -Force -Recurse -Path $toRemove +set -ex -Write-Output "Visual Studio = $version" >> ~\versions.txt +# shellcheck source=../common/linux/openssl_for_android_linux.sh +source "${BASH_SOURCE%/*}/../common/linux/openssl_for_android_linux.sh" diff --git a/coin/provisioning/common/windows/disable-defragment.ps1 b/coin/provisioning/common/windows/disable-defragment.ps1 index 876938f8..e76f0649 100644 --- a/coin/provisioning/common/windows/disable-defragment.ps1 +++ b/coin/provisioning/common/windows/disable-defragment.ps1 @@ -1,6 +1,6 @@ ############################################################################# ## -## Copyright (C) 2018 The Qt Company Ltd. +## 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. @@ -31,4 +31,42 @@ ## ############################################################################# -schtasks /Delete /TN "\Microsoft\Windows\Defrag\ScheduledDefrag" /F +# Windows 7 does not have Get-ScheduledTask and Unregister-ScheduledTask +# thus needing its own version. +Write-Host "Disabling defragmentation" +$version = Get-CimInstance Win32_OperatingSystem | Select-Object -ExpandProperty Caption +if ($version -like '*Windows 7*'){ + $pi = New-Object System.Diagnostics.ProcessStartInfo + $pi.FileName = "C:\Windows\System32\schtasks.exe" + $pi.RedirectStandardError = $true + $pi.UseShellExecute = $false + $pi.Arguments = "/Delete /TN `"\Microsoft\Windows\Defrag\ScheduledDefrag`" /F" + $prog = New-Object System.Diagnostics.Process + $prog.StartInfo = $pi + $prog.Start() | Out-Null + $err = $prog.StandardError.ReadToEnd() + $prog.WaitForExit() + if ($prog.ExitCode -eq 0){ + Write-Host "Scheduled defragmentation removed" + } else { + if ($err -like '*cannot find the file*'){ + Write-Host "No scheduled defragmentation task found" + exit 0 + } else { + Write-Host "Error while deleting scheduled defragmentation task: $err" + } + } +} +else { + try { + $state = (Get-ScheduledTask -ErrorAction Stop -TaskName "ScheduledDefrag").State + Write-Host "Scheduled defragmentation task found in state: $state" + } + catch { + Write-Host "No scheduled defragmentation task found" + exit 0 + } + Write-Host "Unregistering scheduled defragmentation task" + Unregister-ScheduledTask -ErrorAction Stop -Confirm:$false -TaskName ScheduledDefrag + Write-Host "Scheduled Defragmentation task was cancelled" +} 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/install-msys2.ps1 b/coin/provisioning/common/windows/install-msys2.ps1 index e88c8f07..0c4a9680 100644 --- a/coin/provisioning/common/windows/install-msys2.ps1 +++ b/coin/provisioning/common/windows/install-msys2.ps1 @@ -33,6 +33,8 @@ . "$PSScriptRoot\helpers.ps1" +# This script installs 7-Zip + $version = "20181211" $prog = "msys2" if (Is64BitWinHost) { @@ -56,17 +58,13 @@ $TargetLocation = "C:\Utils" Download $url_official $url_cache $PackagePath Verify-Checksum $PackagePath $sha1 Extract-tar_gz $PackagePath $TargetLocation -$bash = "$TargetLocation\$folder\usr\bin\bash" +$msys = "$TargetLocation\$folder\msys2_shell.cmd" # install perl -Run-Executable "$bash" "`"-l`" `"-c`" `"rm -rf /etc/pacman.d/gnupg;pacman-key --init;pacman-key --populate msys2;pacman -S --noconfirm perl make`"" -Run-Executable "$bash" "`"-l`" `"-c`" `"yes | cpan -i Text::Template Test::More`"" +Run-Executable "$msys" "`"-l`" `"-c`" `"rm -rf /etc/pacman.d/gnupg;pacman-key --init;pacman-key --populate msys2;pacman -S --noconfirm perl make`"" +Run-Executable "$msys" "`"-l`" `"-c`" `"cpan -i Text::Template Test::More`"" Write-Host "Cleaning $PackagePath.." Remove-Item -Recurse -Force -Path "$PackagePath" -# pacman-key launches gpg-agent and dirmngr in the background, see https://github.com/Alexpux/MSYS2-pacman/issues/56 -Stop-Process -Name "gpg-agent" -ErrorAction Ignore -Stop-Process -Name "dirmngr" -ErrorAction Ignore - -Write-Output "MSYS2 = $version" >> ~\versions.txt +Write-Output "7-Zip = $version" >> ~\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/common/windows/mysql.ps1 b/coin/provisioning/common/windows/mysql.ps1 index 29ce0ab4..8ed91402 100644 --- a/coin/provisioning/common/windows/mysql.ps1 +++ b/coin/provisioning/common/windows/mysql.ps1 @@ -1,6 +1,6 @@ ############################################################################# ## -## Copyright (C) 2017 The Qt Company Ltd. +## 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. @@ -36,7 +36,7 @@ # This script installs MySQL $version. # Both x86 and x64 versions needed when x86 integrations are done on x64 machine -$version = "5.6.11" +$version = "5.7.25" $baseNameX64 = "mysql-$version-winx64" $packagex64 = "C:\Windows\temp\$baseNameX64.zip" $baseNameX86 = "mysql-$version-win32" diff --git a/coin/provisioning/common/windows/unset-proxy.ps1 b/coin/provisioning/common/windows/unset-proxy.ps1 index 9c3dddb3..0b7d761f 100644 --- a/coin/provisioning/common/windows/unset-proxy.ps1 +++ b/coin/provisioning/common/windows/unset-proxy.ps1 @@ -38,6 +38,11 @@ $dcs = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ $dcs[8] = $_ -band 0xF7 Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections" -Name DefaultConnectionSettings -Value $dcs Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyEnable -Value 0 -Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer -Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyOverride +if(Get-ItemProperty -ErrorAction SilentlyContinue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer){ + Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer + +} +if(Get-ItemProperty -ErrorAction SilentlyContinue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyOverride){ + Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyOverride +} |