From c648581695ee7c2d60e095fc86dd369d650e90c5 Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Thu, 5 May 2022 20:00:03 +0200 Subject: [PATCH] [Qt6] Fix Qt6.3 windeployqt (#24445) * move windeploylogic to qtbase. fix qtpaths for debug. * fix missing stuff * version stuff * add supports !uwp since qt6 dropped uwp support * version stuff * add newline. Fix BAKCD * version stuff * use enabledelayedexpansion * version stuff * use cd /D * version stuff Co-authored-by: Alexander Neumann --- ports/qtbase/portfile.cmake | 31 +++++++++++++++++++++++------ ports/qtbase/qmake.debug.bat | 2 +- ports/qtbase/qtpaths.debug.bat | 2 ++ ports/qtbase/vcpkg.json | 2 ++ ports/qtbase/windeployqt.debug.bat | 10 ++++++++++ ports/qttools/portfile.cmake | 14 +++++++------ ports/qttools/vcpkg.json | 1 + ports/qttools/windeployqt.debug.bat | 10 +++++----- versions/baseline.json | 4 ++-- versions/q-/qtbase.json | 5 +++++ versions/q-/qttools.json | 5 +++++ 11 files changed, 66 insertions(+), 20 deletions(-) create mode 100644 ports/qtbase/qtpaths.debug.bat create mode 100644 ports/qtbase/windeployqt.debug.bat diff --git a/ports/qtbase/portfile.cmake b/ports/qtbase/portfile.cmake index b49552e24f..0656be7eea 100644 --- a/ports/qtbase/portfile.cmake +++ b/ports/qtbase/portfile.cmake @@ -404,16 +404,35 @@ if(VCPKG_TARGET_IS_WINDOWS) file(COPY ${DLLS_TO_COPY} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin") endif() -file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/qmake.debug.bat" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin") set(hostinfofile "${CURRENT_PACKAGES_DIR}/share/Qt6HostInfo/Qt6HostInfoConfig.cmake") file(READ "${hostinfofile}" _contents) string(REPLACE [[set(QT6_HOST_INFO_LIBEXECDIR "bin")]] [[set(QT6_HOST_INFO_LIBEXECDIR "tools/Qt6/bin")]] _contents "${_contents}") string(REPLACE [[set(QT6_HOST_INFO_BINDIR "bin")]] [[set(QT6_HOST_INFO_BINDIR "tools/Qt6/bin")]] _contents "${_contents}") file(WRITE "${hostinfofile}" "${_contents}") -set(coretools "${CURRENT_PACKAGES_DIR}/share/Qt6CoreTools/Qt6CoreTools.cmake") -if(EXISTS "${coretools}") - file(READ "${coretools}" _contents) - string(REPLACE [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/qmake.exe"]] [["${_IMPORT_PREFIX}/tools/Qt6/bin/qmake.debug.bat"]] _contents "${_contents}") - file(WRITE "${coretools}" "${_contents}") +if(QT_IS_LATEST) + set(configfile "${CURRENT_PACKAGES_DIR}/share/Qt6CoreTools/Qt6CoreToolsTargets-debug.cmake") + if(EXISTS "${configfile}") + file(READ "${configfile}" _contents) + if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/qmake.exe") + file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/qmake.debug.bat" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin") + string(REPLACE [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/qmake.exe"]] [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/qmake.debug.bat"]] _contents "${_contents}") + endif() + if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/qtpaths.exe") + file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/qtpaths.debug.bat" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin") + string(REPLACE [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/qtpaths.exe"]] [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/qtpaths.debug.bat"]] _contents "${_contents}") + endif() + if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/windeployqt.exe") + file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/windeployqt.debug.bat" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin") + string(REPLACE [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/windeployqt.exe"]] [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/windeployqt.debug.bat"]] _contents "${_contents}") + endif() + file(WRITE "${configfile}" "${_contents}") + endif() +else() + set(coretools "${CURRENT_PACKAGES_DIR}/share/Qt6CoreTools/Qt6CoreTools.cmake") + if(EXISTS "${coretools}") + file(READ "${coretools}" _contents) + string(REPLACE [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/qmake.exe"]] [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/qmake.debug.bat"]] _contents "${_contents}") + file(WRITE "${coretools}" "${_contents}") + endif() endif() diff --git a/ports/qtbase/qmake.debug.bat b/ports/qtbase/qmake.debug.bat index 1b7440b3e0..a7ed903a34 100644 --- a/ports/qtbase/qmake.debug.bat +++ b/ports/qtbase/qmake.debug.bat @@ -1,2 +1,2 @@ @echo off -"%0\..\qmake.exe" -qtconf "%0\..\qt.debug.conf" %* \ No newline at end of file +"%0\..\qmake.exe" -qtconf "%0\..\qt.debug.conf" %* diff --git a/ports/qtbase/qtpaths.debug.bat b/ports/qtbase/qtpaths.debug.bat new file mode 100644 index 0000000000..4fef8e754e --- /dev/null +++ b/ports/qtbase/qtpaths.debug.bat @@ -0,0 +1,2 @@ +@echo off +"%0\..\qtpaths.exe" --qtconf "%0\..\qt.debug.conf" %* diff --git a/ports/qtbase/vcpkg.json b/ports/qtbase/vcpkg.json index da1c8c1fc1..7de5865626 100644 --- a/ports/qtbase/vcpkg.json +++ b/ports/qtbase/vcpkg.json @@ -1,9 +1,11 @@ { "name": "qtbase", "version": "6.3.0", + "port-version": 1, "description": "Qt Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.", "homepage": "https://www.qt.io/", "license": null, + "supports": "!uwp", "dependencies": [ "freetype", { diff --git a/ports/qtbase/windeployqt.debug.bat b/ports/qtbase/windeployqt.debug.bat new file mode 100644 index 0000000000..99e5e79e72 --- /dev/null +++ b/ports/qtbase/windeployqt.debug.bat @@ -0,0 +1,10 @@ +@echo off +setlocal enabledelayedexpansion +set mypath=%~dp0 +set mypath=%mypath:~0,-1% +set BAKCD=!CD! +cd /D %mypath%\..\..\..\debug\bin +set PATH=!CD!;%PATH% +"%mypath%\windeployqt.exe" --qtpaths "%mypath%\qtpaths.debug.bat" %* +cd %BAKCD% +endlocal diff --git a/ports/qttools/portfile.cmake b/ports/qttools/portfile.cmake index d0bf4c9de8..bab69a67c2 100644 --- a/ports/qttools/portfile.cmake +++ b/ports/qttools/portfile.cmake @@ -134,12 +134,14 @@ if(VCPKG_TARGET_IS_OSX) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") endif() -set(configfile "${CURRENT_PACKAGES_DIR}/share/Qt6ToolsTools/Qt6ToolsToolsTargets-debug.cmake") -if(EXISTS "${configfile}" AND EXISTS "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/windeployqt.exe") - file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/windeployqt.debug.bat" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin") - file(READ "${configfile}" _contents) - string(REPLACE [[${_IMPORT_PREFIX}/tools/Qt6/bin/windeployqt.exe]] [[${_IMPORT_PREFIX}/tools/Qt6/bin/windeployqt.debug.bat]] _contents "${_contents}") - file(WRITE "${configfile}" "${_contents}") +if(NOT QT_IS_LATEST) + set(configfile "${CURRENT_PACKAGES_DIR}/share/Qt6CoreTools/Qt6CoreToolsTargets-debug.cmake") + if(EXISTS "${configfile}" AND EXISTS "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/windeployqt.exe") + file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/windeployqt.debug.bat" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin") + file(READ "${configfile}" _contents) + string(REPLACE [[${_IMPORT_PREFIX}/tools/Qt6/bin/windeployqt.exe]] [[${_IMPORT_PREFIX}/tools/Qt6/bin/windeployqt.debug.bat]] _contents "${_contents}") + file(WRITE "${configfile}" "${_contents}") + endif() endif() file(GLOB_RECURSE debug_dir "${CURRENT_PACKAGES_DIR}/debug/*") diff --git a/ports/qttools/vcpkg.json b/ports/qttools/vcpkg.json index e2177e6e67..cbbda35b61 100644 --- a/ports/qttools/vcpkg.json +++ b/ports/qttools/vcpkg.json @@ -1,6 +1,7 @@ { "name": "qttools", "version": "6.3.0", + "port-version": 1, "description": "Qt Tools", "homepage": "https://www.qt.io/", "license": null, diff --git a/ports/qttools/windeployqt.debug.bat b/ports/qttools/windeployqt.debug.bat index d004e23f10..c0c41e34d8 100644 --- a/ports/qttools/windeployqt.debug.bat +++ b/ports/qttools/windeployqt.debug.bat @@ -1,10 +1,10 @@ @echo off -setlocal +setlocal enabledelayedexpansion set mypath=%~dp0 set mypath=%mypath:~0,-1% -cd %mypath%\..\..\..\debug\bin -set BAKCD=%CD% -set PATH=%CD%;%PATH% +set BAKCD=!CD! +cd /D %mypath%\..\..\..\debug\bin +set PATH=!CD!;%PATH% "%mypath%\windeployqt.exe" --qmake "%mypath%\qmake.debug.bat" %* cd %BAKCD% -endlocal \ No newline at end of file +endlocal diff --git a/versions/baseline.json b/versions/baseline.json index 0aa965b6c7..5e62a2b29b 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5862,7 +5862,7 @@ }, "qtbase": { "baseline": "6.3.0", - "port-version": 0 + "port-version": 1 }, "qtcharts": { "baseline": "6.3.0", @@ -5978,7 +5978,7 @@ }, "qttools": { "baseline": "6.3.0", - "port-version": 0 + "port-version": 1 }, "qttranslations": { "baseline": "6.3.0", diff --git a/versions/q-/qtbase.json b/versions/q-/qtbase.json index 2b67b6aa13..da074daed1 100644 --- a/versions/q-/qtbase.json +++ b/versions/q-/qtbase.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "32ffa659c93542477ed0f0ee90f3a7f99c0035f0", + "version": "6.3.0", + "port-version": 1 + }, { "git-tree": "8a107123c1e35b7e5fc0df157026d7fde8a42632", "version": "6.3.0", diff --git a/versions/q-/qttools.json b/versions/q-/qttools.json index d8aa3c99f5..a04b333daf 100644 --- a/versions/q-/qttools.json +++ b/versions/q-/qttools.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "4bef4075be6e9e33ada53f0e2b3a37329187fa5a", + "version": "6.3.0", + "port-version": 1 + }, { "git-tree": "002b7b9432d4c1f49de7a486f70a673285cd98a8", "version": "6.3.0",