From c22e7ba336762994e1c6d26117d1549e88303560 Mon Sep 17 00:00:00 2001 From: CJCombrink Date: Thu, 4 Apr 2024 20:31:32 +0200 Subject: [PATCH] Try Qt 6.6 --- .github/workflows/build.yaml | 98 +++++++++++++++++++++++++++++------- 1 file changed, 81 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6f2e5ee..9b65d64 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,7 +10,7 @@ name: Build SpellChecker-Plugin on: [push] env: - QT_VERSION: "6.4.2" + QT_VERSION: "6.6.2" QT_CREATOR_VERSION: "13.0.0" QT_MIRRORS: download.qt.io;mirrors.ocf.berkeley.edu/qt;ftp.fau.de/qtproject;mirror.bit.edu.cn/qtproject @@ -130,50 +130,88 @@ jobs: shell: cmake -P {0} run: | set(qt_version "$ENV{QT_VERSION}") + string(REPLACE "." "" qt_version_dotless "${qt_version}") if ("${{ runner.os }}" STREQUAL "Windows") set(url_os "windows_x86") - set(qt_package_arch_suffix "win64_msvc2019_64") - set(qt_dir_prefix "${qt_version}/msvc2019_64") - set(qt_package_suffix "-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64") + if ("x${{ matrix.config.environment_script }}" STREQUAL "x") + set(qt_package_arch_suffix "win64_mingw") + set(qt_dir_prefix "${qt_version}/mingw_64") + set(qt_package_suffix "-Windows-Windows_10_22H2-Mingw-Windows-Windows_10_22H2-X86_64") + elseif ("${{ matrix.config.environment_script }}" MATCHES "vcvars64.bat") + set(qt_package_arch_suffix "win64_msvc2019_64") + set(qt_dir_prefix "${qt_version}/msvc2019_64") + set(qt_package_suffix "-Windows-Windows_10_22H2-MSVC2019-Windows-Windows_10_22H2-X86_64") + endif() elseif ("${{ runner.os }}" STREQUAL "Linux") set(url_os "linux_x64") set(qt_package_arch_suffix "gcc_64") set(qt_dir_prefix "${qt_version}/gcc_64") - set(qt_package_suffix "-Linux-RHEL_8_4-GCC-Linux-RHEL_8_4-X86_64") + set(qt_package_suffix "-Linux-RHEL_8_8-GCC-Linux-RHEL_8_8-X86_64") elseif ("${{ runner.os }}" STREQUAL "macOS") set(url_os "mac_x64") set(qt_package_arch_suffix "clang_64") set(qt_dir_prefix "${qt_version}/macos") - set(qt_package_suffix "-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64") + set(qt_package_suffix "-MacOS-MacOS_13-Clang-MacOS-MacOS_13-X86_64-ARM64") endif() - set(qt_base_url "https://download.qt.io/online/qtsdkrepository/${url_os}/desktop/qt6_${qt_version_dotless}") - file(DOWNLOAD "${qt_base_url}/Updates.xml" ./Updates.xml SHOW_PROGRESS) + + set(qt_base_url "https://\${qt_mirror}/online/qtsdkrepository/${url_os}/desktop/qt6_${qt_version_dotless}") + foreach(qt_mirror $ENV{QT_MIRRORS}) + cmake_language(EVAL CODE " + message(\"Downloading: ${qt_base_url}/Updates.xml\") + file(DOWNLOAD \"${qt_base_url}/Updates.xml\" ./Updates.xml) + ") + file(SIZE ./Updates.xml fileSize) + if (fileSize GREATER 0) + break() + endif() + endforeach() + file(READ ./Updates.xml updates_xml) string(REGEX MATCH "qt.qt6.*([0-9+-.]+)" updates_xml_output "${updates_xml}") set(qt_package_version ${CMAKE_MATCH_1}) - file(MAKE_DIRECTORY qt) + + file(MAKE_DIRECTORY qt6) + # Save the path for other steps - file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qt/${qt_dir_prefix}" qt_dir) - message("::set-output name=qt_dir::${qt_dir}") - message("Downloading Qt to ${qt_dir}") + file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qt6/${qt_dir_prefix}" qt_dir) + file(APPEND "$ENV{GITHUB_OUTPUT}" "qt_dir=${qt_dir}") + function(downloadAndExtract url archive) - message("Downloading ${url}") - file(DOWNLOAD "${url}" ./${archive} SHOW_PROGRESS) - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ../${archive} WORKING_DIRECTORY qt) + foreach(qt_mirror $ENV{QT_MIRRORS}) + cmake_language(EVAL CODE " + message(\"Downloading ${url}\") + file(DOWNLOAD \"${url}\" ./${archive}) + ") + file(SIZE ./${archive} fileSize) + if (fileSize GREATER 0) + break() + endif() + endforeach() + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ../${archive} WORKING_DIRECTORY qt6) endfunction() - foreach(package qtbase qtdeclarative) + + foreach(package qtbase qtdeclarative qttools qtsvg qttranslations) downloadAndExtract( "${qt_base_url}/qt.qt6.${qt_version_dotless}.${qt_package_arch_suffix}/${qt_package_version}${package}${qt_package_suffix}.7z" ${package}.7z ) endforeach() - foreach(package qt5compat qtshadertools) + + foreach(package qtimageformats qtserialport) + downloadAndExtract( + "${qt_base_url}/qt.qt6.${qt_version_dotless}.addons.${package}.${qt_package_arch_suffix}/${qt_package_version}${package}${qt_package_suffix}.7z" + ${package}.7z + ) + endforeach() + + foreach(package qtquicktimeline qtquick3d qt5compat qtshadertools) downloadAndExtract( "${qt_base_url}/qt.qt6.${qt_version_dotless}.${package}.${qt_package_arch_suffix}/${qt_package_version}${package}${qt_package_suffix}.7z" ${package}.7z ) endforeach() + # uic depends on libicu56.so if ("${{ runner.os }}" STREQUAL "Linux") downloadAndExtract( @@ -182,6 +220,32 @@ jobs: ) endif() + file(READ "qt6/${qt_dir_prefix}/mkspecs/qconfig.pri" qtconfig) + string(REPLACE "Enterprise" "OpenSource" qtconfig "${qtconfig}") + string(REPLACE "licheck.exe" "" qtconfig "${qtconfig}") + string(REPLACE "licheck64" "" qtconfig "${qtconfig}") + string(REPLACE "licheck_mac" "" qtconfig "${qtconfig}") + file(WRITE "qt6/${qt_dir_prefix}/mkspecs/qconfig.pri" "${qtconfig}") + + if ("${{ runner.os }}" STREQUAL "Windows") + # deploy "system" runtimes into Qt, so they get deployed as well + if ("x${{ matrix.config.environment_script }}" STREQUAL "x") + # deploy MinGW + foreach(file libwinpthread-1.dll libstdc++-6.dll libgcc_s_seh-1.dll) + file(INSTALL "$ENV{GITHUB_WORKSPACE}/${{ matrix.config.toolchain_path }}/${file}" + DESTINATION "qt6/${qt_dir_prefix}/bin" + USE_SOURCE_PERMISSIONS) + endforeach() + else() + # deploy MSVC + foreach(file vcruntime140.dll concrt140.dll msvcp140_1.dll msvcp140_2.dll + msvcp140_codecvt_ids.dll vcruntime140_1.dll msvcp140.dll) + file(INSTALL "C:/Windows/System32/${file}" + DESTINATION "qt6/${qt_dir_prefix}/bin") + endforeach() + endif() + endif() + - name: Download Qt Creator id: qt_creator shell: cmake -P {0}