diff --git a/ports/xmlsec/CMakeLists.txt b/ports/xmlsec/CMakeLists.txt index cf019d51c6..cd4398ac68 100644 --- a/ports/xmlsec/CMakeLists.txt +++ b/ports/xmlsec/CMakeLists.txt @@ -114,7 +114,11 @@ install(TARGETS xmlsec1 xmlsec1-openssl ARCHIVE DESTINATION lib ) -install(EXPORT xmlsecExport FILE xmlsec-config.cmake DESTINATION share/xmlsec) +install(EXPORT xmlsecExport + FILE unofficial-xmlsec-config.cmake + NAMESPACE unofficial::xmlsec:: + DESTINATION share/unofficial-xmlsec +) if(INSTALL_HEADERS_TOOLS) file(GLOB PUBLIC_HEADERS diff --git a/ports/xmlsec/pkgconfig_fixes.patch b/ports/xmlsec/pkgconfig_fixes.patch index c923ea5976..6e5196f598 100644 --- a/ports/xmlsec/pkgconfig_fixes.patch +++ b/ports/xmlsec/pkgconfig_fixes.patch @@ -15,7 +15,7 @@ index 2d5a3ad..0f72d68 100644 @@ -7,5 +7,5 @@ Name: xmlsec1 Version: @VERSION@ Description: XML Security Library implements XML Signature and XML Encryption standards - Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ @LIBXSLT_PC_FILE_COND@ + Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ @LIBXSLT_PC_FILE_COND@ -Cflags: -DXMLSEC_CRYPTO_DYNAMIC_LOADING=1 @XMLSEC_CORE_CFLAGS@ +Cflags: @XMLSEC_CORE_CFLAGS@ - Libs: -L${libdir} @XMLSEC_CORE_LIBS@ + Libs: -L${libdir} @XMLSEC_CORE_LIBS@ diff --git a/ports/xmlsec/portfile.cmake b/ports/xmlsec/portfile.cmake index e105d409c1..a8795bde6c 100644 --- a/ports/xmlsec/portfile.cmake +++ b/ports/xmlsec/portfile.cmake @@ -1,14 +1,17 @@ +vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION} + +string(REPLACE "." "_" release_tag "xmlsec-${VERSION}") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lsh123/xmlsec - REF d823da17c80b38ccc3c4262d7b2042b07e69e266 # xmlsec-1_2_34 - SHA512 10ca5cb948723fcf1531efaab547c0665bc323cd52906decd314e0c78fff46ac7bc51eba5177838fc7f081f74f5e4a202d765c17dd0da6e378798676773a68ce + REF "${release_tag}" + SHA512 c74c0854f0afdf97651cb8ae26430a43ebb7d849b7715fdec3abcd96e61f67f0d2bac82b68b10c97dc90ee52b14ba426bbf9413f71caa7de5fa6ecb945cba0d1 HEAD_REF master PATCHES pkgconfig_fixes.patch ) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" @@ -16,9 +19,12 @@ vcpkg_cmake_configure( ) vcpkg_cmake_install() -vcpkg_cmake_config_fixup() +vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-xmlsec) vcpkg_fixup_pkgconfig() - -file(INSTALL "${SOURCE_PATH}/Copyright" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) - vcpkg_copy_pdbs() + +# unofficial legacy usage +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/xmlsec-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +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) diff --git a/ports/xmlsec/usage b/ports/xmlsec/usage new file mode 100644 index 0000000000..2192f4ae76 --- /dev/null +++ b/ports/xmlsec/usage @@ -0,0 +1,17 @@ +xmlsec can be imported via CMake FindPkgConfig module: + + find_package(PkgConfig) + # For dynamic loading of xmlsec crypto library + pkg_check_modules(XMLSEC1 REQUIRED IMPORTED_TARGET xmlsec1) + target_link_libraries(main PRIVATE PkgConfig::XMLSEC1) + # For selecting the openssl crypto engine at link time + pkg_check_modules(XMLSEC1_OPENSSL REQUIRED IMPORTED_TARGET xmlsec1-openssl) + target_link_libraries(main PRIVATE PkgConfig::XMLSEC1_OPENSSL) + +vcpkg provides proprietary CMake targets: + + find_package(unofficial-xmlsec CONFIG REQUIRED) + # For dynamic loading of xmlsec crypto library + target_link_libraries(main PRIVATE unofficial::xmlsec::xmlsec1) + # For selecting the openssl crypto engine at link time + target_link_libraries(main PRIVATE unofficial::xmlsec::xmlsec1-openssl) diff --git a/ports/xmlsec/vcpkg.json b/ports/xmlsec/vcpkg.json index c09ebc45e8..39bbc5844e 100644 --- a/ports/xmlsec/vcpkg.json +++ b/ports/xmlsec/vcpkg.json @@ -1,8 +1,9 @@ { "name": "xmlsec", - "version": "1.2.34", + "version": "1.2.36", "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", "dependencies": [ "libxml2", "openssl", diff --git a/ports/xmlsec/xmlsec-config.cmake b/ports/xmlsec/xmlsec-config.cmake new file mode 100644 index 0000000000..d93c36aed1 --- /dev/null +++ b/ports/xmlsec/xmlsec-config.cmake @@ -0,0 +1,6 @@ +file(READ "${CMAKE_CURRENT_LIST_DIR}/usage" usage) +message(WARNING "find_package(xmlsec) is deprecated.\n${usage}") +include(CMakeFindDependencyMacro) +find_dependency(unofficial-xmlsec CONFIG REQUIRED) +add_library(xmlsec1 ALIAS unofficial::xmlsec::xmlsec1) +add_library(xmlsec1-openssl ALIAS unofficial::xmlsec::xmlsec1-openssl) diff --git a/versions/baseline.json b/versions/baseline.json index ce9968955f..6fdb6ef71d 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -8089,7 +8089,7 @@ "port-version": 1 }, "xmlsec": { - "baseline": "1.2.34", + "baseline": "1.2.36", "port-version": 0 }, "xnnpack": { diff --git a/versions/x-/xmlsec.json b/versions/x-/xmlsec.json index f9b1032eb0..cf6edc82ae 100644 --- a/versions/x-/xmlsec.json +++ b/versions/x-/xmlsec.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "3b3111c9880e6e3737f334dc37432a121a3220ef", + "version": "1.2.36", + "port-version": 0 + }, { "git-tree": "a41c14aae637b02b4e018902e0f9b67bcdef12f2", "version": "1.2.34",