From 26254b9a599fd1a0c025403b868bec1a8973e5ce Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Wed, 29 May 2024 10:35:33 +0200 Subject: [PATCH] [qtbase] Fix a few details (#38682) - Fix control of cups dependency - Fix binary and directory name collision in dynamic builds by not deploy plugins into tools/Qt6/bin (wasn't necessary in the first place due to qt.conf working as expected) (closes #28340) - (New) Fix deploy script on windows (closes #38936) - Fix dbus linkage as described here https://github.com/microsoft/vcpkg/pull/38682#issuecomment-2106308954 - Fix qtwebengine resource location to be in line what is stated in the generated `qt.conf`. There is probably a variable to control the installation location but moving was simpler then trying to find that variable. You will only notice it if you actually try to run a program using QtWebEngineProcess with the same `qt.conf` --- ports/qtbase/cmake/qt_install_submodule.cmake | 5 +---- ports/qtbase/fix_deploy_windows.patch | 21 +++++++++++++++++++ ports/qtbase/portfile.cmake | 21 ++++++++++++++----- ports/qtbase/vcpkg.json | 14 +++++++++++++ ports/qtdeclarative/portfile.cmake | 1 + ports/qtdeclarative/vcpkg.json | 4 +++- ports/qtwebengine/portfile.cmake | 2 ++ ports/qtwebengine/vcpkg.json | 2 +- versions/baseline.json | 6 +++--- versions/q-/qtbase.json | 5 +++++ versions/q-/qtdeclarative.json | 5 +++++ versions/q-/qtwebengine.json | 5 +++++ 12 files changed, 77 insertions(+), 14 deletions(-) create mode 100644 ports/qtbase/fix_deploy_windows.patch diff --git a/ports/qtbase/cmake/qt_install_submodule.cmake b/ports/qtbase/cmake/qt_install_submodule.cmake index 8537f48775..71c2de8190 100644 --- a/ports/qtbase/cmake/qt_install_submodule.cmake +++ b/ports/qtbase/cmake/qt_install_submodule.cmake @@ -150,7 +150,7 @@ function(qt_cmake_configure) ${disable_parallel} OPTIONS -DQT_NO_FORCE_SET_CMAKE_BUILD_TYPE:BOOL=ON - -DQT_USE_DEFAULT_CMAKE_OPTIMIZATION_FLAGS:BOOL=ON # We don't want Qt to screw with users toolchain settings. + -DQT_USE_DEFAULT_CMAKE_OPTIMIZATION_FLAGS:BOOL=ON # We don't want Qt to mess with users toolchain settings. -DCMAKE_FIND_PACKAGE_TARGETS_GLOBAL=ON # Because Qt doesn't correctly scope find_package calls. #-DQT_HOST_PATH= # For crosscompiling #-DQT_PLATFORM_DEFINITION_DIR=mkspecs/win32-msvc @@ -282,9 +282,6 @@ function(qt_fixup_and_cleanup) if(_qarg_TOOL_NAMES) set(tool_names ${_qarg_TOOL_NAMES}) vcpkg_copy_tools(TOOL_NAMES ${tool_names} SEARCH_DIR "${qt_searchdir}" DESTINATION "${qt_tooldest}" AUTO_CLEAN) - if(EXISTS "${CURRENT_PACKAGES_DIR}/${qt_plugindir}" AND NOT PORT STREQUAL "qtdeclarative") #qmllint conflict - file(COPY "${CURRENT_PACKAGES_DIR}/${qt_plugindir}/" DESTINATION "${qt_tooldest}") - endif() endif() if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") diff --git a/ports/qtbase/fix_deploy_windows.patch b/ports/qtbase/fix_deploy_windows.patch new file mode 100644 index 0000000000..66665f3dca --- /dev/null +++ b/ports/qtbase/fix_deploy_windows.patch @@ -0,0 +1,21 @@ +diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake +index 8a0d07feac..0e6a720c20 100644 +--- a/src/corelib/Qt6CoreMacros.cmake ++++ b/src/corelib/Qt6CoreMacros.cmake +@@ -2977,13 +2977,15 @@ function(_qt_internal_setup_deploy_support) + if(CMAKE_HOST_WIN32) + if(CMAKE_CROSSCOMPILING) + set(qt_paths_ext ".bat") ++ elseif(CMAKE_BUILD_TYPE STREQUAL "Debug") ++ set(qt_paths_ext ".debug.bat") + else() + set(qt_paths_ext ".exe") + endif() + else() + set(qt_paths_ext "") + endif() +- set(target_qtpaths_path "${QT6_INSTALL_PREFIX}/${QT6_INSTALL_BINS}/qtpaths${qt_paths_ext}") ++ set(target_qtpaths_path "${QT6_INSTALL_PREFIX}/tools/Qt6/bin/qtpaths${qt_paths_ext}") + + file(GENERATE OUTPUT "${QT_DEPLOY_SUPPORT}" CONTENT + "cmake_minimum_required(VERSION 3.16...3.21) diff --git a/ports/qtbase/portfile.cmake b/ports/qtbase/portfile.cmake index 9fee9d76ad..d23ed5fee6 100644 --- a/ports/qtbase/portfile.cmake +++ b/ports/qtbase/portfile.cmake @@ -20,6 +20,7 @@ set(${PORT}_PATCHES clang-cl_source_location.patch clang-cl_QGADGET_fix.diff fix-host-aliasing.patch + fix_deploy_windows.patch ) if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) @@ -94,6 +95,14 @@ INVERTED_FEATURES list(APPEND FEATURE_OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_Libudev:BOOL=ON) list(APPEND FEATURE_OPTIONS -DFEATURE_xml:BOOL=ON) +if("dbus" IN_LIST FEATURES AND VCPKG_TARGET_IS_LINUX) + list(APPEND FEATURE_OPTIONS -DINPUT_dbus=linked) +elseif("dbus" IN_LIST FEATURES) + list(APPEND FEATURE_OPTIONS -DINPUT_dbus=runtime) +else() + list(APPEND FEATURE_OPTIONS -DINPUT_dbus=no) +endif() + if(VCPKG_QT_NAMESPACE) list(APPEND FEATURE_OPTIONS "-DQT_NAMESPACE:STRING=${VCPKG_QT_NAMESPACE}") endif() @@ -121,8 +130,6 @@ list(APPEND FEATURE_CORE_OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_Libsystemd:BOOL=ON list(APPEND FEATURE_CORE_OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_WrapBacktrace:BOOL=ON) #list(APPEND FEATURE_CORE_OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_WrapAtomic:BOOL=ON) # Cannot be disabled on x64 platforms #list(APPEND FEATURE_CORE_OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_WrapRt:BOOL=ON) # Cannot be disabled on osx -list(APPEND FEATURE_CORE_OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_PPS:BOOL=ON) -list(APPEND FEATURE_CORE_OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_Slog2:BOOL=ON) # Network features: vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_NET_OPTIONS @@ -255,9 +262,13 @@ foreach(_db IN LISTS DB_LIST) endforeach() # printsupport features: -# vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_PRINTSUPPORT_OPTIONS - # ) -list(APPEND FEATURE_PRINTSUPPORT_OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_CUPS:BOOL=ON) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_PRINTSUPPORT_OPTIONS + FEATURES + "cups" FEATURE_cups + INVERTED_FEATURES + "cups" CMAKE_DISABLE_FIND_PACKAGE_Cups +) + vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_WIDGETS_OPTIONS FEATURES diff --git a/ports/qtbase/vcpkg.json b/ports/qtbase/vcpkg.json index b6fb831ff4..87020883b3 100644 --- a/ports/qtbase/vcpkg.json +++ b/ports/qtbase/vcpkg.json @@ -1,6 +1,7 @@ { "name": "qtbase", "version": "6.7.0", + "port-version": 1, "description": "Qt Base (Core, Gui, Widgets, Network, ...)", "homepage": "https://www.qt.io/", "license": null, @@ -52,6 +53,10 @@ "default-features": [ "brotli", "concurrent", + { + "name": "cups", + "platform": "osx" + }, "dbus", "default-features", "doubleconversion", @@ -112,9 +117,18 @@ } ] }, + "cups": { + "description": "Provides support for the Common Unix Printing System.", + "supports": "linux | osx" + }, "dbus": { "description": "Qt D-Bus", "dependencies": [ + { + "name": "dbus", + "default-features": false, + "platform": "linux" + }, { "name": "qtbase", "default-features": false, diff --git a/ports/qtdeclarative/portfile.cmake b/ports/qtdeclarative/portfile.cmake index 5d428ff647..5485220cd8 100644 --- a/ports/qtdeclarative/portfile.cmake +++ b/ports/qtdeclarative/portfile.cmake @@ -25,6 +25,7 @@ set(${PORT}_PATCHES qmltc qmlls qmljsrootgen + svgtoqml ) qt_install_submodule(PATCHES ${${PORT}_PATCHES} diff --git a/ports/qtdeclarative/vcpkg.json b/ports/qtdeclarative/vcpkg.json index 112fe50f99..c5a0d7f854 100644 --- a/ports/qtdeclarative/vcpkg.json +++ b/ports/qtdeclarative/vcpkg.json @@ -1,6 +1,7 @@ { "name": "qtdeclarative", "version": "6.7.0", + "port-version": 1, "description": "Qt Declarative (Quick 2)", "homepage": "https://www.qt.io/", "license": null, @@ -22,6 +23,7 @@ { "name": "qtshadertools", "default-features": false - } + }, + "qtsvg" ] } diff --git a/ports/qtwebengine/portfile.cmake b/ports/qtwebengine/portfile.cmake index 6d744d4883..1fe46fd5d0 100644 --- a/ports/qtwebengine/portfile.cmake +++ b/ports/qtwebengine/portfile.cmake @@ -122,6 +122,8 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_BUILD_TYPE) file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/QtWebEngineProcessd.pdb" "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/debug/QtWebEngineProcessd.pdb") endif() +file(RENAME "${CURRENT_PACKAGES_DIR}/resources" "${CURRENT_PACKAGES_DIR}/share/Qt6/resources") # qt.conf wants it there and otherwise the QtWebEngineProcess cannot start + qt_install_copyright("${SOURCE_PATH}") ##### qt_install_submodule diff --git a/ports/qtwebengine/vcpkg.json b/ports/qtwebengine/vcpkg.json index b57af8505f..87967f2298 100644 --- a/ports/qtwebengine/vcpkg.json +++ b/ports/qtwebengine/vcpkg.json @@ -2,7 +2,7 @@ "$comment": "x86-windows is not within the upstream support matrix of Qt6", "name": "qtwebengine", "version": "6.7.0", - "port-version": 1, + "port-version": 2, "description": "Qt WebEngine provides functionality for rendering regions of dynamic web content.", "homepage": "https://www.qt.io/", "license": null, diff --git a/versions/baseline.json b/versions/baseline.json index 6744ff95de..7d26c0cf9e 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7322,7 +7322,7 @@ }, "qtbase": { "baseline": "6.7.0", - "port-version": 0 + "port-version": 1 }, "qtcharts": { "baseline": "6.7.0", @@ -7342,7 +7342,7 @@ }, "qtdeclarative": { "baseline": "6.7.0", - "port-version": 0 + "port-version": 1 }, "qtdeviceutilities": { "baseline": "6.7.0", @@ -7486,7 +7486,7 @@ }, "qtwebengine": { "baseline": "6.7.0", - "port-version": 1 + "port-version": 2 }, "qtwebsockets": { "baseline": "6.7.0", diff --git a/versions/q-/qtbase.json b/versions/q-/qtbase.json index 407c0f3b3f..2c906f9b60 100644 --- a/versions/q-/qtbase.json +++ b/versions/q-/qtbase.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "ff2963c7602e8c8448e68a60739965a26cce7711", + "version": "6.7.0", + "port-version": 1 + }, { "git-tree": "2143fc719b61ad45e2f017348969a393b243e1d7", "version": "6.7.0", diff --git a/versions/q-/qtdeclarative.json b/versions/q-/qtdeclarative.json index 439e2f9d57..34144c5bad 100644 --- a/versions/q-/qtdeclarative.json +++ b/versions/q-/qtdeclarative.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8e424ab10dbe84d19523259d630a09d23ab0c623", + "version": "6.7.0", + "port-version": 1 + }, { "git-tree": "c7735c31022b2d41f5e0af9e727fc73cd4146a52", "version": "6.7.0", diff --git a/versions/q-/qtwebengine.json b/versions/q-/qtwebengine.json index 9af7764885..c33ef15fd6 100644 --- a/versions/q-/qtwebengine.json +++ b/versions/q-/qtwebengine.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "99bc7a32df1475460b84b8d04028c70c2a1b1d4d", + "version": "6.7.0", + "port-version": 2 + }, { "git-tree": "e12b173a87772bc006536e461d503caea8177b69", "version": "6.7.0",