mirror of
git://code.qt.io/qt/qt5.git
synced 2026-05-05 02:39:23 +08:00
Enable MySQL for Windows
Task-number: QTQAINFRA-4999
Change-Id: Id967473858673253f536cb91f9a95d9d6a3d7f27
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
(cherry picked from commit ec2dd3438c)
This commit is contained in:
@@ -94,7 +94,7 @@ Configurations:
|
|||||||
Features: ['Sccache', "DebugAndRelease", 'UseConfigure']
|
Features: ['Sccache', "DebugAndRelease", 'UseConfigure']
|
||||||
Configure arguments: '-debug-and-release -force-debug-info -headersclean -nomake examples -qt-zlib'
|
Configure arguments: '-debug-and-release -force-debug-info -headersclean -nomake examples -qt-zlib'
|
||||||
Environment variables: [
|
Environment variables: [
|
||||||
'CMAKE_ARGS=-DFEATURE_msvc_obj_debug_info=ON -DOPENSSL_ROOT_DIR={{.Env.OPENSSL_INCLUDE_x64}}\.. -DPostgreSQL_ROOT={{.Env.POSTGRESQL_LIB_x64}}\..',
|
'CMAKE_ARGS=-DFEATURE_msvc_obj_debug_info=ON -DOPENSSL_ROOT_DIR={{.Env.OPENSSL_INCLUDE_x64}}\.. -DPostgreSQL_ROOT={{.Env.POSTGRESQL_LIB_x64}}\.. -DMySQL_ROOT={{.Env.ENV_MySQL_ROOT}} -DMySQL_LIBRARY_DIR={{.Env.ENV_MySQL_LIBRARY_DIR}}',
|
||||||
'NON_QTBASE_CMAKE_ARGS=-DFFMPEG_DIR={{.Env.FFMPEG_DIR_MSVC}}',
|
'NON_QTBASE_CMAKE_ARGS=-DFFMPEG_DIR={{.Env.FFMPEG_DIR_MSVC}}',
|
||||||
'LLVM_INSTALL_DIR={{.Env.LLVM_INSTALL_DIR_msvc}}',
|
'LLVM_INSTALL_DIR={{.Env.LLVM_INSTALL_DIR_msvc}}',
|
||||||
'Protobuf_ROOT={{.Env.Protobuf_ROOT_msvc}}',
|
'Protobuf_ROOT={{.Env.Protobuf_ROOT_msvc}}',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#############################################################################
|
#############################################################################
|
||||||
##
|
##
|
||||||
## Copyright (C) 2019 The Qt Company Ltd.
|
## Copyright (C) 2023 The Qt Company Ltd.
|
||||||
## Contact: https://www.qt.io/licensing/
|
## Contact: https://www.qt.io/licensing/
|
||||||
##
|
##
|
||||||
## This file is part of the provisioning scripts of the Qt Toolkit.
|
## This file is part of the provisioning scripts of the Qt Toolkit.
|
||||||
@@ -42,48 +42,37 @@
|
|||||||
# This script installs MySQL $version.
|
# This script installs MySQL $version.
|
||||||
# Both x86 and x64 versions needed when x86 integrations are done on x64 machine
|
# Both x86 and x64 versions needed when x86 integrations are done on x64 machine
|
||||||
|
|
||||||
$version = "5.7.25"
|
$version = "6.1.11"
|
||||||
$baseNameX64 = "mysql-$version-winx64"
|
$installFolder = "C:\Utils"
|
||||||
$packagex64 = "C:\Windows\temp\$baseNameX64.zip"
|
$officialUrl = "https://downloads.mysql.com/archives/get/p/19/file/mysql-connector-c-${version}-winx64.zip"
|
||||||
$baseNameX86 = "mysql-$version-win32"
|
$officialUrlDebug = "https://downloads.mysql.com/archives/get/p/19/file/mysql-connector-${version}-winx64-debug.zip"
|
||||||
$packagex86 = "C:\Windows\temp\$baseNameX86.zip"
|
$cacheURl = "http://ci-files01-hki.ci.qt.io/input/windows/mysql-connector-c-${version}-winx64.zip"
|
||||||
$installFolder = "C:\Utils\my_sql"
|
$cacheURlDebug = "http://ci-files01-hki.ci.qt.io/input/windows/mysql-connector-c-${version}-winx64-debug.zip"
|
||||||
|
$sha = "93e22a1ba3944a6c8e01d3ea04c1bfb005b238f9"
|
||||||
|
$shaDebug = "d54088a9182e2f03b4d6f44c327e341eeab16367"
|
||||||
|
$zip = Get-DownloadLocation ("mysql-connector-c-" + $version + "-winx64.zip")
|
||||||
|
$zipDebug = Get-DownloadLocation ("mysql-connector-c-" + $version + "-winx64-debug.zip")
|
||||||
|
|
||||||
function DownloadAndInstall
|
function Install {
|
||||||
{
|
param(
|
||||||
Param (
|
[string]$officialUrl,
|
||||||
[string]$internalUrl,
|
[string]$cacheUrl,
|
||||||
[string]$package,
|
[string]$zip,
|
||||||
[string]$installPath
|
[string]$sha
|
||||||
)
|
)
|
||||||
|
|
||||||
Write-Host "Fetching from URL ..."
|
Download $officialUrl $cacheURl $zip
|
||||||
Copy-Item $internalUrl $package
|
Verify-Checksum $zip $sha
|
||||||
|
Extract-7Zip $zip $installFolder
|
||||||
$zipDir = [io.path]::GetFileNameWithoutExtension($package)
|
Remove $zip
|
||||||
Extract-7Zip $package $installPath "$zipDir\lib $zipDir\bin $zipDir\share $zipDir\include"
|
|
||||||
|
|
||||||
Remove "$package"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Is64BitWinHost) {
|
Install $officialUrl $cacheURl $zip $sha
|
||||||
# Install x64 bit version
|
Install $officialUrlDebug $cacheURlDebug $zipDebug $shaDebug
|
||||||
$architecture = "x64"
|
|
||||||
$internalUrl = "\\ci-files01-hki.intra.qt.io\provisioning\windows\mysql-$version-winx64.zip"
|
|
||||||
|
|
||||||
DownloadAndInstall $internalUrl $packagex64 $installFolder
|
# Can't set MySQL_ROOT & MySQL_LIBRARY_DIR variables. Those will enable mysql in every windows target.
|
||||||
|
# Let's use ENV_MySQL_* and use it in platform_configs
|
||||||
|
Set-EnvironmentVariable "ENV_MySQL_ROOT" "${installFolder}\mysql-connector-c-${version}-winx64"
|
||||||
|
Set-EnvironmentVariable "ENV_MySQL_LIBRARY_DIR" "${installFolder}\mysql-connector-c-${version}-winx64\lib\vs14"
|
||||||
|
|
||||||
Set-EnvironmentVariable "MYSQL_INCLUDE_x64" "$installFolder\$baseNameX64\include"
|
|
||||||
Set-EnvironmentVariable "MYSQL_LIB_x64" "$installFolder\$baseNameX64\lib"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Install x86 bit version
|
|
||||||
$architecture = "x86"
|
|
||||||
$internalUrl = "\\ci-files01-hki.intra.qt.io\provisioning\windows\mysql-$version-win32.zip"
|
|
||||||
DownloadAndInstall $internalUrl $packagex86 $installFolder
|
|
||||||
|
|
||||||
Set-EnvironmentVariable "MYSQL_INCLUDE_x86" "$installFolder\$baseNameX86\include"
|
|
||||||
Set-EnvironmentVariable "MYSQL_LIB_x86" "$installFolder\$baseNameX86\lib"
|
|
||||||
|
|
||||||
# Store version information to ~/versions.txt, which is used to print version information to provision log.
|
|
||||||
Write-Output "MySQL = $version" >> ~/versions.txt
|
Write-Output "MySQL = $version" >> ~/versions.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user