diff --git a/ci/Jenkinsfile.e2e b/ci/Jenkinsfile.e2e index 1230f95219f..faae8e8585f 100644 --- a/ci/Jenkinsfile.e2e +++ b/ci/Jenkinsfile.e2e @@ -5,7 +5,7 @@ def isPRBuild = utils.isPRBuild() pipeline { agent { - label 'linux && x86_64 && qt-5.14.2' + label 'linux && x86_64 && qt-5.15.2' } parameters { @@ -52,6 +52,7 @@ pipeline { NIMFLAGS = '--colors:off' /* Makefile assumes the compiler folder is included */ QTDIR = '/opt/qt/5.15.2/gcc_64' + PATH = "${env.QTDIR}/bin:${env.PATH}" /* Include library in order to compile the project */ LD_LIBRARY_PATH = "$QTDIR/lib:$WORKSPACE/vendor/status-go/build/bin:$WORKSPACE/vendor/status-keycard-go/build/libkeycard/" /* Container ports */ @@ -138,7 +139,7 @@ pipeline { '--config', 'addAUT', 'nim_status_client', "${WORKSPACE}/bin", ].join('\n'), - squishPackageName: 'squish-6.7.2-qt514x-linux64', + squishPackageName: 'squish-7.1.0-qt515x-linux64', testSuite: "${WORKSPACE}/test/ui-test/testSuites/*", ]) print("Squish run result: ${result}") diff --git a/ci/Jenkinsfile.macos b/ci/Jenkinsfile.macos index b2f614b1612..380a4c1bf06 100644 --- a/ci/Jenkinsfile.macos +++ b/ci/Jenkinsfile.macos @@ -5,7 +5,7 @@ def isPRBuild = utils.isPRBuild() pipeline { agent { - label 'macos && x86_64 && qt-5.14.2' + label 'macos && x86_64 && qt-5.15.2' } parameters { @@ -44,7 +44,7 @@ pipeline { /* Disable colors in Nim compiler logs */ NIMFLAGS = '--colors:off' /* Qt location is pre-defined */ - QTDIR = '/usr/local/qt/clang_64' + QTDIR = '/usr/local/qt/5.15.2/clang_64' PATH = "${env.QTDIR}/bin:${env.PATH}" /* Control output the filename */ STATUS_CLIENT_DMG = "pkg/${utils.pkgFilename(ext: 'dmg')}" diff --git a/scripts/macos_build_setup.sh b/scripts/macos_build_setup.sh new file mode 100755 index 00000000000..57e81398931 --- /dev/null +++ b/scripts/macos_build_setup.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash +set -eo pipefail + +GO_VERSION="1.19.5" +GO_INSTALL_DIR="/usr/local/go" +QT_VERSION="5.15.2" +QT_INSTALL_DIR="/usr/local/qt" + +function check_version { + if [[ "$(uname -s)" != "Darwin" ]]; then + echo "ERROR: Installer intended for MacOS/Darwin!" + exit 1 + fi +} + +function install_build_dependencies { + echo "Install build dependencies" + brew install cmake pkg-config libtool jq node@18 +} + +function install_qt { + echo "Install QT" + brew install python@3.10 + pip3 install -U pip + pip3 install aqtinstall + aqt install-qt mac desktop ${QT_VERSION} clang_64 -m qtwebengine -O ${QT_INSTALL_DIR} +} + +function get_go_arch { + case "$(uname -m)" in + "x86_64") echo "amd64" ;; + "aarch64") echo "arm64" ;; + "armv*") echo "armv6l" ;; + *) echo "UNKNOWN" ;; + esac +} + +function install_golang { + if [[ -x "$(command -v go)" ]]; then + echo "Already present: $(go version)" + return + fi + declare -A GO_SHA256_MAP + GO_SHA256_MAP=( + ["amd64"]="23d22bb6571bbd60197bee8aaa10e702f9802786c2e2ddce5c84527e86b66aa0" + ["arm64"]="4a67f2bf0601afe2177eb58f825adf83509511d77ab79174db0712dc9efa16c8" + ) + echo "Install GoLang ${GO_VERSION}" + GO_ARCH=$(get_go_arch) + GO_OS=$(uname -s | tr '[:upper:]' '[:lower:]') + GO_TARBALL="go${GO_VERSION}.${GO_OS}-${GO_ARCH}.tar.gz" + wget -q "https://dl.google.com/go/${GO_TARBALL}" -O "${GO_TARBALL}" + echo "${GO_SHA256_MAP[${GO_ARCH}]} ${GO_TARBALL}" | sha256sum -c + tar -C "${GO_INSTALL_DIR%/go}" -xzf "${GO_TARBALL}" + rm "${GO_TARBALL}" + ln -s "${GO_INSTALL_DIR}/bin/go" /usr/local/bin +} + +function success_message { + msg=" +SUCCESS! + +Before you attempt to build status-dektop you'll need a few environment variables set: + +export QTDIR=${QT_INSTALL_DIR}/${QT_VERSION}/clang_64 +export PATH=\$QTDIR:\$QTDIR/bin:\$PATH +" + echo $msg +} + +if [ "$0" = "$BASH_SOURCE" ]; then + check_version + install_build_dependencies + install_qt + install_golang + success_message +fi diff --git a/scripts/ubuntu_build_setup.sh b/scripts/ubuntu_build_setup.sh index 8af8c190a69..5cff9440572 100755 --- a/scripts/ubuntu_build_setup.sh +++ b/scripts/ubuntu_build_setup.sh @@ -1,6 +1,11 @@ #!/usr/bin/env bash set -eo pipefail +GO_VERSION="1.19.5" +GO_INSTALL_DIR="/usr/local/go" +QT_VERSION="5.15.2" +QT_INSTALL_DIR="/opt/qt" + function check_version { source /etc/os-release @@ -40,20 +45,38 @@ function install_qt { apt install -y python3-pip pip install -U pip pip install aqtinstall - aqt install-qt linux desktop 5.14.2 gcc_64 -m qtwebengine qtlottie -O /opt/qt + aqt install-qt linux desktop ${QT_VERSION} gcc_64 -m qtwebengine -O ${QT_INSTALL_DIR} +} + +function get_go_arch { + case "$(uname -m)" in + "x86_64") echo "amd64" ;; + "aarch64") echo "arm64" ;; + "armv*") echo "armv6l" ;; + *) echo "UNKNOWN" ;; + esac } function install_golang { - if ! [[ -x "$(command -v go)" ]]; then - echo "Install GoLang" - export GOLANG_SHA256="006f6622718212363fa1ff004a6ab4d87bbbe772ec5631bab7cac10be346e4f1" - export GOLANG_TARBALL="go1.18.5.linux-arm64.tar.gz" - wget -q "https://dl.google.com/go/${GOLANG_TARBALL}" - echo "${GOLANG_SHA256} ${GOLANG_TARBALL}" | sha256sum -c - tar -C /usr/local -xzf "${GOLANG_TARBALL}" - rm "${GOLANG_TARBALL}" - ln -s /usr/local/go/bin/go /usr/local/bin + if [[ -x "$(command -v go)" ]]; then + echo "Already present: $(go version)" + return fi + declare -A GO_SHA256_MAP + GO_SHA256_MAP=( + ["amd64"]="36519702ae2fd573c9869461990ae550c8c0d955cd28d2827a6b159fda81ff95" + ["arm64"]="fc0aa29c933cec8d76f5435d859aaf42249aa08c74eb2d154689ae44c08d23b3" + ["armv6l"]="ec14f04bdaf4a62bdcf8b55b9b6434cc27c2df7d214d0bb7076a7597283b026a" + ) + echo "Install GoLang ${GO_VERSION}" + GO_OS=$(uname -s | tr '[:upper:]' '[:lower:]') + GO_ARCH=$(get_go_arch) + GO_TARBALL="go${GO_VERSION}.${GO_OS}-${GO_ARCH}.tar.gz" + wget -q "https://dl.google.com/go/${GO_TARBALL}" -O "${GO_TARBALL}" + echo "${GO_SHA256_MAP[${GO_ARCH}]} ${GO_TARBALL}" | sha256sum -c + tar -C "${GO_INSTALL_DIR}" -xzf "${GO_TARBALL}" + rm "${GO_TARBALL}" + ln -s "${GO_INSTALL_DIR}/go/bin/go" /usr/local/bin } function success_message { @@ -62,7 +85,7 @@ SUCCESS! Before you attempt to build status-dektop you'll need a few environment variables set: -export QTDIR=/opt/qt/5.14.2/gcc_64 +export QTDIR=${QT_INSTALL_DIR}/${QT_VERSION}/gcc_64 export PATH=\$QTDIR:\$QTDIR/bin:\$PATH " echo $msg