From 6df09997d4d0b92d15b111c105b7b13680cee636 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 20 Mar 2022 13:47:05 +0100 Subject: [PATCH 1/8] Move gui out of qt5-base[core] --- ports/qt5-base/portfile.cmake | 101 +++++++++++++++++++++++----------- ports/qt5-base/vcpkg.json | 43 ++++++++++----- 2 files changed, 98 insertions(+), 46 deletions(-) diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index 4ce58f4e764008..83953389e64f4a 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -98,13 +98,9 @@ set(CORE_OPTIONS ## 3rd Party Libs list(APPEND CORE_OPTIONS -system-zlib - -system-libjpeg - -system-libpng - -system-freetype -system-pcre -system-doubleconversion -system-sqlite - -system-harfbuzz -icu -no-angle # Qt does not need to build angle. VCPKG will build angle! -no-glib @@ -206,48 +202,77 @@ set(FREETYPE_DEBUG_ALL "${FREETYPE_DEBUG} ${BZ2_DEBUG} ${LIBPNG_DEBUG} ${ZLIB_DE x_vcpkg_pkgconfig_get_modules(PREFIX harfbuzz MODULES harfbuzz LIBRARIES) set(RELEASE_OPTIONS - "LIBJPEG_LIBS=${JPEG_RELEASE}" "ZLIB_LIBS=${ZLIB_RELEASE}" - "LIBPNG_LIBS=${LIBPNG_RELEASE} ${ZLIB_RELEASE}" "PCRE2_LIBS=${PCRE2_RELEASE}" - "FREETYPE_LIBS=${FREETYPE_RELEASE_ALL}" "ICU_LIBS=${ICU_RELEASE}" "QMAKE_LIBS_PRIVATE+=${BZ2_RELEASE}" - "QMAKE_LIBS_PRIVATE+=${LIBPNG_RELEASE}" "QMAKE_LIBS_PRIVATE+=${ICU_RELEASE}" "QMAKE_LIBS_PRIVATE+=${ZSTD_RELEASE}" ) set(DEBUG_OPTIONS - "LIBJPEG_LIBS=${JPEG_DEBUG}" "ZLIB_LIBS=${ZLIB_DEBUG}" - "LIBPNG_LIBS=${LIBPNG_DEBUG} ${ZLIB_DEBUG}" "PCRE2_LIBS=${PCRE2_DEBUG}" - "FREETYPE_LIBS=${FREETYPE_DEBUG_ALL}" "ICU_LIBS=${ICU_DEBUG}" "QMAKE_LIBS_PRIVATE+=${BZ2_DEBUG}" - "QMAKE_LIBS_PRIVATE+=${LIBPNG_DEBUG}" "QMAKE_LIBS_PRIVATE+=${ICU_DEBUG}" "QMAKE_LIBS_PRIVATE+=${ZSTD_DEBUG}" ) +if("gui" IN_LIST FEATURES) + list(APPEND CORE_OPTIONS + -gui + -widgets + -system-freetype + -system-harfbuzz + -system-libjpeg + -system-libpng + ) + list(APPEND RELEASE_OPTIONS + "LIBJPEG_LIBS=${JPEG_RELEASE}" + "LIBPNG_LIBS=${LIBPNG_RELEASE} ${ZLIB_RELEASE}" + "FREETYPE_LIBS=${FREETYPE_RELEASE_ALL}" + "QMAKE_LIBS_PRIVATE+=${LIBPNG_RELEASE}" + ) + list(APPEND DEBUG_OPTIONS + "LIBJPEG_LIBS=${JPEG_DEBUG}" + "LIBPNG_LIBS=${LIBPNG_DEBUG} ${ZLIB_DEBUG}" + "FREETYPE_LIBS=${FREETYPE_DEBUG_ALL}" + "QMAKE_LIBS_PRIVATE+=${LIBPNG_DEBUG}" + ) +else() + list(APPEND CORE_OPTIONS + -no-gui + -no-widgets + -no-freetype + -no-harfbuzz + -no-libjpeg + -no-libpng + ) +endif() + if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_TARGET_IS_UWP) list(APPEND CORE_OPTIONS -appstore-compliant) endif() - if(NOT ${VCPKG_LIBRARY_LINKAGE} STREQUAL "static") - list(APPEND CORE_OPTIONS -opengl dynamic) # other options are "-no-opengl", "-opengl angle", and "-opengl desktop" and "-opengel es2" - else() - list(APPEND CORE_OPTIONS -opengl dynamic) # other possible option without moving angle dlls: "-opengl desktop". "-opengel es2" only works with commented patch + if("gui" IN_LIST FEATURES) + if(NOT ${VCPKG_LIBRARY_LINKAGE} STREQUAL "static") + list(APPEND CORE_OPTIONS -opengl dynamic) # other options are "-no-opengl", "-opengl angle", and "-opengl desktop" and "-opengel es2" + else() + list(APPEND CORE_OPTIONS -opengl dynamic) # other possible option without moving angle dlls: "-opengl desktop". "-opengel es2" only works with commented patch + endif() + list(APPEND RELEASE_OPTIONS + "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_RELEASE}" + ) + list(APPEND DEBUG_OPTIONS + "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_DEBUG}" + ) endif() list(APPEND RELEASE_OPTIONS "SQLITE_LIBS=${SQLITE_RELEASE}" - "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_RELEASE}" "OPENSSL_LIBS=${SSL_RELEASE} ${EAY_RELEASE} ws2_32.lib secur32.lib advapi32.lib shell32.lib crypt32.lib user32.lib gdi32.lib" ) - list(APPEND DEBUG_OPTIONS "SQLITE_LIBS=${SQLITE_DEBUG}" - "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_DEBUG}" "OPENSSL_LIBS=${SSL_DEBUG} ${EAY_DEBUG} ws2_32.lib secur32.lib advapi32.lib shell32.lib crypt32.lib user32.lib gdi32.lib" ) if(WITH_PGSQL_PLUGIN) @@ -260,28 +285,33 @@ if(VCPKG_TARGET_IS_WINDOWS) endif(WITH_MYSQL_PLUGIN) elseif(VCPKG_TARGET_IS_LINUX) - list(APPEND CORE_OPTIONS -fontconfig -xcb-xlib -xcb -linuxfb) - if (NOT EXISTS "/usr/include/GL/glu.h") - message(FATAL_ERROR "qt5 requires libgl1-mesa-dev and libglu1-mesa-dev, please use your distribution's package manager to install them.\nExample: \"apt-get install libgl1-mesa-dev libglu1-mesa-dev\"") + if("gui" IN_LIST FEATURES) + if (NOT EXISTS "/usr/include/GL/glu.h") + message(FATAL_ERROR "qt5 requires libgl1-mesa-dev and libglu1-mesa-dev, please use your distribution's package manager to install them.\nExample: \"apt-get install libgl1-mesa-dev libglu1-mesa-dev\"") + endif() + list(APPEND CORE_OPTIONS -fontconfig -xcb-xlib -xcb -linuxfb) + list(APPEND RELEASE_OPTIONS + "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_RELEASE}" + "FONTCONFIG_LIBS=${FONTCONFIG_RELEASE} ${FREETYPE_RELEASE} ${EXPAT_RELEASE} -luuid" + ) + list(APPEND DEBUG_OPTIONS + "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_DEBUG}" + "FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG} -luuid" + ) endif() list(APPEND RELEASE_OPTIONS "SQLITE_LIBS=${SQLITE_RELEASE} -ldl -lpthread" - "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_RELEASE}" "OPENSSL_LIBS=${SSL_RELEASE} ${EAY_RELEASE} -ldl -lpthread" - "FONTCONFIG_LIBS=${FONTCONFIG_RELEASE} ${FREETYPE_RELEASE} ${EXPAT_RELEASE} -luuid" ) list(APPEND DEBUG_OPTIONS "SQLITE_LIBS=${SQLITE_DEBUG} -ldl -lpthread" - "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_DEBUG}" "OPENSSL_LIBS=${SSL_DEBUG} ${EAY_DEBUG} -ldl -lpthread" - "FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG} -luuid" ) if(WITH_PGSQL_PLUGIN) list(APPEND RELEASE_OPTIONS "PSQL_LIBS=${PSQL_RELEASE} ${PSQL_PORT_RELEASE} ${PSQL_TYPES_RELEASE} ${PSQL_COMMON_RELEASE} ${SSL_RELEASE} ${EAY_RELEASE} -ldl -lpthread") list(APPEND DEBUG_OPTIONS "PSQL_LIBS=${PSQL_DEBUG} ${PSQL_PORT_DEBUG} ${PSQL_TYPES_DEBUG} ${PSQL_COMMON_DEBUG} ${SSL_DEBUG} ${EAY_DEBUG} -ldl -lpthread") endif() elseif(VCPKG_TARGET_IS_OSX) - list(APPEND CORE_OPTIONS -fontconfig) if("${VCPKG_TARGET_ARCHITECTURE}" MATCHES "arm64") FILE(READ "${SOURCE_PATH}/mkspecs/common/macx.conf" _tmp_contents) string(REPLACE "QMAKE_APPLE_DEVICE_ARCHS = x86_64" "QMAKE_APPLE_DEVICE_ARCHS = arm64" _tmp_contents ${_tmp_contents}) @@ -318,17 +348,24 @@ elseif(VCPKG_TARGET_IS_OSX) FILE(WRITE "${SOURCE_PATH}/mkspecs/common/macx.conf" ${_tmp_contents}) endif() #list(APPEND QT_PLATFORM_CONFIGURE_OPTIONS HOST_PLATFORM ${TARGET_MKSPEC}) + if("gui" IN_LIST FEATURES) + list(APPEND CORE_OPTIONS -fontconfig) + list(APPEND RELEASE_OPTIONS + "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_RELEASE} -framework ApplicationServices" + "FONTCONFIG_LIBS=${FONTCONFIG_RELEASE} ${FREETYPE_RELEASE} ${EXPAT_RELEASE} -liconv" + ) + list(APPEND DEBUG_OPTIONS + "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_DEBUG} -framework ApplicationServices" + "FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG} -liconv" + ) + endif() list(APPEND RELEASE_OPTIONS "SQLITE_LIBS=${SQLITE_RELEASE} -ldl -lpthread" - "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_RELEASE} -framework ApplicationServices" "OPENSSL_LIBS=${SSL_RELEASE} ${EAY_RELEASE} -ldl -lpthread" - "FONTCONFIG_LIBS=${FONTCONFIG_RELEASE} ${FREETYPE_RELEASE} ${EXPAT_RELEASE} -liconv" ) list(APPEND DEBUG_OPTIONS "SQLITE_LIBS=${SQLITE_DEBUG} -ldl -lpthread" - "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_DEBUG} -framework ApplicationServices" "OPENSSL_LIBS=${SSL_DEBUG} ${EAY_DEBUG} -ldl -lpthread" - "FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG} -liconv" ) if(WITH_PGSQL_PLUGIN) @@ -463,7 +500,7 @@ file(COPY ) # Fix Qt5GuiConfigExtras EGL path -if(VCPKG_TARGET_IS_LINUX) +if(VCPKG_TARGET_IS_LINUX AND "gui" IN_LIST FEATURES) set(_file "${CURRENT_PACKAGES_DIR}/share/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake") file(READ "${_file}" _contents) string(REGEX REPLACE "_qt5gui_find_extra_libs\\\(EGL[^\\\n]+" "_qt5gui_find_extra_libs(EGL \"EGL\" \"\" \"\${_qt5Gui_install_prefix}/include\")\n" _contents "${_contents}") diff --git a/ports/qt5-base/vcpkg.json b/ports/qt5-base/vcpkg.json index f0fe96392292d6..0c3d7f671ee14b 100644 --- a/ports/qt5-base/vcpkg.json +++ b/ports/qt5-base/vcpkg.json @@ -1,29 +1,16 @@ { "name": "qt5-base", "version": "5.15.5", - "port-version": 1, + "port-version": 2, "description": "Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.", "homepage": "https://www.qt.io/", "license": null, "dependencies": [ - { - "name": "angle", - "platform": "!windows" - }, "double-conversion", - "egl-registry", - { - "name": "fontconfig", - "platform": "!windows" - }, - "freetype", - "harfbuzz", { "name": "icu", "platform": "!uwp" }, - "libjpeg-turbo", - "libpng", "openssl", "pcre2", { @@ -39,7 +26,28 @@ "zlib", "zstd" ], + "default-features": [ + "gui" + ], "features": { + "gui": { + "description": "Build GUI features, including QWidgets", + "dependencies": [ + { + "name": "angle", + "platform": "!windows" + }, + "egl-registry", + { + "name": "fontconfig", + "platform": "!windows" + }, + "freetype", + "harfbuzz", + "libjpeg-turbo", + "libpng" + ] + }, "latest": { "description": "(deprecated)" }, @@ -58,6 +66,13 @@ "vulkan": { "description": "Enable Vulkan support in QtGui", "dependencies": [ + { + "name": "qt5-base", + "default-features": false, + "features": [ + "gui" + ] + }, "vulkan" ] } From 2a9de1bd7fd9f5116d10d5f6297954466db306a6 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Fri, 15 Apr 2022 08:43:16 +0200 Subject: [PATCH 2/8] Move icu out of qt5-base[core] --- ports/qt5-base/portfile.cmake | 19 ++++++++++++++----- ports/qt5-base/vcpkg.json | 13 +++++++++---- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index 83953389e64f4a..99e59829d51b49 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -101,7 +101,6 @@ list(APPEND CORE_OPTIONS -system-pcre -system-doubleconversion -system-sqlite - -icu -no-angle # Qt does not need to build angle. VCPKG will build angle! -no-glib -openssl-linked @@ -204,20 +203,30 @@ x_vcpkg_pkgconfig_get_modules(PREFIX harfbuzz MODULES harfbuzz LIBRARIES) set(RELEASE_OPTIONS "ZLIB_LIBS=${ZLIB_RELEASE}" "PCRE2_LIBS=${PCRE2_RELEASE}" - "ICU_LIBS=${ICU_RELEASE}" "QMAKE_LIBS_PRIVATE+=${BZ2_RELEASE}" - "QMAKE_LIBS_PRIVATE+=${ICU_RELEASE}" "QMAKE_LIBS_PRIVATE+=${ZSTD_RELEASE}" ) set(DEBUG_OPTIONS "ZLIB_LIBS=${ZLIB_DEBUG}" "PCRE2_LIBS=${PCRE2_DEBUG}" - "ICU_LIBS=${ICU_DEBUG}" "QMAKE_LIBS_PRIVATE+=${BZ2_DEBUG}" - "QMAKE_LIBS_PRIVATE+=${ICU_DEBUG}" "QMAKE_LIBS_PRIVATE+=${ZSTD_DEBUG}" ) +if("icu" IN_LIST FEATURES) + list(APPEND CORE_OPTIONS -icu) + list(APPEND RELEASE_OPTIONS + "ICU_LIBS=${ICU_RELEASE}" + "QMAKE_LIBS_PRIVATE+=${ICU_RELEASE}" + ) + list(APPEND DEBUG_OPTIONS + "ICU_LIBS=${ICU_DEBUG}" + "QMAKE_LIBS_PRIVATE+=${ICU_DEBUG}" + ) +else() + list(APPEND CORE_OPTIONS -no-icu) +endif() + if("gui" IN_LIST FEATURES) list(APPEND CORE_OPTIONS -gui diff --git a/ports/qt5-base/vcpkg.json b/ports/qt5-base/vcpkg.json index 0c3d7f671ee14b..320b0f37ec1200 100644 --- a/ports/qt5-base/vcpkg.json +++ b/ports/qt5-base/vcpkg.json @@ -7,10 +7,6 @@ "license": null, "dependencies": [ "double-conversion", - { - "name": "icu", - "platform": "!uwp" - }, "openssl", "pcre2", { @@ -48,6 +44,15 @@ "libpng" ] }, + "icu": { + "description": "Enable ICU support", + "dependencies": [ + { + "name": "icu", + "platform": "!uwp" + } + ] + }, "latest": { "description": "(deprecated)" }, From b6db5972fb0c49100b24623a825a22326f1cc41d Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Fri, 15 Apr 2022 09:21:24 +0200 Subject: [PATCH 3/8] Parse keywords in qt_submodule_installation The unparsed arguments must not be blindly passed to qt_download_submodule and qt_build_submodule. --- .../cmake/qt_submodule_installation.cmake | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/ports/qt5-base/cmake/qt_submodule_installation.cmake b/ports/qt5-base/cmake/qt_submodule_installation.cmake index 19c0b4ef428e22..8b592c0dc0d001 100644 --- a/ports/qt5-base/cmake/qt_submodule_installation.cmake +++ b/ports/qt5-base/cmake/qt_submodule_installation.cmake @@ -1,12 +1,24 @@ function(qt_submodule_installation) - cmake_parse_arguments(_csc "" "OUT_SOURCE_PATH" "" ${ARGN}) - qt_download_submodule(OUT_SOURCE_PATH TARGET_SOURCE_PATH ${_csc_UNPARSED_ARGUMENTS}) + cmake_parse_arguments(_csc + "" + "OUT_SOURCE_PATH" + "PATCHES;OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG;BUILD_OPTIONS;BUILD_OPTIONS_RELEASE;BUILD_OPTIONS_DEBUG" + ${ARGN} + ) + qt_download_submodule(OUT_SOURCE_PATH TARGET_SOURCE_PATH PATCHES ${_csc_PATCHES}) if(QT_UPDATE_VERSION) SET(VCPKG_POLICY_EMPTY_PACKAGE enabled PARENT_SCOPE) else() - qt_build_submodule(${TARGET_SOURCE_PATH} ${_csc_UNPARSED_ARGUMENTS}) + qt_build_submodule(${TARGET_SOURCE_PATH} + OPTIONS ${_csc_OPTIONS} + OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE} + OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG} + BUILD_OPTIONS ${_csc_BUILD_OPTIONS} + BUILD_OPTIONS_RELEASE ${_csc_BUILD_OPTIONS_RELEASE} + BUILD_OPTIONS_DEBUG ${_csc_BUILD_OPTIONS_DEBUG} + ) qt_install_copyright(${TARGET_SOURCE_PATH}) endif() if(DEFINED _csc_OUT_SOURCE_PATH) From 3268bea6652812dcf77dbd378f3a63b17e83d829 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Fri, 15 Apr 2022 12:24:37 +0200 Subject: [PATCH 4/8] qt5-doc doesn't install anything --- ports/qt5-doc/portfile.cmake | 9 ++------- ports/qt5-doc/vcpkg.json | 15 +++------------ 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/ports/qt5-doc/portfile.cmake b/ports/qt5-doc/portfile.cmake index 4f6e6848e01854..914fecf10a7825 100644 --- a/ports/qt5-doc/portfile.cmake +++ b/ports/qt5-doc/portfile.cmake @@ -1,7 +1,2 @@ -set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) -if(VCPKG_TARGET_IS_WINDOWS) - set(VCPKG_POLICY_EMPTY_PACKAGE enabled) - message(STATUS "${PORT} will not build any artifacts on Windows!") -endif() -include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) -qt_submodule_installation() \ No newline at end of file +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) +message(STATUS "${PORT} will not build any artifacts") diff --git a/ports/qt5-doc/vcpkg.json b/ports/qt5-doc/vcpkg.json index 5dac8e6f3b6843..c987db9ab72b8b 100644 --- a/ports/qt5-doc/vcpkg.json +++ b/ports/qt5-doc/vcpkg.json @@ -1,16 +1,7 @@ { "name": "qt5-doc", "version": "5.15.5", - "description": "Qt5 doc Module;", - "license": null, - "supports": "linux", - "dependencies": [ - { - "name": "qt5-base", - "default-features": false - }, - "qt5-declarative", - "qt5-quickcontrols2", - "qt5-tools" - ] + "port-version": 1, + "description": "This port doesn't create any artifacts", + "license": null } From 1202dde775377e22e304fcf2bc48ff0848ad4b66 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Fri, 15 Apr 2022 12:28:10 +0200 Subject: [PATCH 5/8] Reduce dependencies on qt5-base[gui] --- ports/qt5-activeqt/vcpkg.json | 4 ++-- ports/qt5-declarative/portfile.cmake | 11 ++++++++- ports/qt5-declarative/vcpkg.json | 26 +++++++++++++++++---- ports/qt5-imageformats/vcpkg.json | 7 ++++-- ports/qt5-script/portfile.cmake | 10 +++++++- ports/qt5-script/vcpkg.json | 35 ++++++++++++++++++++++++++-- ports/qt5-svg/vcpkg.json | 6 ++++- ports/qt5-tools/portfile.cmake | 24 +++++++++++++++++-- ports/qt5-tools/vcpkg.json | 27 ++++++++++++++++++--- ports/qt5-translations/vcpkg.json | 7 +++++- 10 files changed, 138 insertions(+), 19 deletions(-) diff --git a/ports/qt5-activeqt/vcpkg.json b/ports/qt5-activeqt/vcpkg.json index 57bcdc899a9944..6cb9beb975d7ef 100644 --- a/ports/qt5-activeqt/vcpkg.json +++ b/ports/qt5-activeqt/vcpkg.json @@ -1,6 +1,7 @@ { "name": "qt5-activeqt", "version": "5.15.5", + "port-version": 1, "description": "Qt5 ActiveQt Module - ActiveX components", "license": null, "supports": "windows", @@ -8,7 +9,6 @@ { "name": "qt5-base", "default-features": false - }, - "qt5-declarative" + } ] } diff --git a/ports/qt5-declarative/portfile.cmake b/ports/qt5-declarative/portfile.cmake index b813567f98ec1b..fe2cc740852fbb 100644 --- a/ports/qt5-declarative/portfile.cmake +++ b/ports/qt5-declarative/portfile.cmake @@ -1,5 +1,14 @@ +vcpkg_list(SET OPTIONS) +if(NOT "quick" IN_LIST FEATURES) + vcpkg_list(APPEND OPTIONS "QT.gui.name=" "QT.widgets.name=") +endif() + include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) -qt_submodule_installation(OUT_SOURCE_PATH SOURCE_PATH) +qt_submodule_installation( + OUT_SOURCE_PATH SOURCE_PATH + OPTIONS + ${OPTIONS} +) if(NOT QT_UPDATE_VERSION) vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/qt5/QtQml/${QT_MAJOR_MINOR_VER}.${QT_PATCH_VER}/QtQml/private/qqmljsparser_p.h" "${SOURCE_PATH}" "") diff --git a/ports/qt5-declarative/vcpkg.json b/ports/qt5-declarative/vcpkg.json index 2002251b2f4edd..5e3907fbb04c9e 100644 --- a/ports/qt5-declarative/vcpkg.json +++ b/ports/qt5-declarative/vcpkg.json @@ -1,14 +1,32 @@ { "name": "qt5-declarative", "version": "5.15.5", + "port-version": 1, "description": "Qt5 Declarative (Quick 2) Module. Includes QtQuick, QtQuickParticles, QtQuickWidgets, QtQml, and QtPacketProtocol.", "license": null, "dependencies": [ { "name": "qt5-base", "default-features": false - }, - "qt5-imageformats", - "qt5-svg" - ] + } + ], + "default-features": [ + "quick" + ], + "features": { + "quick": { + "description": "QtQuick declarative GUI language and runtime", + "dependencies": [ + { + "name": "qt5-base", + "default-features": false, + "features": [ + "gui" + ] + }, + "qt5-imageformats", + "qt5-svg" + ] + } + } } diff --git a/ports/qt5-imageformats/vcpkg.json b/ports/qt5-imageformats/vcpkg.json index fe6f4b63da9940..a17aa5da757f82 100644 --- a/ports/qt5-imageformats/vcpkg.json +++ b/ports/qt5-imageformats/vcpkg.json @@ -1,7 +1,7 @@ { "name": "qt5-imageformats", "version": "5.15.5", - "port-version": 1, + "port-version": 2, "description": "Qt5 Image Formats Module - Plugins for additional image formats: TIFF, MNG, TGA, WBMP", "license": null, "dependencies": [ @@ -9,7 +9,10 @@ "libwebp", { "name": "qt5-base", - "default-features": false + "default-features": false, + "features": [ + "gui" + ] }, "tiff" ] diff --git a/ports/qt5-script/portfile.cmake b/ports/qt5-script/portfile.cmake index 2cd1cf47965fa3..8d8fa31453f579 100644 --- a/ports/qt5-script/portfile.cmake +++ b/ports/qt5-script/portfile.cmake @@ -1,2 +1,10 @@ +vcpkg_list(SET OPTIONS) +if(NOT "gui" IN_LIST FEATURES) + vcpkg_list(APPEND OPTIONS "QT.widgets.name=") +endif() +if(NOT "svg" IN_LIST FEATURES) + vcpkg_list(APPEND OPTIONS "QT.svg.name=") +endif() + include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) -qt_submodule_installation() \ No newline at end of file +qt_submodule_installation(OPTIONS ${OPTIONS}) diff --git a/ports/qt5-script/vcpkg.json b/ports/qt5-script/vcpkg.json index acb8ccfabd5195..9d0a4cc750206a 100644 --- a/ports/qt5-script/vcpkg.json +++ b/ports/qt5-script/vcpkg.json @@ -1,13 +1,44 @@ { "name": "qt5-script", "version": "5.15.5", + "port-version": 1, "description": "Qt5 Script Module.", "license": null, "dependencies": [ { "name": "qt5-base", "default-features": false + } + ], + "default-features": [ + "gui", + "svg" + ], + "features": { + "gui": { + "description": "Build GUI features, including QWidgets", + "dependencies": [ + { + "name": "qt5-base", + "default-features": false, + "features": [ + "gui" + ] + } + ] }, - "qt5-tools" - ] + "svg": { + "description": "SVG support", + "dependencies": [ + { + "name": "qt5-script", + "default-features": false, + "features": [ + "gui" + ] + }, + "qt5-svg" + ] + } + } } diff --git a/ports/qt5-svg/vcpkg.json b/ports/qt5-svg/vcpkg.json index 4247d8b0f73e19..26ae483a5a9762 100644 --- a/ports/qt5-svg/vcpkg.json +++ b/ports/qt5-svg/vcpkg.json @@ -1,12 +1,16 @@ { "name": "qt5-svg", "version": "5.15.5", + "port-version": 1, "description": "Qt5 SVG Module - provides classes for displaying the contents of SVG files", "license": null, "dependencies": [ { "name": "qt5-base", - "default-features": false + "default-features": false, + "features": [ + "gui" + ] } ] } diff --git a/ports/qt5-tools/portfile.cmake b/ports/qt5-tools/portfile.cmake index c166ed7f5701c1..a6dde4a210fea7 100644 --- a/ports/qt5-tools/portfile.cmake +++ b/ports/qt5-tools/portfile.cmake @@ -1,9 +1,29 @@ +vcpkg_list(SET OPTIONS) +if(NOT "gui" IN_LIST FEATURES) + set(VCPKG_POLICY_EMPTY_PACKAGE enabled) # only console tools + vcpkg_list(APPEND OPTIONS + "QT.quick.name=" + "config.qttools.features.assistant.disable=true" + "config.qttools.features.designer.disable=true" + "config.qttools.features.distancefieldgenerator.disable=true" + "config.qttools.features.pixeltool.disable=true" + "config.qttools.features.qtdiag.disable=true" + ) +endif() + include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) -qt_submodule_installation(PATCHES - icudt-debug-suffix.patch # https://bugreports.qt.io/browse/QTBUG-87677 +qt_submodule_installation( + PATCHES + icudt-debug-suffix.patch # https://bugreports.qt.io/browse/QTBUG-87677 + OPTIONS + ${OPTIONS} ) +if(NOT "gui" IN_LIST FEATURES) + file(REMOVE "${CURRENT_PACKAGES_DIR}/debug") +endif() + if(EXISTS "${CURRENT_INSTALLED_DIR}/plugins/platforms/qminimal${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}") file(INSTALL "${CURRENT_INSTALLED_DIR}/plugins/platforms/qminimal${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/plugins/platforms") endif() diff --git a/ports/qt5-tools/vcpkg.json b/ports/qt5-tools/vcpkg.json index 34058d03fa0a75..80bd041fd0f00c 100644 --- a/ports/qt5-tools/vcpkg.json +++ b/ports/qt5-tools/vcpkg.json @@ -1,6 +1,7 @@ { "name": "qt5-tools", "version": "5.15.5", + "port-version": 1, "description": "Qt5 Tools Module; Includes deployment tools and helpers, Qt Designer, Assistant, and other applications", "license": null, "dependencies": [ @@ -11,7 +12,27 @@ { "name": "qt5-base", "default-features": false - }, - "qt5-declarative" - ] + } + ], + "default-features": [ + "gui" + ], + "features": { + "gui": { + "description": "Build GUI libs and tools", + "dependencies": [ + { + "name": "qt5-base", + "default-features": false, + "features": [ + "gui" + ] + }, + { + "name": "qt5-declarative", + "default-features": false + } + ] + } + } } diff --git a/ports/qt5-translations/vcpkg.json b/ports/qt5-translations/vcpkg.json index 9d3deca1375c47..c395ace184eae9 100644 --- a/ports/qt5-translations/vcpkg.json +++ b/ports/qt5-translations/vcpkg.json @@ -1,6 +1,7 @@ { "name": "qt5-translations", "version": "5.15.5", + "port-version": 1, "description": "Qt5 translations module", "license": null, "dependencies": [ @@ -8,6 +9,10 @@ "name": "qt5-base", "default-features": false }, - "qt5-tools" + { + "name": "qt5-tools", + "host": true, + "default-features": false + } ] } From 7f47cd3cd6288a91dade973fd455f8cdd2d4450d Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 18 Apr 2022 19:40:43 +0200 Subject: [PATCH 6/8] Fix formatting --- ports/qt5-base/cmake/install_qt.cmake | 22 +++++++++++----------- ports/qt5-base/portfile.cmake | 26 +++++++++++++------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ports/qt5-base/cmake/install_qt.cmake b/ports/qt5-base/cmake/install_qt.cmake index 39781cebe01ee7..477d2806264b9f 100644 --- a/ports/qt5-base/cmake/install_qt.cmake +++ b/ports/qt5-base/cmake/install_qt.cmake @@ -25,19 +25,19 @@ function(install_qt) vcpkg_add_to_path(PREPEND "${PYTHON3_EXE_PATH}") if (CMAKE_HOST_WIN32) - # flex and bison for ANGLE library - vcpkg_find_acquire_program(FLEX) - get_filename_component(FLEX_EXE_PATH ${FLEX} DIRECTORY) - get_filename_component(FLEX_DIR ${FLEX_EXE_PATH} NAME) + # flex and bison for ANGLE library + vcpkg_find_acquire_program(FLEX) + get_filename_component(FLEX_EXE_PATH ${FLEX} DIRECTORY) + get_filename_component(FLEX_DIR ${FLEX_EXE_PATH} NAME) - file(COPY ${FLEX_EXE_PATH} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-tools" ) - set(FLEX_TEMP "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-tools/${FLEX_DIR}") - file(RENAME "${FLEX_TEMP}/win_bison.exe" "${FLEX_TEMP}/bison.exe") - file(RENAME "${FLEX_TEMP}/win_flex.exe" "${FLEX_TEMP}/flex.exe") - vcpkg_add_to_path("${FLEX_TEMP}") - endif() + file(COPY ${FLEX_EXE_PATH} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-tools" ) + set(FLEX_TEMP "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-tools/${FLEX_DIR}") + file(RENAME "${FLEX_TEMP}/win_bison.exe" "${FLEX_TEMP}/bison.exe") + file(RENAME "${FLEX_TEMP}/win_flex.exe" "${FLEX_TEMP}/flex.exe") + vcpkg_add_to_path("${FLEX_TEMP}") + endif() - set(_path "$ENV{PATH}") + set(_path "$ENV{PATH}") #Replace with VCPKG variables if PR #7733 is merged unset(BUILDTYPES) diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index 99e59829d51b49..3d40ae0438fe71 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -11,8 +11,8 @@ qt5-base for qt5-x11extras requires several libraries from the system package ma ) endif() -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") set(WITH_PGSQL_PLUGIN OFF) if("postgresqlplugin" IN_LIST FEATURES) @@ -104,7 +104,7 @@ list(APPEND CORE_OPTIONS -no-angle # Qt does not need to build angle. VCPKG will build angle! -no-glib -openssl-linked - ) +) if(WITH_PGSQL_PLUGIN) list(APPEND CORE_OPTIONS -sql-psql) @@ -201,17 +201,17 @@ set(FREETYPE_DEBUG_ALL "${FREETYPE_DEBUG} ${BZ2_DEBUG} ${LIBPNG_DEBUG} ${ZLIB_DE x_vcpkg_pkgconfig_get_modules(PREFIX harfbuzz MODULES harfbuzz LIBRARIES) set(RELEASE_OPTIONS - "ZLIB_LIBS=${ZLIB_RELEASE}" - "PCRE2_LIBS=${PCRE2_RELEASE}" - "QMAKE_LIBS_PRIVATE+=${BZ2_RELEASE}" - "QMAKE_LIBS_PRIVATE+=${ZSTD_RELEASE}" - ) + "ZLIB_LIBS=${ZLIB_RELEASE}" + "PCRE2_LIBS=${PCRE2_RELEASE}" + "QMAKE_LIBS_PRIVATE+=${BZ2_RELEASE}" + "QMAKE_LIBS_PRIVATE+=${ZSTD_RELEASE}" +) set(DEBUG_OPTIONS - "ZLIB_LIBS=${ZLIB_DEBUG}" - "PCRE2_LIBS=${PCRE2_DEBUG}" - "QMAKE_LIBS_PRIVATE+=${BZ2_DEBUG}" - "QMAKE_LIBS_PRIVATE+=${ZSTD_DEBUG}" - ) + "ZLIB_LIBS=${ZLIB_DEBUG}" + "PCRE2_LIBS=${PCRE2_DEBUG}" + "QMAKE_LIBS_PRIVATE+=${BZ2_DEBUG}" + "QMAKE_LIBS_PRIVATE+=${ZSTD_DEBUG}" +) if("icu" IN_LIST FEATURES) list(APPEND CORE_OPTIONS -icu) From ef139abc9c655930d897882f4428c97e55981442 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 18 Apr 2022 19:44:38 +0200 Subject: [PATCH 7/8] Drop unused variables --- ports/qt5-base/portfile.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index 3d40ae0438fe71..b2228a4610411a 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -145,10 +145,6 @@ find_library(PCRE2_RELEASE NAMES pcre2-16 pcre2-16-static PATHS "${CURRENT_INSTA find_library(PCRE2_DEBUG NAMES pcre2-16 pcre2-16-static pcre2-16d pcre2-16-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) find_library(FREETYPE_RELEASE NAMES freetype PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) #zlib, bzip2, libpng find_library(FREETYPE_DEBUG NAMES freetype freetyped PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) -find_library(DOUBLECONVERSION_RELEASE NAMES double-conversion PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) -find_library(DOUBLECONVERSION_DEBUG NAMES double-conversion PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) -find_library(HARFBUZZ_RELEASE NAMES harfbuzz PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) -find_library(HARFBUZZ_DEBUG NAMES harfbuzz PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) find_library(SQLITE_RELEASE NAMES sqlite3 PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) # Depends on openssl and zlib(linux) find_library(SQLITE_DEBUG NAMES sqlite3 sqlite3d PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) From 9b2934fe6ebbbe16080df5ba0d63539c4bec561f Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Fri, 22 Jul 2022 20:52:42 +0200 Subject: [PATCH 8/8] Update versions --- versions/baseline.json | 18 +++++++++--------- versions/q-/qt5-activeqt.json | 5 +++++ versions/q-/qt5-base.json | 5 +++++ versions/q-/qt5-declarative.json | 5 +++++ versions/q-/qt5-doc.json | 5 +++++ versions/q-/qt5-imageformats.json | 5 +++++ versions/q-/qt5-script.json | 5 +++++ versions/q-/qt5-svg.json | 5 +++++ versions/q-/qt5-tools.json | 5 +++++ versions/q-/qt5-translations.json | 5 +++++ 10 files changed, 54 insertions(+), 9 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 8b13a36a803a65..204596ba3ba94b 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5774,7 +5774,7 @@ }, "qt5-activeqt": { "baseline": "5.15.5", - "port-version": 0 + "port-version": 1 }, "qt5-androidextras": { "baseline": "5.15.5", @@ -5782,7 +5782,7 @@ }, "qt5-base": { "baseline": "5.15.5", - "port-version": 1 + "port-version": 2 }, "qt5-canvas3d": { "baseline": "0", @@ -5802,11 +5802,11 @@ }, "qt5-declarative": { "baseline": "5.15.5", - "port-version": 0 + "port-version": 1 }, "qt5-doc": { "baseline": "5.15.5", - "port-version": 0 + "port-version": 1 }, "qt5-gamepad": { "baseline": "5.15.5", @@ -5818,7 +5818,7 @@ }, "qt5-imageformats": { "baseline": "5.15.5", - "port-version": 1 + "port-version": 2 }, "qt5-location": { "baseline": "5.15.5", @@ -5862,7 +5862,7 @@ }, "qt5-script": { "baseline": "5.15.5", - "port-version": 0 + "port-version": 1 }, "qt5-scxml": { "baseline": "5.15.5", @@ -5886,15 +5886,15 @@ }, "qt5-svg": { "baseline": "5.15.5", - "port-version": 0 + "port-version": 1 }, "qt5-tools": { "baseline": "5.15.5", - "port-version": 0 + "port-version": 1 }, "qt5-translations": { "baseline": "5.15.5", - "port-version": 0 + "port-version": 1 }, "qt5-virtualkeyboard": { "baseline": "5.15.5", diff --git a/versions/q-/qt5-activeqt.json b/versions/q-/qt5-activeqt.json index fc3f4ffecfabe1..1fa5edc17a53ba 100644 --- a/versions/q-/qt5-activeqt.json +++ b/versions/q-/qt5-activeqt.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "a922da311780b878a5eb8ac301f2c3951eb6f676", + "version": "5.15.5", + "port-version": 1 + }, { "git-tree": "dac80735405e39d0a83de3d46e9462045062da11", "version": "5.15.5", diff --git a/versions/q-/qt5-base.json b/versions/q-/qt5-base.json index 54438544a99db5..c1b52ff1e6f516 100644 --- a/versions/q-/qt5-base.json +++ b/versions/q-/qt5-base.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "340b3846b4dca3f8b6e0cfb5b3aee42d02db0fa4", + "version": "5.15.5", + "port-version": 2 + }, { "git-tree": "21a6678f36c765307bd8d36052790ab2d59a494d", "version": "5.15.5", diff --git a/versions/q-/qt5-declarative.json b/versions/q-/qt5-declarative.json index 1e694a0462a187..ee4253f283d5c9 100644 --- a/versions/q-/qt5-declarative.json +++ b/versions/q-/qt5-declarative.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "cff60c375223f5c4ee54622caf52baa771910f1a", + "version": "5.15.5", + "port-version": 1 + }, { "git-tree": "713673abbea4c2f934d48fc95833758fc595f88f", "version": "5.15.5", diff --git a/versions/q-/qt5-doc.json b/versions/q-/qt5-doc.json index 28119b41b0b486..d5bf25811499a8 100644 --- a/versions/q-/qt5-doc.json +++ b/versions/q-/qt5-doc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "549c3370e6618eed2c08caa236c89313376c5c1d", + "version": "5.15.5", + "port-version": 1 + }, { "git-tree": "9281cb973df81d6e58551695de177c309d2bc7e8", "version": "5.15.5", diff --git a/versions/q-/qt5-imageformats.json b/versions/q-/qt5-imageformats.json index 3794ec3508f736..fcbe34d3812c86 100644 --- a/versions/q-/qt5-imageformats.json +++ b/versions/q-/qt5-imageformats.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "79f7ffa23e7a19118db42b71d32f3373910b1c1c", + "version": "5.15.5", + "port-version": 2 + }, { "git-tree": "a82ad93d08d83fcf90c4803f142585ac1f27c0da", "version": "5.15.5", diff --git a/versions/q-/qt5-script.json b/versions/q-/qt5-script.json index c7ed2e9d63918b..0193084b5c667a 100644 --- a/versions/q-/qt5-script.json +++ b/versions/q-/qt5-script.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "c8dca7d3a56a2fb8583d42b0a614b8a33ede16be", + "version": "5.15.5", + "port-version": 1 + }, { "git-tree": "6ea49f33c3a82afeff14d62385b01be448590f2f", "version": "5.15.5", diff --git a/versions/q-/qt5-svg.json b/versions/q-/qt5-svg.json index 932334fb65825a..315098f77bb27e 100644 --- a/versions/q-/qt5-svg.json +++ b/versions/q-/qt5-svg.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "02bedf2142dfedbc87914e74a9abd66475a3d574", + "version": "5.15.5", + "port-version": 1 + }, { "git-tree": "97b04510d3c94d68e1a46e891ae27ce98e112ad0", "version": "5.15.5", diff --git a/versions/q-/qt5-tools.json b/versions/q-/qt5-tools.json index f6dbf1506a075a..a5927ddfe69295 100644 --- a/versions/q-/qt5-tools.json +++ b/versions/q-/qt5-tools.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "89262a2105f2df34566361d22f8db0bedc748422", + "version": "5.15.5", + "port-version": 1 + }, { "git-tree": "40aebcfa61ced5500429ccc3533c7f294510ab0e", "version": "5.15.5", diff --git a/versions/q-/qt5-translations.json b/versions/q-/qt5-translations.json index 29cf0da685cc7b..aba5147d34bebb 100644 --- a/versions/q-/qt5-translations.json +++ b/versions/q-/qt5-translations.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0dae4d00a425b514913382d00a8b5e86f3d0c2e1", + "version": "5.15.5", + "port-version": 1 + }, { "git-tree": "726f0e5f2b92624ad638686cdf6c3c76a0a60c84", "version": "5.15.5",