From b041acefe6a6b37d0b56d2bbdf8296d539b28b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simo=20F=C3=A4lt?= Date: Wed, 20 Sep 2023 13:13:08 +0300 Subject: IFW: Enable static build on Linux It seems the RHEL can't detect static openssl libs among the shared libs, so we need to install additional version of openssl, where we have only archives. Task-number: QTIFW-3158 Change-Id: I0c65da6f3c3f9ed2e9c627390622b81dccd36bf6 Reviewed-by: Katja Marttila --- coin/platform_configs/installer-framework.yaml | 6 +++++- .../platform_configs/tqtc-installer-framework.yaml | 6 +++++- .../90-install-static-openssl.sh | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100755 coin/provisioning/qtci-linux-RHEL-8.4-x86_64/90-install-static-openssl.sh diff --git a/coin/platform_configs/installer-framework.yaml b/coin/platform_configs/installer-framework.yaml index 60b44bdc..7b28ab3a 100644 --- a/coin/platform_configs/installer-framework.yaml +++ b/coin/platform_configs/installer-framework.yaml @@ -28,7 +28,11 @@ Configurations: Template: 'qtci-linux-RHEL-8.4-x86_64-50' Compiler: 'GCC' Features: ['Packaging', 'UseConfigure', 'DoNotBuildTests'] - Configure arguments: '-opensource -confirm-license -nomake examples -nomake tests -accessibility -static -release -no-sql-sqlite -no-feature-gssapi -qt-zlib -qt-libpng -qt-libjpeg -no-cups -openssl-linked -bundled-xcb-xinput -no-icu -no-libudev -qt-pcre -no-glib -no-egl -no-sm -qt-harfbuzz OPENSSL_ROOT_DIR={{.Env.OPENSSL_HOME}}' + Configure arguments: '-opensource -confirm-license -nomake examples -nomake tests -accessibility -static -release -no-sql-sqlite -no-feature-gssapi -qt-zlib -qt-libpng -qt-libjpeg -no-cups -openssl-linked -bundled-xcb-xinput -no-icu -no-libudev -qt-pcre -no-glib -no-egl -no-sm -qt-harfbuzz' + Environment variables: [ + 'CMAKE_ARGS=-DOPENSSL_ROOT_DIR={{.Env.OPENSSL_HOME}} -DOPENSSL_USE_STATIC_LIBS=TRUE', + 'NON_QTBASE_CMAKE_ARGS=-DOPENSSL_ROOT_DIR={{.Env.STATIC_OPENSSL_HOME}} -DOPENSSL_USE_STATIC_LIBS=TRUE -DOPENSSL_CRYPTO_LIBRARY={{.Env.STATIC_OPENSSL_HOME}}/lib64/libcrypto.a -DOPENSSL_SSL_LIBRARY={{.Env.STATIC_OPENSSL_HOME}}/lib64/libssl.a', + ] - Template: 'qtci-linux-Ubuntu-18.04-x86_64' Compiler: 'GCC' diff --git a/coin/platform_configs/tqtc-installer-framework.yaml b/coin/platform_configs/tqtc-installer-framework.yaml index 823d1ba8..46b3ab35 100644 --- a/coin/platform_configs/tqtc-installer-framework.yaml +++ b/coin/platform_configs/tqtc-installer-framework.yaml @@ -29,7 +29,11 @@ Configurations: Template: 'qtci-linux-RHEL-8.4-x86_64-50' Compiler: 'GCC' Features: ['Packaging', 'QtInstaller', 'UseConfigure', 'DoNotBuildTests'] - Configure arguments: '-opensource -confirm-license -nomake examples -nomake tests -accessibility -static -release -no-sql-sqlite -no-feature-gssapi -qt-zlib -qt-libpng -qt-libjpeg -no-cups -openssl-linked -bundled-xcb-xinput -no-icu -no-libudev -qt-pcre -no-glib -no-egl -no-sm -qt-harfbuzz OPENSSL_ROOT_DIR={{.Env.OPENSSL_HOME}}' + Configure arguments: '-opensource -confirm-license -nomake examples -nomake tests -accessibility -static -release -no-sql-sqlite -no-feature-gssapi -qt-zlib -qt-libpng -qt-libjpeg -no-cups -openssl-linked -bundled-xcb-xinput -no-icu -no-libudev -qt-pcre -no-glib -no-egl -no-sm -qt-harfbuzz' + Environment variables: [ + 'CMAKE_ARGS=-DOPENSSL_ROOT_DIR={{.Env.OPENSSL_HOME}} -DOPENSSL_USE_STATIC_LIBS=TRUE', + 'NON_QTBASE_CMAKE_ARGS=-DOPENSSL_ROOT_DIR={{.Env.STATIC_OPENSSL_HOME}} -DOPENSSL_USE_STATIC_LIBS=TRUE -DOPENSSL_CRYPTO_LIBRARY={{.Env.STATIC_OPENSSL_HOME}}/lib64/libcrypto.a -DOPENSSL_SSL_LIBRARY={{.Env.STATIC_OPENSSL_HOME}}/lib64/libssl.a', + ] - Template: 'qtci-macos-11-x86_64-104' Compiler: 'Clang' diff --git a/coin/provisioning/qtci-linux-RHEL-8.4-x86_64/90-install-static-openssl.sh b/coin/provisioning/qtci-linux-RHEL-8.4-x86_64/90-install-static-openssl.sh new file mode 100755 index 00000000..4f0442d7 --- /dev/null +++ b/coin/provisioning/qtci-linux-RHEL-8.4-x86_64/90-install-static-openssl.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# Copyright (C) 2021 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 + +set -ex + +# This is required to allow static linking of ifw +os="$1" +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +# shellcheck source=../common/unix/DownloadURL.sh +source "${BASH_SOURCE%/*}/../common/unix/DownloadURL.sh" +# shellcheck source=../common/unix/SetEnvVar.sh +source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh" + +targetFile="/tmp/openssl-$version.tar.gz" +downloadFile="http://ci-files01-hki.intra.qt.io/input/openssl/openssl-3.0.7-static-only.tar.gz" +sha="82376a9e2440a47a83eb861cbf9363b28630a120" +DownloadURL "$downloadFile" "$downloadFile" "$sha" "$targetFile" + +cd $HOME +tar -xzf "$targetFile" +SetEnvVar "STATIC_OPENSSL_HOME" "$HOME/static-openssl" -- cgit v1.2.3