From f75c836a67777a86a2c1116a28b179827f028b66 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 25 Jun 2025 00:30:44 +0200 Subject: [PATCH] [icu] Fix wrapper and pkgconfig files (#46007) --- ports/gdal/cmake-project-include.cmake | 9 + ports/gdal/portfile.cmake | 1 + ports/gdal/sqlite3.diff | 49 ++++++ ports/gdal/vcpkg.json | 1 + ports/icu/portfile.cmake | 17 +- ports/icu/vcpkg-cmake-wrapper.cmake | 138 ++++++++++++++- ports/icu/vcpkg.json | 6 +- ports/libxml2/cxx-for-icu.diff | 13 ++ ports/libxml2/portfile.cmake | 3 + ports/libxml2/vcpkg.json | 1 + ports/libxslt/cxx-for-libxml2-icu.diff | 13 ++ ports/libxslt/portfile.cmake | 5 +- ports/libxslt/vcpkg.json | 4 +- ports/python3/portfile.cmake | 9 +- ports/python3/vcpkg.json | 7 +- ports/qt5-base/portfile.cmake | 29 +--- ports/qt5-base/vcpkg.json | 7 +- ports/sqlite3/CMakeLists.txt | 7 +- ports/sqlite3/portfile.cmake | 3 + ports/sqlite3/sqlite3-config.in.cmake | 5 +- ports/sqlite3/vcpkg-cmake-wrapper.cmake | 35 ++++ ports/sqlite3/vcpkg.json | 1 + ports/xmlsec/CMakeLists.txt | 2 +- ports/xmlsec/portfile.cmake | 5 +- ports/xmlsec/vcpkg.json | 1 + scripts/ci.feature.baseline.txt | 12 +- .../cmake-user/project/CMakeLists.txt | 12 +- scripts/test_ports/cmake-user/vcpkg.json | 10 +- .../test_ports/vcpkg-ci-icu/portfile.cmake | 12 ++ .../vcpkg-ci-icu/project/CMakeLists.txt | 26 +++ .../test_ports/vcpkg-ci-icu/project/main.c | 9 + .../vcpkg-ci-icu/project/test-functions.cmake | 163 ++++++++++++++++++ scripts/test_ports/vcpkg-ci-icu/vcpkg.json | 17 ++ versions/baseline.json | 16 +- versions/g-/gdal.json | 5 + versions/i-/icu.json | 5 + versions/l-/libxml2.json | 5 + versions/l-/libxslt.json | 5 + versions/p-/python3.json | 5 + versions/q-/qt5-base.json | 5 + versions/s-/sqlite3.json | 5 + versions/x-/xmlsec.json | 5 + 42 files changed, 618 insertions(+), 70 deletions(-) create mode 100644 ports/gdal/sqlite3.diff create mode 100644 ports/libxml2/cxx-for-icu.diff create mode 100644 ports/libxslt/cxx-for-libxml2-icu.diff create mode 100644 ports/sqlite3/vcpkg-cmake-wrapper.cmake create mode 100644 scripts/test_ports/vcpkg-ci-icu/portfile.cmake create mode 100644 scripts/test_ports/vcpkg-ci-icu/project/CMakeLists.txt create mode 100644 scripts/test_ports/vcpkg-ci-icu/project/main.c create mode 100644 scripts/test_ports/vcpkg-ci-icu/project/test-functions.cmake create mode 100644 scripts/test_ports/vcpkg-ci-icu/vcpkg.json diff --git a/ports/gdal/cmake-project-include.cmake b/ports/gdal/cmake-project-include.cmake index ae0b28e7f4..98c997bf5d 100644 --- a/ports/gdal/cmake-project-include.cmake +++ b/ports/gdal/cmake-project-include.cmake @@ -16,3 +16,12 @@ if(GDAL_USE_ARROW) find_package(Arrow REQUIRED) set(ARROW_USE_STATIC_LIBRARIES "${ARROW_BUILD_STATIC}" CACHE BOOL "") endif() + +if(GDAL_USE_SQLITE3) + # CMake find module with vcpkg cmake wrapper + find_package(SQLite3 REQUIRED) + # .. and inject into GDAL's FindSQLite3.cmake + set(SQLite3_LIBRARY "${SQLite3_LIBRARIES}") + set(SQLite3_FOUND FALSE) + set(SQLITE3_FOUND FALSE) +endif() diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index ec8c82cb9a..63609f59d3 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -14,6 +14,7 @@ vcpkg_from_github( find-link-libraries.patch fix-gdal-target-interfaces.patch libkml.patch + sqlite3.diff target-is-valid.patch ${arm_neon_diff} ) diff --git a/ports/gdal/sqlite3.diff b/ports/gdal/sqlite3.diff new file mode 100644 index 0000000000..daeea017cb --- /dev/null +++ b/ports/gdal/sqlite3.diff @@ -0,0 +1,49 @@ +diff --git a/cmake/modules/packages/FindSQLite3.cmake b/cmake/modules/packages/FindSQLite3.cmake +index 903465b3c9..5d3a067e50 100644 +--- a/cmake/modules/packages/FindSQLite3.cmake ++++ b/cmake/modules/packages/FindSQLite3.cmake +@@ -77,7 +77,7 @@ if(SQLite3_INCLUDE_DIR AND SQLite3_LIBRARY) + cmake_push_check_state(RESET) + # check column metadata + set(CMAKE_REQUIRED_INCLUDES ${SQLite3_INCLUDE_DIR}) +- if( ${SQLite3_LIBRARY} MATCHES "libsqlite3.a") ++ if(0) + if(PC_SQLITE3_STATIC_LDFLAGS) + set(CMAKE_REQUIRED_LIBRARIES ${PC_SQLITE3_STATIC_LDFLAGS}) + else() +@@ -111,15 +111,10 @@ if(SQLite3_INCLUDE_DIR AND SQLite3_LIBRARY) + endif() + else() + set(CMAKE_REQUIRED_LIBRARIES ${SQLite3_LIBRARY}) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}) ++ list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} "") + endif() + +- # Trick to force CMake to re-run if SQLite3_LIBRARY changes +- # Useful in development situations when switching/refreshing the library +- set_property( +- DIRECTORY +- APPEND +- PROPERTY CMAKE_CONFIGURE_DEPENDS "${SQLite3_LIBRARY}" +- ) + # Invalidate cached variables if SQLite3_LIBRARY changes + file(TIMESTAMP "${SQLite3_LIBRARY}" SQLite3_LIBRARY_TIMESTAMP) + if( SQLite3_LIBRARY_TIMESTAMP_OLD_VAL AND +@@ -179,6 +174,7 @@ if(SQLite3_FOUND) + INTERFACE_INCLUDE_DIRECTORIES "${SQLite3_INCLUDE_DIRS}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${SQLite3_LIBRARY}") ++ endif() + if(SQLite3_HAS_COLUMN_METADATA) + set_property(TARGET SQLite::SQLite3 APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS "SQLite3_HAS_COLUMN_METADATA") +@@ -187,5 +183,9 @@ if(SQLite3_FOUND) + set_property(TARGET SQLite::SQLite3 APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS "SQLite3_HAS_RTREE") + endif() ++ get_target_property(definitions SQLite::SQLite3 INTERFACE_COMPILE_DEFINITIONS) ++ if(definitions) ++ list(REMOVE_DUPLICATES definitions) ++ set_target_properties(SQLite::SQLite3 PROPERTIES INTERFACE_COMPILE_DEFINITIONS "${definitions}") + endif() + endif() diff --git a/ports/gdal/vcpkg.json b/ports/gdal/vcpkg.json index 96ace7d691..c36c415cd2 100644 --- a/ports/gdal/vcpkg.json +++ b/ports/gdal/vcpkg.json @@ -1,6 +1,7 @@ { "name": "gdal", "version-semver": "3.11.0", + "port-version": 1, "description": "The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data", "homepage": "https://gdal.org", "license": null, diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index cfafa6562d..270507a33f 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -140,8 +140,23 @@ endif() vcpkg_copy_pdbs() vcpkg_fixup_pkgconfig() +set(cxx_link_libraries "") +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + block(PROPAGATE cxx_link_libraries) + vcpkg_cmake_get_vars(cmake_vars_file) + include("${cmake_vars_file}") + list(REMOVE_ITEM VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_LIBRARIES ${VCPKG_DETECTED_CMAKE_C_IMPLICIT_LINK_LIBRARIES}) + list(TRANSFORM VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_LIBRARIES REPLACE "^([^/]+)\$" "-l\\1") + string(JOIN " " cxx_link_libraries ${VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}) + endblock() + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/icu-uc.pc" "baselibs = " "baselibs = ${cxx_link_libraries} ") + if(NOT VCPKG_BUILD_TYPE) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/icu-uc.pc" "baselibs = " "baselibs = ${cxx_link_libraries} ") + endif() +endif() + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/icu/bin/icu-config" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../../" IGNORE_UNCHANGED) vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/icu/bin/icu-config" "${CURRENT_HOST_INSTALLED_DIR}" "`dirname $0`/../../../../${_HOST_TRIPLET}/" IGNORE_UNCHANGED) -file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY) vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/icu/vcpkg-cmake-wrapper.cmake b/ports/icu/vcpkg-cmake-wrapper.cmake index 512966f530..0d1b9d0b9b 100644 --- a/ports/icu/vcpkg-cmake-wrapper.cmake +++ b/ports/icu/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,130 @@ -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) -if(NOT "COMPONENTS" IN_LIST ARGS) - _find_package(${ARGS} COMPONENTS data) -else() - _find_package(${ARGS}) -endif() -cmake_policy(POP) +set(z_vcpkg_icu_fixup "") +set(z_vcpkg_icu_config_mode_args "${ARGS}") +list(FILTER z_vcpkg_icu_config_mode_args INCLUDE REGEX "^(CONFIGS?|HINTS|NAMES|NO_MODULE|PATH_SUFFIXES|PATHS)\$") +if(z_vcpkg_icu_config_mode_args STREQUAL "") + cmake_policy(PUSH) + cmake_policy(SET CMP0057 NEW) + if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") + # Fix problem: Static link libraries, ordered for traditional linker + if("io" IN_LIST ARGS AND NOT TARGET ICU::io) + if("in" IN_LIST ARGS) + list(APPEND z_vcpkg_icu_fixup "io->in") + list(REMOVE_ITEM ARGS in) + list(APPEND ARGS COMPONENTS in) + else() + list(APPEND z_vcpkg_icu_fixup "io->i18n") + list(REMOVE_ITEM ARGS i18n) + list(APPEND ARGS COMPONENTS i18n) + endif() + endif() + if("i18n" IN_LIST ARGS AND NOT TARGET ICU::i18n) + list(APPEND z_vcpkg_icu_fixup "i18n->uc") + list(REMOVE_ITEM ARGS uc) + list(APPEND ARGS COMPONENTS uc) + endif() + if("in" IN_LIST ARGS AND NOT TARGET ICU::in) + list(APPEND z_vcpkg_icu_fixup "in->uc") + list(REMOVE_ITEM ARGS uc) + list(APPEND ARGS COMPONENTS uc) + endif() + if("uc" IN_LIST ARGS AND NOT TARGET ICU::uc) + if("dt" IN_LIST ARGS) + list(APPEND z_vcpkg_icu_fixup "uc->dt") + list(REMOVE_ITEM ARGS dt) + list(APPEND ARGS COMPONENTS dt) + else() + list(APPEND z_vcpkg_icu_fixup "uc->data") + list(REMOVE_ITEM ARGS data) + list(APPEND ARGS COMPONENTS data) + endif() + # Fix problem: C++ linkage + add_library(ICU::uc STATIC IMPORTED) + list(APPEND z_vcpkg_icu_fixup "uc->c++") + endif() + endif() + # Fix problem: Find debug variant without 'd' suffix + # Fix problem: Apply NAMES_PER_DIR + if("data" IN_LIST ARGS) + find_library(ICU_DATA_LIBRARY_RELEASE NAMES icudata icudt NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH REQUIRED) + find_library(ICU_DATA_LIBRARY_DEBUG NAMES icudatad icudtd icudata icudt NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) + endif() + if("dt" IN_LIST ARGS) + find_library(ICU_DT_LIBRARY_RELEASE NAMES icudata icudt NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH REQUIRED) + find_library(ICU_DT_LIBRARY_DEBUG NAMES icudatad icudtd icudata icudt NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) + endif() + if("i18n" IN_LIST ARGS) + find_library(ICU_I18N_LIBRARY_RELEASE NAMES icui18n icuin NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH REQUIRED) + find_library(ICU_I18N_LIBRARY_DEBUG NAMES icui18nd icuind icui18n icuin NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) + endif() + if("in" IN_LIST ARGS) + find_library(ICU_IN_LIBRARY_RELEASE NAMES icui18n icuin NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH REQUIRED) + find_library(ICU_IN_LIBRARY_DEBUG NAMES icui18nd icuind icui18n icuin NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) + endif() + if("io" IN_LIST ARGS) + find_library(ICU_IO_LIBRARY_RELEASE NAMES icuio NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH REQUIRED) + find_library(ICU_IO_LIBRARY_DEBUG NAMES icuiod icuio NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) + endif() + if("tu" IN_LIST ARGS) + # optional, subject to icu[tools]. + find_library(ICU_TU_LIBRARY_RELEASE NAMES icutu NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH) + find_library(ICU_TU_LIBRARY_DEBUG NAMES icutud icutu NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) + endif() + if("uc" IN_LIST ARGS) + find_library(ICU_UC_LIBRARY_RELEASE NAMES icuuc NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH REQUIRED) + find_library(ICU_UC_LIBRARY_DEBUG NAMES icuucd icuuc NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) + endif() + cmake_policy(POP) +endif() + +_find_package(${ARGS}) + +if(ICU_FOUND AND NOT z_vcpkg_icu_fixup STREQUAL "") + cmake_policy(PUSH) + cmake_policy(SET CMP0057 NEW) + if("uc->c++" IN_LIST z_vcpkg_icu_fixup) + list(REMOVE_ITEM z_vcpkg_icu_fixup "uc->c++") + if(ICU_INCLUDE_DIR) + set_target_properties(ICU::uc PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${ICU_INCLUDE_DIR}") + endif() + if(EXISTS "${ICU_UC_LIBRARY}") + set_target_properties(ICU::uc PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${ICU_UC_LIBRARY}") + endif() + if(EXISTS "${ICU_UC_LIBRARY_RELEASE}") + set_property(TARGET ICU::uc APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(ICU::uc PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${ICU_UC_LIBRARY_RELEASE}") + endif() + if(EXISTS "${ICU_UC_LIBRARY_DEBUG}") + set_property(TARGET ICU::uc APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(ICU::uc PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" + IMPORTED_LOCATION_DEBUG "${ICU_UC_LIBRARY_DEBUG}") + endif() + endif() + if("i18n->uc" IN_LIST z_vcpkg_icu_fixup) + list(REMOVE_ITEM z_vcpkg_icu_fixup "i18n->uc") + set_target_properties(ICU::i18n PROPERTIES INTERFACE_LINK_LIBRARIES ICU::uc) + endif() + if("in->uc" IN_LIST z_vcpkg_icu_fixup) + list(REMOVE_ITEM z_vcpkg_icu_fixup "in->uc") + set_target_properties(ICU::in PROPERTIES INTERFACE_LINK_LIBRARIES ICU::uc) + endif() + if("uc->data" IN_LIST z_vcpkg_icu_fixup) + list(REMOVE_ITEM z_vcpkg_icu_fixup "uc->data") + set_target_properties(ICU::uc PROPERTIES INTERFACE_LINK_LIBRARIES ICU::data) + endif() + if("uc->dt" IN_LIST z_vcpkg_icu_fixup) + list(REMOVE_ITEM z_vcpkg_icu_fixup "uc->dt") + set_target_properties(ICU::uc PROPERTIES INTERFACE_LINK_LIBRARIES ICU::dt) + endif() + if(NOT z_vcpkg_icu_fixup STREQUAL "") + message(WARNING "Missing fixup handler for ${z_vcpkg_icu_fixup}.") + endif() + cmake_policy(POP) +endif() diff --git a/ports/icu/vcpkg.json b/ports/icu/vcpkg.json index b4ff152ac0..f1e48661ff 100644 --- a/ports/icu/vcpkg.json +++ b/ports/icu/vcpkg.json @@ -1,7 +1,7 @@ { "name": "icu", "version": "74.2", - "port-version": 5, + "port-version": 6, "description": "Mature and widely used Unicode and localization library.", "homepage": "https://icu.unicode.org/home", "license": "ICU", @@ -13,6 +13,10 @@ "tools" ] }, + { + "name": "vcpkg-cmake-get-vars", + "host": true + }, { "name": "vcpkg-make", "host": true diff --git a/ports/libxml2/cxx-for-icu.diff b/ports/libxml2/cxx-for-icu.diff new file mode 100644 index 0000000000..cb4390dac8 --- /dev/null +++ b/ports/libxml2/cxx-for-icu.diff @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2af1e6f..a2c134c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -10,7 +10,7 @@ foreach(line ${CONFIGURE_AC_LINES}) + endforeach() + set(VERSION "${LIBXML_MAJOR_VERSION}.${LIBXML_MINOR_VERSION}.${LIBXML_MICRO_VERSION}") + +-project(libxml2 VERSION ${VERSION} LANGUAGES C) ++project(libxml2 VERSION ${VERSION} LANGUAGES C CXX) + + include(CheckCSourceCompiles) + include(CheckFunctionExists) diff --git a/ports/libxml2/portfile.cmake b/ports/libxml2/portfile.cmake index dc20a4d2bb..ae01e3b913 100644 --- a/ports/libxml2/portfile.cmake +++ b/ports/libxml2/portfile.cmake @@ -5,6 +5,7 @@ vcpkg_from_github( SHA512 6d32311feda4b415f50236dbc1b982094fafe46f86bb3f2ad21365183bd7e9011d00e12c0c23827daf851022a20c99f7cc646e5957a10946300bdc836f91f924 HEAD_REF master PATCHES + cxx-for-icu.diff disable-docs.patch fix_cmakelist.patch fix_ios_compilation.patch @@ -53,6 +54,8 @@ vcpkg_cmake_configure( -DLIBXML2_WITH_XPATH=ON -DLIBXML2_WITH_XPTR=ON "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" + OPTIONS_DEBUG + -DLIBXML2_WITH_PROGRAMS=OFF ) vcpkg_cmake_install() diff --git a/ports/libxml2/vcpkg.json b/ports/libxml2/vcpkg.json index c5b2d09c4d..a54a2b6426 100644 --- a/ports/libxml2/vcpkg.json +++ b/ports/libxml2/vcpkg.json @@ -1,6 +1,7 @@ { "name": "libxml2", "version": "2.13.8", + "port-version": 1, "description": "Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform).", "homepage": "https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home", "license": "MIT", diff --git a/ports/libxslt/cxx-for-libxml2-icu.diff b/ports/libxslt/cxx-for-libxml2-icu.diff new file mode 100644 index 0000000000..c901174dcb --- /dev/null +++ b/ports/libxslt/cxx-for-libxml2-icu.diff @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 310f720..3e7d906 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,7 +20,7 @@ set(LIBEXSLT_VERSION_EXTRA "") + set(VERSION ${LIBXSLT_DOTTED_VERSION}) + set(LIBEXSLT_VERSION ${LIBEXSLT_DOTTED_VERSION}) + +-project(libxslt1 VERSION ${VERSION} LANGUAGES C) ++project(libxslt1 VERSION ${VERSION} LANGUAGES C CXX) + + list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + diff --git a/ports/libxslt/portfile.cmake b/ports/libxslt/portfile.cmake index d13f18fd98..863692233a 100644 --- a/ports/libxslt/portfile.cmake +++ b/ports/libxslt/portfile.cmake @@ -5,6 +5,7 @@ vcpkg_from_github( SHA512 51d9e9586f78c5aa69ac67fac64b865625fefb16bf06f1f06dede0a57b3e382e78dea69145c7c0c59f06735b738bed209751e691dd9045c3cc33df096963f89d HEAD_REF master PATCHES + cxx-for-libxml2-icu.diff python3.patch msvc-no-suffix.patch libexslt-pkgconfig.patch @@ -22,8 +23,8 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "tools" LIBXSLT_WITH_PROGRAMS ) if("python" IN_LIST FEATURES) - vcpkg_find_acquire_program(PYTHON3) - list(APPEND FEATURE_OPTIONS "-DPYTHON_EXECUTABLE=${PYTHON3}") + vcpkg_get_vcpkg_installed_python(PYTHON3) + list(APPEND FEATURE_OPTIONS "-DPython_EXECUTABLE=${PYTHON3}") list(APPEND FEATURE_OPTIONS_RELEASE "-DLIBXSLT_PYTHON_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/lib/site-packages") list(APPEND FEATURE_OPTIONS_DEBUG "-DLIBXSLT_PYTHON_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug/lib/site-packages") endif() diff --git a/ports/libxslt/vcpkg.json b/ports/libxslt/vcpkg.json index 0675111381..a867417461 100644 --- a/ports/libxslt/vcpkg.json +++ b/ports/libxslt/vcpkg.json @@ -1,6 +1,7 @@ { "name": "libxslt", "version": "1.1.43", + "port-version": 1, "description": "Libxslt is a XSLT library implemented in C for XSLT 1.0 and most of EXSLT", "homepage": "https://github.com/GNOME/libxslt", "license": null, @@ -48,7 +49,8 @@ "features": [ "profiler" ] - } + }, + "python3" ] }, "thread": { diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index 7fef3147dc..744e2541ba 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -102,12 +102,13 @@ if(VCPKG_TARGET_IS_WINDOWS) find_library(FFI_DEBUG NAMES ffi PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) find_library(LZMA_RELEASE NAMES lzma PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(LZMA_DEBUG NAMES lzma PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) - find_library(SQLITE_RELEASE NAMES sqlite3 PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) - find_library(SQLITE_DEBUG NAMES sqlite3 PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) + x_vcpkg_pkgconfig_get_modules(PREFIX PC_SQLITE3 MODULES sqlite3 LIBRARIES USE_MSVC_SYNTAX_ON_WINDOWS) + separate_arguments(SQLITE3_LIBRARIES_DEBUG UNIX_COMMAND "${PC_SQLITE3_LIBRARIES_DEBUG}") + separate_arguments(SQLITE3_LIBRARIES_RELEASE UNIX_COMMAND "${PC_SQLITE3_LIBRARIES_RELEASE}") find_library(SSL_RELEASE NAMES libssl PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(SSL_DEBUG NAMES libssl PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) - list(APPEND add_libs_rel "${BZ2_RELEASE};${EXPAT_RELEASE};${FFI_RELEASE};${LZMA_RELEASE};${SQLITE_RELEASE}") - list(APPEND add_libs_dbg "${BZ2_DEBUG};${EXPAT_DEBUG};${FFI_DEBUG};${LZMA_DEBUG};${SQLITE_DEBUG}") + list(APPEND add_libs_rel "${BZ2_RELEASE};${EXPAT_RELEASE};${FFI_RELEASE};${LZMA_RELEASE};${SQLITE3_LIBRARIES_RELEASE}") + list(APPEND add_libs_dbg "${BZ2_DEBUG};${EXPAT_DEBUG};${FFI_DEBUG};${LZMA_DEBUG};${SQLITE3_LIBRARIES_DEBUG}") else() message(STATUS "WARNING: Extensions have been disabled. No C extension modules will be available.") endif() diff --git a/ports/python3/vcpkg.json b/ports/python3/vcpkg.json index 7d2b29be38..a14afb5d28 100644 --- a/ports/python3/vcpkg.json +++ b/ports/python3/vcpkg.json @@ -1,7 +1,7 @@ { "name": "python3", "version": "3.12.9", - "port-version": 1, + "port-version": 2, "description": "The Python programming language", "homepage": "https://github.com/python/cpython", "license": "Python-2.0", @@ -81,6 +81,11 @@ { "name": "sqlite3", "default-features": false + }, + { + "name": "vcpkg-pkgconfig-get-modules", + "host": true, + "platform": "windows & !mingw" } ] }, diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index 3c5eda9ddc..34ba6ba814 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -14,11 +14,6 @@ endif() list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) -set(WITH_SQLITE3_PLUGIN OFF) -if("sqlite3plugin" IN_LIST FEATURES) - set(WITH_SQLITE3_PLUGIN ON) -endif() - set(WITH_PGSQL_PLUGIN OFF) if("postgresqlplugin" IN_LIST FEATURES) set(WITH_PGSQL_PLUGIN ON) @@ -132,11 +127,6 @@ else() list(APPEND CORE_OPTIONS -dbus-runtime) endif() -if(WITH_SQLITE3_PLUGIN) - list(APPEND CORE_OPTIONS -system-sqlite) -else() - list(APPEND CORE_OPTIONS -no-sql-sqlite) -endif() if(WITH_PGSQL_PLUGIN) list(APPEND CORE_OPTIONS -sql-psql) else() @@ -184,10 +174,6 @@ find_library(FREETYPE_RELEASE NAMES freetype PATHS "${CURRENT_INSTALLED_DIR}/lib 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) -find_library(SQLITE_DEBUG NAMES sqlite3 sqlite3d PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) find_library(BROTLI_COMMON_RELEASE NAMES brotlicommon brotlicommon-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(BROTLI_COMMON_DEBUG NAMES brotlicommon brotlicommon-static brotlicommond brotlicommon-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) @@ -256,6 +242,15 @@ set(DEBUG_OPTIONS "QMAKE_LIBS_PRIVATE+=${ZSTD_DEBUG}" ) +if("sqlite3plugin" IN_LIST FEATURES) + list(APPEND CORE_OPTIONS -system-sqlite) + x_vcpkg_pkgconfig_get_modules(PREFIX sqlite3 MODULES sqlite3 LIBRARIES) + list(APPEND RELEASE_OPTIONS "SQLITE_LIBS=${sqlite3_LIBRARIES_RELEASE}") + list(APPEND DEBUG_OPTIONS "SQLITE_LIBS=${sqlite3_LIBRARIES_DEBUG}") +else() + list(APPEND CORE_OPTIONS -no-sql-sqlite) +endif() + if("icu" IN_LIST FEATURES) list(APPEND CORE_OPTIONS -icu) @@ -287,12 +282,10 @@ if(VCPKG_TARGET_IS_WINDOWS) endif() set(ADDITIONAL_WINDOWS_LIBS "-lws2_32 -lsecur32 -ladvapi32 -lshell32 -lcrypt32 -luser32 -lgdi32") list(APPEND RELEASE_OPTIONS - "SQLITE_LIBS=${SQLITE_RELEASE}" "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_RELEASE}" ) list(APPEND DEBUG_OPTIONS - "SQLITE_LIBS=${SQLITE_DEBUG}" "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_DEBUG}" ) @@ -310,12 +303,10 @@ if(VCPKG_TARGET_IS_WINDOWS) elseif(VCPKG_TARGET_IS_LINUX) list(APPEND CORE_OPTIONS -fontconfig -xcb-xlib -xcb -linuxfb) list(APPEND RELEASE_OPTIONS - "SQLITE_LIBS=${SQLITE_RELEASE} -ldl -lpthread" "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_RELEASE}" "FONTCONFIG_LIBS=${FONTCONFIG_RELEASE} ${FREETYPE_RELEASE} ${EXPAT_RELEASE} -luuid" ) list(APPEND DEBUG_OPTIONS - "SQLITE_LIBS=${SQLITE_DEBUG} -ldl -lpthread" "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_DEBUG}" "FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG} -luuid" ) @@ -393,12 +384,10 @@ elseif(VCPKG_TARGET_IS_OSX) file(WRITE "${SOURCE_PATH}/mkspecs/common/macx.conf" ${_tmp_contents}) #list(APPEND QT_PLATFORM_CONFIGURE_OPTIONS HOST_PLATFORM ${TARGET_MKSPEC}) list(APPEND RELEASE_OPTIONS - "SQLITE_LIBS=${SQLITE_RELEASE} -ldl -lpthread" "HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_RELEASE} -framework ApplicationServices" "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" "FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG} -liconv" ) diff --git a/ports/qt5-base/vcpkg.json b/ports/qt5-base/vcpkg.json index 3cfe6e862a..5bcbffdee8 100644 --- a/ports/qt5-base/vcpkg.json +++ b/ports/qt5-base/vcpkg.json @@ -1,7 +1,7 @@ { "name": "qt5-base", "version": "5.15.16", - "port-version": 4, + "port-version": 5, "description": "Qt Base provides the basic non-GUI functionality required by all Qt applications.", "homepage": "https://www.qt.io/", "license": null, @@ -85,7 +85,10 @@ "sqlite3plugin": { "description": "Build the sql plugin for connecting to sqlite3 databases", "dependencies": [ - "sqlite3" + { + "name": "sqlite3", + "default-features": false + } ] }, "vulkan": { diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt index a8e70947fa..83c222552e 100644 --- a/ports/sqlite3/CMakeLists.txt +++ b/ports/sqlite3/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) -project(sqlite3 C) +project(sqlite3 C CXX) option(WITH_ZLIB "Build sqlite3 with zlib support" OFF) option(SQLITE3_SKIP_TOOLS "Disable build sqlite3 executable" OFF) @@ -56,8 +56,7 @@ endif() if(NOT SQLITE3_SKIP_TOOLS) add_executable(sqlite3-bin shell.c) set_target_properties(sqlite3-bin PROPERTIES - OUTPUT_NAME sqlite3 - PDB_NAME "sqlite3${CMAKE_EXECUTABLE_SUFFIX}.pdb" + RUNTIME_OUTPUT_NAME sqlite3 ) target_link_libraries(sqlite3-bin PRIVATE sqlite3) @@ -72,7 +71,7 @@ if(NOT SQLITE3_SKIP_TOOLS) target_link_libraries(sqlite3-bin PRIVATE m) endif() - install(TARGETS sqlite3-bin sqlite3 + install(TARGETS sqlite3-bin RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index 9366395f14..7d75a57954 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -93,6 +93,9 @@ configure_file( "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-sqlite3-config.cmake" @ONLY ) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + configure_file("${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY) +endif() vcpkg_fixup_pkgconfig() vcpkg_copy_pdbs() diff --git a/ports/sqlite3/sqlite3-config.in.cmake b/ports/sqlite3/sqlite3-config.in.cmake index fac63e6c05..7a2b4fb60e 100644 --- a/ports/sqlite3/sqlite3-config.in.cmake +++ b/ports/sqlite3/sqlite3-config.in.cmake @@ -1,7 +1,10 @@ +include(CMakeFindDependencyMacro) if(NOT WIN32) - include(CMakeFindDependencyMacro) find_dependency(Threads) endif() +if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") + find_package(ICU COMPONENTS uc i18n) +endif() include(${CMAKE_CURRENT_LIST_DIR}/unofficial-sqlite3-targets.cmake) diff --git a/ports/sqlite3/vcpkg-cmake-wrapper.cmake b/ports/sqlite3/vcpkg-cmake-wrapper.cmake new file mode 100644 index 0000000000..0b311fcff2 --- /dev/null +++ b/ports/sqlite3/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,35 @@ +string(COMPARE EQUAL "${SQLite3_LIBRARIES}" "" z_vcpkg_sqlite3_fixup_libraries) +_find_package(${ARGS}) +if(SQLite3_FOUND) + set(z_vcpkg_sqlite3_libraries "") + set(z_vcpkg_sqlite3_link_libs "") + if("@SQLITE_ENABLE_ICU@") + find_package(ICU COMPONENTS uc i18n) + if(ICU_FOUND) + list(APPEND z_vcpkg_sqlite3_libraries ${ICU_LIBRARIES}) + list(APPEND z_vcpkg_sqlite3_link_libs $ $) + endif() + endif() + if(NOT WIN32) + find_package(Threads) + if(Threads_FOUND) + list(APPEND z_vcpkg_sqlite3_libraries ${CMAKE_THREAD_LIBS_INIT}) + list(APPEND z_vcpkg_sqlite3_link_libs $) + endif() + list(APPEND z_vcpkg_sqlite3_libraries ${CMAKE_DL_LIBS}) + list(APPEND z_vcpkg_sqlite3_link_libs ${CMAKE_DL_LIBS}) + if("@SQLITE_ENABLE_FTS5@" OR "@SQLITE_ENABLE_MATH_FUNCTIONS@") + find_library(z_vcpkg_sqlite3_have_libm m) + if(z_vcpkg_sqlite3_have_libm) + list(APPEND z_vcpkg_sqlite3_libraries m) + list(APPEND z_vcpkg_sqlite3_link_libs $) + endif() + endif() + endif() + if(z_vcpkg_sqlite3_fixup_libraries) + list(APPEND SQLite3_LIBRARIES ${z_vcpkg_sqlite3_libraries}) + endif() + if(TARGET SQLite::SQLite3) + set_target_properties(SQLite::SQLite3 PROPERTIES INTERFACE_LINK_LIBRARIES "${z_vcpkg_sqlite3_link_libs}") + endif() +endif() diff --git a/ports/sqlite3/vcpkg.json b/ports/sqlite3/vcpkg.json index 1f2ba60259..c7b668d792 100644 --- a/ports/sqlite3/vcpkg.json +++ b/ports/sqlite3/vcpkg.json @@ -1,6 +1,7 @@ { "name": "sqlite3", "version": "3.49.2", + "port-version": 1, "description": "SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.", "homepage": "https://sqlite.org/", "license": "blessing", diff --git a/ports/xmlsec/CMakeLists.txt b/ports/xmlsec/CMakeLists.txt index 29ad983d60..158270e1b0 100644 --- a/ports/xmlsec/CMakeLists.txt +++ b/ports/xmlsec/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.8) -project (xmlsec1 C) +project (xmlsec1 C CXX) option(INSTALL_HEADERS_TOOLS "Install public header files and tools" ON) diff --git a/ports/xmlsec/portfile.cmake b/ports/xmlsec/portfile.cmake index 79aa40d7f4..ac9a8ad6b3 100644 --- a/ports/xmlsec/portfile.cmake +++ b/ports/xmlsec/portfile.cmake @@ -1,5 +1,3 @@ -vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION} - string(REPLACE "." "_" release_tag "xmlsec_${VERSION}") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -10,7 +8,6 @@ vcpkg_from_github( PATCHES pkgconfig_fixes.patch ) - file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") vcpkg_cmake_configure( @@ -28,4 +25,4 @@ file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/xmlsec-config.cmake" DESTINATION "${CURR file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/unofficial-xmlsec-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/unofficial-xmlsec") file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -file(INSTALL "${SOURCE_PATH}/Copyright" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/Copyright") diff --git a/ports/xmlsec/vcpkg.json b/ports/xmlsec/vcpkg.json index 719aea949b..a624ab8384 100644 --- a/ports/xmlsec/vcpkg.json +++ b/ports/xmlsec/vcpkg.json @@ -1,6 +1,7 @@ { "name": "xmlsec", "version": "1.3.7", + "port-version": 1, "description": "XML Security Library is a C library based on LibXML2. The library supports major XML security standards.", "homepage": "https://www.aleksey.com/xmlsec/", "license": "X11 AND MPL-1.1", diff --git a/scripts/ci.feature.baseline.txt b/scripts/ci.feature.baseline.txt index 0989fff3c6..cdd9be7825 100644 --- a/scripts/ci.feature.baseline.txt +++ b/scripts/ci.feature.baseline.txt @@ -401,7 +401,8 @@ portable-snippets:arm-uwp=fail qbittorrent:x64-linux=fail # Not yet ready for these platforms. qbittorrent:x64-osx=fail # Not yet ready for these platforms. qt-advanced-docking-system(android)=fail -qt5-base:arm64-windows=fail +# qt5-base: no cross builds +qt5-base(arm & windows & !uwp)=fail qt5-canvas3d=skip # Skip deprecated Qt module (remove after 1 year or longer due to vcpkg upgrade not handling removed ports correctly) qt5-wayland:x64-osx=fail # Missing system libraries qt5-webengine = fail # Missing prerequisites for CI success @@ -1359,7 +1360,6 @@ libxkbcommon:arm64-uwp = cascade libxkbcommon:x64-uwp = cascade libxkbfile:arm64-uwp = cascade libxkbfile:x64-uwp = cascade -libxml2[icu](uwp) = cascade libxmlpp:arm64-uwp = cascade libxmlpp:x64-uwp = cascade libxmu:arm64-uwp = cascade @@ -1684,10 +1684,7 @@ qt5-3d:arm64-uwp = cascade qt5-3d:x64-uwp = cascade qt5-activeqt:arm64-uwp = cascade qt5-activeqt:x64-uwp = cascade -qt5-base:arm64-uwp = cascade -qt5-base:x64-uwp = cascade -qt5-base[mysqlplugin]:x86-windows = cascade -qt5-base[vulkan](osx) = cascade # no vulkan sdk installed +qt5-base(uwp) = cascade qt5-charts:arm64-uwp = cascade qt5-charts:x64-uwp = cascade qt5-connectivity:arm64-uwp = cascade @@ -2184,6 +2181,8 @@ poco[core,mariadb,mysql] = options # You can not install mariadb and mysql at th ppqsort[openmp](osx) = feature-fails # No openmp on osx qt3d[animation] = options # is a requirement, see https://github.com/microsoft/vcpkg/issues/31336 qt3d[extras] = options # is a requirement, see https://github.com/microsoft/vcpkg/issues/31336 +qt5-base[vulkan](osx) = feature-fails # needs MolkenVK +qt5-base[vulkan](windows) = feature-fails # needs configuration qt5compat[iconv](!uwp) = feature-fails # requires qtbase without icu qtbase[gles3](android) = feature-fails qtbase[sql-oci](!(arm & windows)) = feature-fails # see https://github.com/microsoft/vcpkg/issues/32052 @@ -2232,6 +2231,7 @@ magnum[anyshaderconverter,shadertools,shaderconverter,vk-info] = skip # only ava magnum-plugins[cgltfimporter,glslangshaderconverter,ktximageconverter,ktximporter,openexrimageconverter,openexrimporter,spirvtoolsshaderconverter,stbdxtimageconverter] = skip # only available in head build openjpeg[tools] = skip # fails and is deprecated pango[introspection]:arm64-windows = skip # needs arm64 host +qt5-base(android) = skip # port doesn't support cross builds qtbase[xcb,xcb-xlib,xkb,xkbcommon-x11,xlib,xrender](osx) = skip # no x11 on macOS qtwebengine = skip # Takes too long to feature test at ~3 hours per feature s2n = skip # builds too slow diff --git a/scripts/test_ports/cmake-user/project/CMakeLists.txt b/scripts/test_ports/cmake-user/project/CMakeLists.txt index 8a3f1d30c5..ef702703d0 100644 --- a/scripts/test_ports/cmake-user/project/CMakeLists.txt +++ b/scripts/test_ports/cmake-user/project/CMakeLists.txt @@ -31,17 +31,21 @@ install(TARGETS exe lib set(FIND_PACKAGES "" CACHE STRING "List of packages to be found and used") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") foreach(package ${FIND_PACKAGES}) + set(extra_args "") + if(package STREQUAL "ICU") + set(extra_args COMPONENTS uc) + endif() string(TOUPPER "${package}" package_upper) set(CMAKE_FIND_DEBUG_MODE ON) - find_package("${package}" QUIET) + find_package("${package}" ${extra_args} QUIET) set(CMAKE_FIND_DEBUG_MODE OFF) if(NOT ${package}_FOUND AND NOT ${package_upper}_FOUND) - message(SEND_ERROR "find_package(${package}) check: failed") + message(SEND_ERROR "find_package(${package} ${extra_args}) check: failed") continue() endif() # REQUIRED changes the behaviour find_package_handle_standard_args. - find_package("${package}" REQUIRED) - message(STATUS "find_package(${package}) check: success") + find_package("${package}" ${extra_args} REQUIRED) + message(STATUS "find_package(${package} ${extra_args}) check: success") set(libraries_var "") if(DEFINED ${package}_LIBRARIES) diff --git a/scripts/test_ports/cmake-user/vcpkg.json b/scripts/test_ports/cmake-user/vcpkg.json index c71a85ecfe..4cc62e1761 100644 --- a/scripts/test_ports/cmake-user/vcpkg.json +++ b/scripts/test_ports/cmake-user/vcpkg.json @@ -114,7 +114,10 @@ { "$package": "LibXml2", "name": "libxml2", - "default-features": false + "default-features": false, + "features": [ + "icu" + ] }, { "$package": "LibXslt", @@ -139,7 +142,10 @@ { "$package": "SQLite3", "name": "sqlite3", - "default-features": false + "default-features": false, + "features": [ + "unicode" + ] }, { "$package": "TIFF", diff --git a/scripts/test_ports/vcpkg-ci-icu/portfile.cmake b/scripts/test_ports/vcpkg-ci-icu/portfile.cmake new file mode 100644 index 0000000000..cb50a449ad --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-icu/portfile.cmake @@ -0,0 +1,12 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_find_acquire_program(PKGCONFIG) + +vcpkg_cmake_configure( + SOURCE_PATH "${CURRENT_PORT_DIR}/project" + OPTIONS + "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" + "-DVCPKG_CHECK_CMAKE_BUILD_TYPE=${VCPKG_BUILD_TYPE}" + "-DVCPKG_CROSSCOMPILING=${VCPKG_CROSSCOMPILING}" +) +vcpkg_cmake_build() diff --git a/scripts/test_ports/vcpkg-ci-icu/project/CMakeLists.txt b/scripts/test_ports/vcpkg-ci-icu/project/CMakeLists.txt new file mode 100644 index 0000000000..fcd52b2e63 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-icu/project/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.16) +project(icu-test C CXX) + +include("${CMAKE_CURRENT_LIST_DIR}/test-functions.cmake") + +find_package(ICU MODULE COMPONENTS i18n REQUIRED) + +add_executable(main main.c) +target_link_libraries(main PRIVATE ICU::i18n) + + +find_package(PkgConfig REQUIRED) +pkg_check_modules(icu_pc icu-i18n REQUIRED IMPORTED_TARGET) + +add_executable(main-pkconfig main.c) +target_link_libraries(main-pkconfig PRIVATE PkgConfig::icu_pc) + +# Validate other components + +set(required_components data dt in io tu uc) +if(VCPKG_CROSSCOMPILING) + list(REMOVE_ITEM required_components tu) # comes with (host) tools +endif() +vcpkg_check_cmake_package_find(ICU MODULE REQUIRED COMPONENTS ${required_components}) +vcpkg_check_cmake_package_variables() +vcpkg_check_cmake_package_targets() diff --git a/scripts/test_ports/vcpkg-ci-icu/project/main.c b/scripts/test_ports/vcpkg-ci-icu/project/main.c new file mode 100644 index 0000000000..4054c74124 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-icu/project/main.c @@ -0,0 +1,9 @@ +#include "unicode/udat.h" + +int main() +{ + UErrorCode status = U_ZERO_ERROR; + UDateFormat* dateFormatter = udat_open(UDAT_NONE, UDAT_SHORT, NULL, NULL, -1, NULL, 0, &status); + udat_close(dateFormatter); + return 0; +} diff --git a/scripts/test_ports/vcpkg-ci-icu/project/test-functions.cmake b/scripts/test_ports/vcpkg-ci-icu/project/test-functions.cmake new file mode 100644 index 0000000000..976e6a36f4 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-icu/project/test-functions.cmake @@ -0,0 +1,163 @@ +set(VCPKG_CHECK_CMAKE_BUILD_TYPE "" CACHE STRING "Build type to be checked") + +set(Z_VCPKG_CHECK_CMAKE_PACKAGE_LAST_SEEN "" CACHE INTERNAL "Last loaded package name") + +# Call and trace find_package in distinct scope +function(z_vcpkg_check_cmake_package_trace_find) + set(CMAKE_FIND_DEBUG_MODE ON) + set(VCPKG_TRACE_FIND_PACKAGE ON) + find_package(${ARGN}) +endfunction() + +# Call and trace find_package, ensure that it called twice +macro(vcpkg_check_cmake_package_find package) + z_vcpkg_check_cmake_package_trace_find("${package}" ${ARGN}) + message(STATUS "Checking that find_package(${package} ...) can be called again") + find_package("${package}" ${ARGN} QUIET) + message(STATUS "Checking that find_package(${package} ...) can be called again - done") + set(Z_VCPKG_CHECK_CMAKE_PACKAGE_LAST_SEEN "${package}" CACHE INTERNAL "Last loaded package name") +endmacro() + +# Check that library variables match the debug/release build type. +# The variable names might be passed in explicitly or guessed from a prefix. +# If no args are given, the prefix is the name of the last package loaded +# by vcpkg_check_cmake_package_find(). +function(vcpkg_check_cmake_package_variables) + cmake_parse_arguments(PARSE_ARGV 0 arg "" "PREFIX" "") + if(arg_PREFIX AND arg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "'PREFIX value' must not be used together with other values.") + endif() + if(NOT arg_PREFIX AND NOT arg_UNPARSED_ARGUMENTS) + if(Z_VCPKG_CHECK_CMAKE_PACKAGE_LAST_SEEN) + set(arg_PREFIX "${Z_VCPKG_CHECK_CMAKE_PACKAGE_LAST_SEEN}") + else() + message(FATAL_ERROR "Unable to determine the prefix to be checked.") + endif() + endif() + + set(libraries_vars "${arg_UNPARSED_ARGUMENTS}") + if(libraries_vars STREQUAL "") + string(REGEX REPLACE "_\$" "" prefix "${arg_PREFIX}") + if(DEFINED "${prefix}_LIBRARIES") + set(libraries_vars "${prefix}_LIBRARIES") + elseif(DEFINED "${package}_LIBRARY") + set(libraries_vars "${prefix}_LIBRARY") + endif() + if(DEFINED "${prefix}_LIBRARY_DIR") + list(APPEND "libraries_vars" "${${prefix}_LIBRARY_DIR}") + endif() + if(DEFINED "${prefix}_LIBRARY_DIRS") + list(APPEND "libraries_vars" "${${prefix}_LIBRARY_DIRS}") + endif() + endif() + if(libraries_vars STREQUAL "") + message(FATAL_ERROR "Unable to determine the variables to be checked.") + endif() + + set(link_keywords debug general optimized) + foreach(var IN LISTS libraries_vars) + set(libraries "${${var}}") + message(STATUS "${var}: ${libraries}") + set(last_keyword "") + foreach(item IN LISTS libraries) + if(item IN_LIST link_keywords) + set(last_keyword "${item}") + continue() + endif() + string(FIND "${item}" "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/" starts_with_release) + string(FIND "${item}" "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/" starts_with_debug) + if(starts_with_release EQUAL "0") + if(last_keyword STREQUAL "optimized") + # okay + elseif(last_keyword STREQUAL "debug") + message(SEND_ERROR "Release lib for 'debug' keyword: ${item}") + elseif(CMAKE_BUILD_TYPE STREQUAL "Debug") + message(SEND_ERROR "Release lib for 'Debug' build: ${item}") + endif() + elseif(starts_with_debug EQUAL "0") + if(last_keyword STREQUAL "debug") + # okay + elseif(last_keyword STREQUAL "optimized") + message(SEND_ERROR "Debug lib for 'optimized' keyword: ${item}") + elseif(CMAKE_BUILD_TYPE STREQUAL "Release") + message(SEND_ERROR "Debug lib for 'Release' build: ${item}") + endif() + endif() + set(last_keyword "") + continue() + endforeach() + endforeach() +endfunction() + +# Check that imported target properties match the debug/release build type. +# The target names might be passed in explicitly or guessed from a namespace. +# If no args are given, the namespace is the name of the last package loaded +# by vcpkg_check_cmake_package_find(). +function(vcpkg_check_cmake_package_targets) + cmake_parse_arguments(PARSE_ARGV 0 arg "" "NAMESPACE" "") + if(arg_NAMESPACE AND arg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "'NAMESPACE value' must not be used together with other values.") + endif() + if(NOT arg_NAMESPACE AND NOT arg_UNPARSED_ARGUMENTS) + if(Z_VCPKG_CHECK_CMAKE_PACKAGE_LAST_SEEN) + set(arg_NAMESPACE "${Z_VCPKG_CHECK_CMAKE_PACKAGE_LAST_SEEN}") + else() + message(FATAL_ERROR "Unable to determine the namespace to be checked.") + endif() + endif() + + set(targets "${arg_UNPARSED_ARGUMENTS}") + if(targets STREQUAL "") + string(REGEX REPLACE "::::\$" "::" namespace "${arg_NAMESPACE}::") + get_directory_property(targets IMPORTED_TARGETS) + list(FILTER targets INCLUDE REGEX "^${namespace}") + endif() + if(targets STREQUAL "") + message(FATAL_ERROR "Unable to determine the targets to be checked.") + endif() + + foreach(target IN LISTS targets) + if(NOT TARGET "${target}") + message(FATAL_ERROR "No such target: ${target}") + endif() + get_target_property(type "${target}" TYPE) + message(STATUS "${target}: ${type}") + if(type MATCHES "LIBRARY" AND NOT type MATCHES "INTERFACE") + get_target_property(configurations "${target}" IMPORTED_CONFIGURATIONS) + message(STATUS " IMPORTED_CONFIGURATIONS: ${configurations}") + if(configurations) + string(TOLOWER "${configurations}" configurations) + if("release" IN_LIST configurations) + set(property IMPORTED_IMPLIB_RELEASE) + get_target_property(location "${target}" "${property}") + if(NOT location) + set(property IMPORTED_LOCATION_RELEASE) + get_target_property(location "${target}" "${property}") + endif() + message(STATUS " ${property}: ${location}") + string(FIND "${location}" "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" index) + if (NOT index EQUAL "0") + message(SEND_ERROR "Release lib is in wrong location.") + endif() + elseif(NOT VCPKG_CHECK_CMAKE_BUILD_TYPE OR VCPKG_CHECK_CMAKE_BUILD_TYPE STREQUAL "release") + message(SEND_ERROR "Release configuration is missing.") + endif() + if("debug" IN_LIST configurations) + set(property IMPORTED_IMPLIB_DEBUG) + get_target_property(location "${target}" "${property}") + if(NOT location) + set(property IMPORTED_LOCATION_DEBUG) + get_target_property(location "${target}" "${property}") + endif() + message(STATUS " ${property}: ${location}") + string(FIND "${location}" "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" index) + if (NOT index EQUAL "0") + message(SEND_ERROR "Debug lib is in wrong location.") + endif() + elseif(NOT VCPKG_CHECK_CMAKE_BUILD_TYPE OR VCPKG_CHECK_CMAKE_BUILD_TYPE STREQUAL "debug") + message(SEND_ERROR "Debug configuration is missing.") + endif() + endif() + endif() + endforeach() +endfunction() diff --git a/scripts/test_ports/vcpkg-ci-icu/vcpkg.json b/scripts/test_ports/vcpkg-ci-icu/vcpkg.json new file mode 100644 index 0000000000..7aef59073d --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-icu/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "vcpkg-ci-icu", + "version-string": "ci", + "description": "Port to valdiate icu", + "homepage": "https://github.com/microsoft/vcpkg", + "license": "MIT", + "dependencies": [ + { + "name": "icu", + "default-features": false + }, + { + "name": "vcpkg-cmake", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 9ed442f3dd..748ac6b58b 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3130,7 +3130,7 @@ }, "gdal": { "baseline": "3.11.0", - "port-version": 0 + "port-version": 1 }, "gdbm": { "baseline": "1.24", @@ -3758,7 +3758,7 @@ }, "icu": { "baseline": "74.2", - "port-version": 5 + "port-version": 6 }, "ideviceinstaller": { "baseline": "2023-07-21", @@ -5638,7 +5638,7 @@ }, "libxml2": { "baseline": "2.13.8", - "port-version": 0 + "port-version": 1 }, "libxmlmm": { "baseline": "0.6.0", @@ -5682,7 +5682,7 @@ }, "libxslt": { "baseline": "1.1.43", - "port-version": 0 + "port-version": 1 }, "libxt": { "baseline": "1.3.0", @@ -7602,7 +7602,7 @@ }, "python3": { "baseline": "3.12.9", - "port-version": 1 + "port-version": 2 }, "qca": { "baseline": "2.3.7", @@ -7686,7 +7686,7 @@ }, "qt5-base": { "baseline": "5.15.16", - "port-version": 4 + "port-version": 5 }, "qt5-canvas3d": { "baseline": "0", @@ -9022,7 +9022,7 @@ }, "sqlite3": { "baseline": "3.49.2", - "port-version": 0 + "port-version": 1 }, "sqlitecpp": { "baseline": "3.3.3", @@ -10330,7 +10330,7 @@ }, "xmlsec": { "baseline": "1.3.7", - "port-version": 0 + "port-version": 1 }, "xnnpack": { "baseline": "2022-12-22", diff --git a/versions/g-/gdal.json b/versions/g-/gdal.json index 97f47a3148..586f3bd1c4 100644 --- a/versions/g-/gdal.json +++ b/versions/g-/gdal.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0d5474e6f6ec1b82f59b666cd647a021f57f2993", + "version-semver": "3.11.0", + "port-version": 1 + }, { "git-tree": "62ae339ed1368212cb46f225c975ee4f021bd77c", "version-semver": "3.11.0", diff --git a/versions/i-/icu.json b/versions/i-/icu.json index bdf47825ab..783607d190 100644 --- a/versions/i-/icu.json +++ b/versions/i-/icu.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "ebd75351b43b485143b74a866381afafcd28b77b", + "version": "74.2", + "port-version": 6 + }, { "git-tree": "91b03be43850140e64dba01dcadc8b3f73b1083b", "version": "74.2", diff --git a/versions/l-/libxml2.json b/versions/l-/libxml2.json index 17b0e90c0f..8bdfcb2a83 100644 --- a/versions/l-/libxml2.json +++ b/versions/l-/libxml2.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "4de3f2b200fc0d79cbedf567cbbef9c422d2f79b", + "version": "2.13.8", + "port-version": 1 + }, { "git-tree": "0ebad5d8133267fdd690fbc9b8c1e99f5e9f6c37", "version": "2.13.8", diff --git a/versions/l-/libxslt.json b/versions/l-/libxslt.json index d4be696d95..a32d03c427 100644 --- a/versions/l-/libxslt.json +++ b/versions/l-/libxslt.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "e1f6fcb93d8c22da682e05de3b458ce33679976e", + "version": "1.1.43", + "port-version": 1 + }, { "git-tree": "eb1445468e9d858f0ff63cc777b48e98c4d10a72", "version": "1.1.43", diff --git a/versions/p-/python3.json b/versions/p-/python3.json index 084b438871..a5644eac99 100644 --- a/versions/p-/python3.json +++ b/versions/p-/python3.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "a3b407ec8bd78695a9926066730dc34304c6b7d8", + "version": "3.12.9", + "port-version": 2 + }, { "git-tree": "9354493937233b8f526b017e66fa6e29bbb176fb", "version": "3.12.9", diff --git a/versions/q-/qt5-base.json b/versions/q-/qt5-base.json index 1465f84193..4d84bc261a 100644 --- a/versions/q-/qt5-base.json +++ b/versions/q-/qt5-base.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "73ae35018b097dabc064a6c7683af16d006f18f5", + "version": "5.15.16", + "port-version": 5 + }, { "git-tree": "62edebec93307f1a16a04dac081974df32bdc337", "version": "5.15.16", diff --git a/versions/s-/sqlite3.json b/versions/s-/sqlite3.json index a1491225d0..7593c7766c 100644 --- a/versions/s-/sqlite3.json +++ b/versions/s-/sqlite3.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "22b45fe8ab97ecc1a87fa815f18b96455beea331", + "version": "3.49.2", + "port-version": 1 + }, { "git-tree": "a337f5fe100f83026072765ea63a8776f984f6fd", "version": "3.49.2", diff --git a/versions/x-/xmlsec.json b/versions/x-/xmlsec.json index 1549c2cf8d..b6ced3d052 100644 --- a/versions/x-/xmlsec.json +++ b/versions/x-/xmlsec.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "578ff1829c8219632473d3b587e419a3d4d5e21c", + "version": "1.3.7", + "port-version": 1 + }, { "git-tree": "981d2bea8296b17959768d20e8842643870b4cb6", "version": "1.3.7",