From 7def566e92283e896a9c266f0b9b9b0afabad75e Mon Sep 17 00:00:00 2001 From: doufu Date: Wed, 6 Sep 2023 11:22:27 +0800 Subject: Utilities/Release: Update to Qt 5.15.10 on windows-{x86_64,i386} builds Fixes: #25187 Co-authored-by: Brad King --- .gitlab/ci/download_qt.cmake | 8 +- .gitlab/ci/download_qt_hashes.cmake | 4 +- .../win/qt-5.12.1-win-x86-msvc-install.patch | 26 ----- Utilities/Release/win/qt-5.12.1-win-x86-msvc.ps1 | 118 -------------------- .../win/qt-5.15.10-win-x86-msvc-install.patch | 26 +++++ Utilities/Release/win/qt-5.15.10-win-x86-msvc.ps1 | 121 +++++++++++++++++++++ 6 files changed, 153 insertions(+), 150 deletions(-) delete mode 100644 Utilities/Release/win/qt-5.12.1-win-x86-msvc-install.patch delete mode 100755 Utilities/Release/win/qt-5.12.1-win-x86-msvc.ps1 create mode 100644 Utilities/Release/win/qt-5.15.10-win-x86-msvc-install.patch create mode 100755 Utilities/Release/win/qt-5.15.10-win-x86-msvc.ps1 diff --git a/.gitlab/ci/download_qt.cmake b/.gitlab/ci/download_qt.cmake index b02ceb0..28a3e27 100644 --- a/.gitlab/ci/download_qt.cmake +++ b/.gitlab/ci/download_qt.cmake @@ -15,11 +15,11 @@ if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows.*package") set(qt_url_root "https://cmake.org/files/dependencies") set(qt_url_path "") if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows_x86_64_package") - list(APPEND qt_files "qt-5.12.1-win-x86_64-msvc_v142-1.zip") - set(qt_subdir "qt-5.12.1-win-x86_64-msvc_v142-1") + list(APPEND qt_files "qt-5.15.10-win-x86_64-msvc_v142-1.zip") + set(qt_subdir "qt-5.15.10-win-x86_64-msvc_v142-1") elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows_i386_package") - list(APPEND qt_files "qt-5.12.1-win-i386-msvc_v142-1.zip") - set(qt_subdir "qt-5.12.1-win-i386-msvc_v142-1") + list(APPEND qt_files "qt-5.15.10-win-i386-msvc_v142-1.zip") + set(qt_subdir "qt-5.15.10-win-i386-msvc_v142-1") elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows_arm64_package") list(APPEND qt_files "qt-6.3.0-win-arm64-msvc_v143-1.zip") set(qt_subdir "qt-6.3.0-win-arm64-msvc_v143-1") diff --git a/.gitlab/ci/download_qt_hashes.cmake b/.gitlab/ci/download_qt_hashes.cmake index 4c48a47..1b9cf14 100644 --- a/.gitlab/ci/download_qt_hashes.cmake +++ b/.gitlab/ci/download_qt_hashes.cmake @@ -13,8 +13,8 @@ set("5.15.1-0-202009071110qtbase-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_6 set("qt-5.9.9-macosx10.10-x86_64-arm64.tar.xz_hash" d4449771afa0bc6a809c14f1e6d939e7732494cf059503ae451e2bfe8fc60cc1) set("qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz_hash" 7b9463a01c8beeee5bf8d01c70deff2d08561cd20aaf6f7a2f41cf8b68ce8a6b) -set("qt-5.12.1-win-i386-msvc_v142-1.zip_hash" aa78711fdaa5d9b146bf7ddcf15983f9fbb3f995462f2d043f8cca74b40ddd11) -set("qt-5.12.1-win-x86_64-msvc_v142-1.zip_hash" c2fc068b9dac40bb420e28e1ee15ce4f2ccfc866d767f3b99b6bb435b7c4f44b) +set("qt-5.15.10-win-i386-msvc_v142-1.zip_hash" c158cebc054d3f4f09733772a8a04789e2884912d45782e8c0c5e6a0b2773e92) +set("qt-5.15.10-win-x86_64-msvc_v142-1.zip_hash" d55c017aef359f6aa8c592b18ba13cc120c749417b55671548970690126cd139) set("qt-6.3.0-win-arm64-msvc_v143-1.zip_hash" f794c035fd4ff9f04468e1787a60d93d7496119c0060c3173a76d24a6b551b14) set("qt-6.3.0-win-i386-msvc_v143-1.zip_hash" 972bc707f78d11b44f360643ca4d0c898e761f7add43b96117d958c70d84a443) diff --git a/Utilities/Release/win/qt-5.12.1-win-x86-msvc-install.patch b/Utilities/Release/win/qt-5.12.1-win-x86-msvc-install.patch deleted file mode 100644 index 39a649e..0000000 --- a/Utilities/Release/win/qt-5.12.1-win-x86-msvc-install.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/lib/cmake/Qt5Core/Qt5CoreConfig.cmake b/lib/cmake/Qt5Core/Qt5CoreConfig.cmake -index 04ec302..75d5596 100644 ---- a/lib/cmake/Qt5Core/Qt5CoreConfig.cmake -+++ b/lib/cmake/Qt5Core/Qt5CoreConfig.cmake -@@ -118,7 +118,7 @@ if (NOT TARGET Qt5::Core) - list(REMOVE_DUPLICATES Qt5Core_COMPILE_DEFINITIONS) - list(REMOVE_DUPLICATES Qt5Core_EXECUTABLE_COMPILE_FLAGS) - -- set(_Qt5Core_LIB_DEPENDENCIES "") -+ set(_Qt5Core_LIB_DEPENDENCIES "${_qt5Core_install_prefix}/lib/qtpcre2.lib;netapi32.lib;version.lib") - - - add_library(Qt5::Core STATIC IMPORTED) -diff --git a/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake b/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake -index a07b953..2e07371 100644 ---- a/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake -+++ b/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake -@@ -118,7 +118,7 @@ if (NOT TARGET Qt5::Widgets) - list(REMOVE_DUPLICATES Qt5Widgets_COMPILE_DEFINITIONS) - list(REMOVE_DUPLICATES Qt5Widgets_EXECUTABLE_COMPILE_FLAGS) - -- set(_Qt5Widgets_LIB_DEPENDENCIES "Qt5::Gui;Qt5::Core") -+ set(_Qt5Widgets_LIB_DEPENDENCIES "Qt5::Gui;Qt5::Core;dwmapi.lib;uxtheme.lib") - - - add_library(Qt5::Widgets STATIC IMPORTED) diff --git a/Utilities/Release/win/qt-5.12.1-win-x86-msvc.ps1 b/Utilities/Release/win/qt-5.12.1-win-x86-msvc.ps1 deleted file mode 100755 index d9e9617..0000000 --- a/Utilities/Release/win/qt-5.12.1-win-x86-msvc.ps1 +++ /dev/null @@ -1,118 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - -# Run this script on a Windows host to generate Qt binaries. -# Set the PATH environment variable to contain the locations of cmake and git. - -param ( - [string]$cmake = 'cmake', - [string]$git = 'git', - [switch]$trace -) - -if ($trace -eq $true) { - Set-PSDebug -Trace 1 -} - -$ErrorActionPreference = 'Stop' -$ProgressPreference = 'SilentlyContinue' - -if ($env:VSCMD_ARG_TGT_ARCH -eq "x64") { - $arch = "x86_64"; -} elseif ($env:VSCMD_ARG_TGT_ARCH -eq "x86") { - $arch = "i386"; -} else { - Write-Host "VSCMD_ARG_TGT_ARCH env var not recognized. Run this from a Visual Studio Command Prompt." - exit 1 -} - -if ($env:VCToolsVersion -match '^(?[0-9][0-9]\.[0-9])') { - $toolset = "msvc_v" + $Matches.version -replace '\.', '' -} else { - Write-Host "VCToolsVersion env var not set. Run this from a Visual Studio Command Prompt." -} - -$srcname = "qt-everywhere-src-5.12.1" -$pkgname = "qt-5.12.1-win-$arch-$toolset-1" -$topdir = $pwd.Path -$srcdir = Join-Path $topdir $srcname -$blddir = Join-Path $topdir "$pkgname-build" -$prefix = Join-Path $topdir $pkgname - -# JOM -if ( -not (Test-Path -Path "jom")) { - Invoke-WebRequest -Uri "http://download.qt-project.org/official_releases/jom/unstable-jom.zip" -OutFile jom.zip - if ($(Get-FileHash "jom.zip").Hash -ne '128fdd846fe24f8594eed37d1d8929a0ea78df563537c0c1b1861a635013fff8') { - exit 1 - } - Expand-Archive -Path jom.zip -DestinationPath jom - Remove-Item jom.zip -} -$jom = "$topdir\jom\jom.exe" - -# Qt Source -if ( -not (Test-Path -Path $srcdir)) { - Invoke-WebRequest -Uri "https://download.qt.io/official_releases/qt/5.12/5.12.1/single/qt-everywhere-src-5.12.1.tar.xz" -OutFile qt.tar.xz - if ($(Get-FileHash "qt.tar.xz").Hash -ne 'caffbd625c7bc10ff8c5c7a27dbc7d84fa4de146975c0e1ffe904b514ccd6da4') { - exit 1 - } - & $cmake -E tar xvf qt.tar.xz - Remove-Item qt.tar.xz -} - -# Build Qt -if ( -not (Test-Path -Path $blddir)) { - New-Item -ItemType Directory -Path $blddir - Set-Location -Path "$blddir" - & ..\$srcname\configure.bat ` - -prefix $prefix ` - -static ` - -static-runtime ` - -release ` - -opensource -confirm-license ` - -platform win32-msvc ` - -mp ` - -gui ` - -widgets ` - -qt-pcre ` - -qt-zlib ` - -qt-libpng ` - -qt-libjpeg ` - -no-gif ` - -no-icu ` - -no-pch ` - -no-angle ` - -no-opengl ` - -no-dbus ` - -no-harfbuzz ` - -no-accessibility ` - -skip declarative ` - -skip multimedia ` - -skip qtcanvas3d ` - -skip qtconnectivity ` - -skip qtdeclarative ` - -skip qtlocation ` - -skip qtmultimedia ` - -skip qtsensors ` - -skip qtserialport ` - -skip qtsvg ` - -skip qtwayland ` - -skip qtwebchannel ` - -skip qtwebengine ` - -skip qtwebsockets ` - -skip qtxmlpatterns ` - -nomake examples -nomake tests - & $jom -J $env:NUMBER_OF_PROCESSORS -} - -# Install Qt -if ( -not (Test-Path -Path $prefix)) { - & $jom install - # Patch the installation. - Set-Location -Path $prefix - & $git apply -v (Join-Path $PSScriptRoot qt-5.12.1-win-x86-msvc-install.patch) -} - -# Package Qt -Set-Location -Path $topdir -& $cmake -E tar cf "$pkgname.zip" "--format=zip" "$pkgname" diff --git a/Utilities/Release/win/qt-5.15.10-win-x86-msvc-install.patch b/Utilities/Release/win/qt-5.15.10-win-x86-msvc-install.patch new file mode 100644 index 0000000..de31d52 --- /dev/null +++ b/Utilities/Release/win/qt-5.15.10-win-x86-msvc-install.patch @@ -0,0 +1,26 @@ +diff --git a/lib/cmake/Qt5Core/Qt5CoreConfig.cmake b/lib/cmake/Qt5Core/Qt5CoreConfig.cmake +index 5bad1af..25bf3e3 100644 +--- a/lib/cmake/Qt5Core/Qt5CoreConfig.cmake ++++ b/lib/cmake/Qt5Core/Qt5CoreConfig.cmake +@@ -264,7 +264,7 @@ if (NOT TARGET Qt5::Core) + return() + endif() + +- set(_Qt5Core_LIB_DEPENDENCIES "") ++ set(_Qt5Core_LIB_DEPENDENCIES "${_qt5Core_install_prefix}/lib/qtpcre2.lib;netapi32.lib;version.lib") + + + if(NOT Qt5_EXCLUDE_STATIC_DEPENDENCIES) +diff --git a/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake b/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake +index d9966ad..308e4cb 100644 +--- a/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake ++++ b/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake +@@ -264,7 +264,7 @@ if (NOT TARGET Qt5::Widgets) + return() + endif() + +- set(_Qt5Widgets_LIB_DEPENDENCIES "Qt5::Gui;Qt5::Core") ++ set(_Qt5Widgets_LIB_DEPENDENCIES "Qt5::Gui;Qt5::Core;dwmapi.lib;uxtheme.lib") + + + if(NOT Qt5_EXCLUDE_STATIC_DEPENDENCIES) diff --git a/Utilities/Release/win/qt-5.15.10-win-x86-msvc.ps1 b/Utilities/Release/win/qt-5.15.10-win-x86-msvc.ps1 new file mode 100755 index 0000000..e1d9ad1 --- /dev/null +++ b/Utilities/Release/win/qt-5.15.10-win-x86-msvc.ps1 @@ -0,0 +1,121 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# Run this script on a Windows host to generate Qt binaries. +# Set the PATH environment variable to contain the locations of cmake and git. + +param ( + [string]$cmake = 'cmake', + [string]$git = 'git', + [switch]$trace +) + +if ($trace -eq $true) { + Set-PSDebug -Trace 1 +} + +$ErrorActionPreference = 'Stop' +$ProgressPreference = 'SilentlyContinue' + +if ($env:VSCMD_ARG_TGT_ARCH -eq "x64") { + $arch = "x86_64"; +} elseif ($env:VSCMD_ARG_TGT_ARCH -eq "x86") { + $arch = "i386"; +} else { + Write-Host "VSCMD_ARG_TGT_ARCH env var not recognized. Run this from a Visual Studio Command Prompt." + exit 1 +} + +if ($env:VCToolsVersion -match '^(?[0-9][0-9]\.[0-9])') { + $toolset = "msvc_v" + $Matches.version -replace '\.', '' +} else { + Write-Host "VCToolsVersion env var not set. Run this from a Visual Studio Command Prompt." +} + +$srcname = "qt-everywhere-src-5.15.10" +$pkgname = "qt-5.15.10-win-$arch-$toolset-1" +$topdir = $pwd.Path +$srcdir = Join-Path $topdir $srcname +$blddir = Join-Path $topdir "$pkgname-build" +$prefix = Join-Path $topdir $pkgname + +# JOM +if ( -not (Test-Path -Path "jom")) { + Invoke-WebRequest -Uri "http://download.qt-project.org/official_releases/jom/jom_1_1_4.zip" -OutFile jom.zip + if ($(Get-FileHash "jom.zip").Hash -ne 'd533c1ef49214229681e90196ed2094691e8c4a0a0bef0b2c901debcb562682b') { + Write-Host "jom hash does not match" + exit 1 + } + Expand-Archive -Path jom.zip -DestinationPath jom + Remove-Item jom.zip +} +$jom = "$topdir\jom\jom.exe" + +# Qt Source +if ( -not (Test-Path -Path $srcdir)) { + Invoke-WebRequest -Uri "https://download.qt.io/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" -OutFile qt.tar.xz + if ($(Get-FileHash "qt.tar.xz").Hash -ne 'b545cb83c60934adc9a6bbd27e2af79e5013de77d46f5b9f5bb2a3c762bf55ca') { + Write-Host "qt hash does not match" + exit 1 + } + & $cmake -E tar xvf qt.tar.xz + Remove-Item qt.tar.xz +} + +# Build Qt +if ( -not (Test-Path -Path $blddir)) { + New-Item -ItemType Directory -Path $blddir + Set-Location -Path "$blddir" + & ..\$srcname\configure.bat ` + -prefix $prefix ` + -static ` + -static-runtime ` + -release ` + -opensource -confirm-license ` + -platform win32-msvc ` + -mp ` + -gui ` + -widgets ` + -qt-pcre ` + -qt-zlib ` + -qt-libpng ` + -qt-libjpeg ` + -no-gif ` + -no-icu ` + -no-pch ` + -no-angle ` + -no-opengl ` + -no-dbus ` + -no-harfbuzz ` + -no-accessibility ` + -skip declarative ` + -skip multimedia ` + -skip qtcanvas3d ` + -skip qtconnectivity ` + -skip qtdeclarative ` + -skip qtlocation ` + -skip qtmultimedia ` + -skip qtsensors ` + -skip qtserialbus ` + -skip qtserialport ` + -skip qtsvg ` + -skip qtwayland ` + -skip qtwebchannel ` + -skip qtwebengine ` + -skip qtwebsockets ` + -skip qtxmlpatterns ` + -nomake examples -nomake tests + & $jom -J $env:NUMBER_OF_PROCESSORS +} + +# Install Qt +if ( -not (Test-Path -Path $prefix)) { + & $jom install + # Patch the installation. + Set-Location -Path $prefix + & $git apply -v (Join-Path $PSScriptRoot qt-5.15.10-win-x86-msvc-install.patch) +} + +# Package Qt +Set-Location -Path $topdir +& $cmake -E tar cf "$pkgname.zip" "--format=zip" "$pkgname" -- cgit v0.12