Skip to content

Commit

Permalink
GitHub Actions: Ship the necessary OpenSSL libs
Browse files Browse the repository at this point in the history
These are necessary for update checks and news.

The OpenSSL libraries seem to not be installed for distributing them
along with applications on GitHub Actions (as opposed to AppVeyor). To
have them available I opted to download them from download.qt.io,
extending the install-qt.sh script to be able to install openssl as
well.
  • Loading branch information
bjorn committed Oct 28, 2020
1 parent 67ed44d commit b60a341
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 28 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,17 @@ jobs:

strategy:
matrix:
arch: [32, 64]
include:
- arch: 32
openssl_arch: x86
- arch: 64
openssl_arch: x64

env:
QT_TOOLCHAIN: win${{ matrix.arch }}_mingw81
MINGW_VERSION: 8.1.0
MINGW_COMPONENT: win${{ matrix.arch }}_mingw810
OPENSSL_VERSION: 1.1.1

defaults:
run:
Expand All @@ -135,6 +140,7 @@ jobs:
run: |
echo "QT_PATH=$(./dist/install-qt.sh --version ${QT_VERSION} --toolchain ${QT_TOOLCHAIN} qtbase qtdeclarative qtscript qtsvg qtimageformats qttools qttranslations)" >> $GITHUB_ENV
echo "MINGW_PATH=$(./dist/install-qt.sh --version ${MINGW_VERSION} ${MINGW_COMPONENT})" >> $GITHUB_ENV
echo "OPENSSL_PATH=$(./dist/install-qt.sh --version ${OPENSSL_VERSION} openssl --arch ${{ matrix.openssl_arch }})" >> $GITHUB_ENV
./dist/install-qt.sh --version ${QTCREATOR_VERSION} qtcreator >> $GITHUB_PATH
- name: Setup Qbs
Expand Down
28 changes: 16 additions & 12 deletions dist/distribute.qbs
Original file line number Diff line number Diff line change
Expand Up @@ -296,19 +296,23 @@ Product {
condition: qbs.targetOS.contains("windows") && File.exists(prefix)

prefix: {
// Not sure what this check should be exactly, but Qt 5.6.3 was
// built against OpenSSL 1.0.2 whereas Qt 5.12.5 was built against
// OpenSSL 1.1.1.
if (Qt.core.versionMinor >= 12) {
if (qbs.architecture === "x86_64")
return "C:/OpenSSL-v111-Win64/"
else
return "C:/OpenSSL-v111-Win32/"
if (project.openSslPath) {
return project.openSslPath + "/";
} else {
if (qbs.architecture === "x86_64")
return "C:/OpenSSL-Win64/"
else
return "C:/OpenSSL-Win32/"
// Not sure what this check should be exactly, but Qt 5.6.3 was
// built against OpenSSL 1.0.2 whereas Qt 5.12.5 was built against
// OpenSSL 1.1.1.
if (Qt.core.versionMinor >= 12) {
if (qbs.architecture === "x86_64")
return "C:/OpenSSL-v111-Win64/"
else
return "C:/OpenSSL-v111-Win32/"
} else {
if (qbs.architecture === "x86_64")
return "C:/OpenSSL-Win64/"
else
return "C:/OpenSSL-Win32/"
}
}
}
files: {
Expand Down
32 changes: 27 additions & 5 deletions dist/install-qt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ Options
desktop
win64_mingw73, win64_msvc2017_64 (default)
--arch <arch>
The CPU architecture to use when installing openssl (x86 or x64).
--version <version>
The desired Qt version. Currently supported are all versions
above 5.9.0.
Expand All @@ -111,6 +114,7 @@ COMPONENTS=
VERSION=
FORCE_DOWNLOAD=false
MD5_TOOL=md5sum
ARCH=

case "$OSTYPE" in
*linux*)
Expand Down Expand Up @@ -156,6 +160,10 @@ while [ $# -gt 0 ]; do
TOOLCHAIN=$(echo $2 | tr '[A-Z]' '[a-z]')
shift
;;
--arch)
ARCH="$2"
shift
;;
--version)
VERSION="$2"
shift
Expand Down Expand Up @@ -231,17 +239,30 @@ function compute_url(){
local COMPONENT=$1
local CURL="curl -s -L"
local BASE_URL="http://download.qt.io/online/qtsdkrepository/${HOST_OS}/${TARGET_PLATFORM}"
if [[ "${COMPONENT}" =~ "mingw" ]]; then
if [[ "${COMPONENT}" =~ "qtcreator" ]]; then
REMOTE_BASE="tools_qtcreator/qt.tools.qtcreator"
REMOTE_PATH="$(${CURL} ${BASE_URL}/${REMOTE_BASE}/ | grep -o -E "${VERSION}[0-9\-]*${COMPONENT}\.7z" | tail -1)"

if [ ! -z "${REMOTE_PATH}" ]; then
echo "${BASE_URL}/${REMOTE_BASE}/${REMOTE_PATH}"
return 0
fi
elif [[ "${COMPONENT}" =~ "mingw" ]]; then
REMOTE_BASE="tools_mingw/qt.tools.${COMPONENT}"
REMOTE_PATH="$(${CURL} ${BASE_URL}/${REMOTE_BASE}/ | grep -o -E "${VERSION}[[:alnum:]_.\-]*rev0.7z" | tail -1)"

if [ ! -z "${REMOTE_PATH}" ]; then
echo "${BASE_URL}/${REMOTE_BASE}/${REMOTE_PATH}"
return 0
fi
elif [[ "${COMPONENT}" =~ "qtcreator" ]]; then
REMOTE_BASE="tools_qtcreator/qt.tools.qtcreator"
REMOTE_PATH="$(${CURL} ${BASE_URL}/${REMOTE_BASE}/ | grep -o -E "${VERSION}[0-9\-]*${COMPONENT}\.7z" | tail -1)"
elif [[ "${COMPONENT}" =~ "openssl" ]]; then
if [ -z "${ARCH}" ]; then
echo "No architecture specified for openssl (x86 or x64)." >&2
exit 1
fi

REMOTE_BASE="tools_${COMPONENT}_${ARCH}/qt.tools.${COMPONENT}.win_${ARCH}"
REMOTE_PATH="$(${CURL} ${BASE_URL}/${REMOTE_BASE}/ | grep -o -E "[[:alnum:]_.\-]*${ARCH}.7z" | tail -1)"

if [ ! -z "${REMOTE_PATH}" ]; then
echo "${BASE_URL}/${REMOTE_BASE}/${REMOTE_PATH}"
Expand Down Expand Up @@ -327,6 +348,7 @@ for COMPONENT in ${COMPONENTS}; do
echo "${INSTALL_DIR}/Tools/mingw810_32/bin"
elif [[ "${COMPONENT}" =~ "win64_mingw" ]]; then
echo "${INSTALL_DIR}/Tools/mingw810_64/bin"
elif [[ "${COMPONENT}" =~ "openssl" ]]; then
echo "${INSTALL_DIR}/Tools/OpenSSL/Win_${ARCH}/bin"
fi

done
24 changes: 14 additions & 10 deletions dist/win/installer.qbs
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,21 @@ WindowsInstallerPackage {
if (File.exists(Environment.getEnv("PYTHONHOME")))
defs.push("Python");

// Not sure what this check should be exactly, but Qt 5.6.3 was
// built against OpenSSL 1.0.2 whereas Qt 5.12.5 was built against
// OpenSSL 1.1.1.
if (Qt.core.versionMinor >= 12) {
var openSslDir = "C:\\OpenSSL-v111-Win" + bits
if (File.exists(openSslDir))
defs.push("OpenSsl111Dir=" + openSslDir);
if (project.openSslPath) {
defs.push("OpenSsl111Dir=" + project.openSslPath);
} else {
var openSslDir = "C:\\OpenSSL-Win" + bits
if (File.exists(openSslDir))
defs.push("OpenSsl102Dir=" + openSslDir);
// Not sure what this check should be exactly, but Qt 5.6.3 was
// built against OpenSSL 1.0.2 whereas Qt 5.12.5 was built against
// OpenSSL 1.1.1.
if (Qt.core.versionMinor >= 12) {
var openSslDir = "C:\\OpenSSL-v111-Win" + bits
if (File.exists(openSslDir))
defs.push("OpenSsl111Dir=" + openSslDir);
} else {
var openSslDir = "C:\\OpenSSL-Win" + bits
if (File.exists(openSslDir))
defs.push("OpenSsl102Dir=" + openSslDir);
}
}

return defs;
Expand Down
1 change: 1 addition & 0 deletions tiled.qbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Project {
property bool useRPaths: true
property bool windowsInstaller: false
property bool enableZstd: false
property string openSslPath: Environment.getEnv("OPENSSL_PATH")

references: [
"dist/archive.qbs",
Expand Down

0 comments on commit b60a341

Please sign in to comment.