aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDawid Wróbel <me@dawidwrobel.com>2021-05-25 16:34:00 -0400
committerGitHub <noreply@github.com>2021-05-25 13:34:00 -0700
commita47809ed9e83af1cf31cc59da76def9fe826e83e (patch)
treef229fe5c7943e9471f0217d351ce67a602d75bc2
parent7c55ecac266fc3e554bc315053dc45c11ec811af (diff)
downloadvcpkg-a47809ed9e83af1cf31cc59da76def9fe826e83e.tar.gz
vcpkg-a47809ed9e83af1cf31cc59da76def9fe826e83e.zip
[xmlsec] add pkgconfig files (#16908)
* [xmlsec] add pkgconfig files - also fixes the library filename, which is actually libxmlsec1. This follows the upstream naming scheme. * [xmlsec] convert CONTROL to manifest * [xmlsec] update versions * [xmlsec] update library name * [xmlsec] update versions
-rw-r--r--ports/xmlsec/CMakeLists.txt57
-rw-r--r--ports/xmlsec/CONTROL5
-rw-r--r--ports/xmlsec/pkgconfig_fixes.patch21
-rw-r--r--ports/xmlsec/portfile.cmake2
-rw-r--r--ports/xmlsec/vcpkg.json11
-rw-r--r--versions/baseline.json2
-rw-r--r--versions/x-/xmlsec.json5
7 files changed, 78 insertions, 25 deletions
diff --git a/ports/xmlsec/CMakeLists.txt b/ports/xmlsec/CMakeLists.txt
index 54f044751..8ecb7bb65 100644
--- a/ports/xmlsec/CMakeLists.txt
+++ b/ports/xmlsec/CMakeLists.txt
@@ -1,11 +1,8 @@
cmake_minimum_required (VERSION 3.8)
-project (xmlsec C)
+project (xmlsec1 C)
option(INSTALL_HEADERS_TOOLS "Install public header files and tools" ON)
-set(CMAKE_SHARED_LIBRARY_PREFIX)
-set(CMAKE_STATIC_LIBRARY_PREFIX)
-
find_package(LibXml2 REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Iconv REQUIRED)
@@ -58,20 +55,20 @@ if(MSVC)
add_compile_options(/wd4130 /wd4127 /wd4152)
endif()
-add_library(libxmlsec ${SOURCESXMLSEC})
-add_library(libxmlsec-openssl ${SOURCESXMLSECOPENSSL})
+add_library(xmlsec1 ${SOURCESXMLSEC})
+add_library(xmlsec1-openssl ${SOURCESXMLSECOPENSSL})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include include ${LIBXML2_INCLUDE_DIRS})
-target_link_libraries(libxmlsec PRIVATE
+target_link_libraries(xmlsec1 PRIVATE
${LIBXML2_LIBRARIES} OpenSSL::SSL
)
-target_link_libraries(libxmlsec-openssl PRIVATE
- ${LIBXML2_LIBRARIES} OpenSSL::SSL libxmlsec
+target_link_libraries(xmlsec1-openssl PRIVATE
+ ${LIBXML2_LIBRARIES} OpenSSL::SSL xmlsec1
)
add_compile_definitions(inline=__inline)
-add_compile_definitions(PACKAGE="xmlsec")
+add_compile_definitions(PACKAGE="xmlsec1")
add_compile_definitions(XMLSEC_MSCRYPTO_NT4=1)
add_compile_definitions(HAVE_STDIO_H)
add_compile_definitions(HAVE_STDLIB_H)
@@ -89,22 +86,25 @@ add_compile_definitions(_UNICODE)
add_compile_definitions(_MBCS)
add_compile_definitions(_REENTRANT)
-target_compile_definitions(libxmlsec-openssl PRIVATE
+target_compile_definitions(xmlsec1-openssl PRIVATE
-DXMLSEC_CRYPTO_OPENSSL
)
-set_target_properties(libxmlsec PROPERTIES VERSION ${XMLSEC_VERSION_MAJOR}.${XMLSEC_VERSION_MINOR})
-set_target_properties(libxmlsec-openssl PROPERTIES VERSION ${XMLSEC_VERSION_MAJOR}.${XMLSEC_VERSION_MINOR})
+set_target_properties(xmlsec1 PROPERTIES VERSION ${XMLSEC_VERSION_MAJOR}.${XMLSEC_VERSION_MINOR})
+set_target_properties(xmlsec1-openssl PROPERTIES VERSION ${XMLSEC_VERSION_MAJOR}.${XMLSEC_VERSION_MINOR})
if(NOT BUILD_SHARED_LIBS)
- target_compile_definitions(libxmlsec PRIVATE -DLIBXML_STATIC -DLIBXSLT_STATIC -DXMLSEC_STATIC -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING)
- target_compile_definitions(libxmlsec-openssl PRIVATE -DLIBXML_STATIC -DLIBXSLT_STATIC -DXMLSEC_STATIC -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING)
+ set(XMLSEC_CORE_CFLAGS "-DLIBXML_STATIC -DLIBXSLT_STATIC -DXMLSEC_STATIC -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING")
+ set(XMLSEC_OPENSSL_CFLAGS ${XMLSEC_CORE_CFLAGS})
else()
- target_compile_definitions(libxmlsec PRIVATE -DXMLSEC_DL_WIN32)
- target_compile_definitions(libxmlsec-openssl PRIVATE -DXMLSEC_DL_WIN32)
+ set(XMLSEC_CORE_CFLAGS "-DXMLSEC_DL_WIN32")
+ set(XMLSEC_OPENSSL_CFLAGS ${XMLSEC_CORE_CFLAGS})
endif()
-install(TARGETS libxmlsec libxmlsec-openssl
+target_compile_definitions(xmlsec1 PRIVATE ${XMLSEC_CORE_CFLAGS})
+target_compile_definitions(xmlsec1-openssl PRIVATE ${XMLSEC_OPENSSL_CFLAGS})
+
+install(TARGETS xmlsec1 xmlsec1-openssl
EXPORT xmlsecExport
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
@@ -139,7 +139,7 @@ if(INSTALL_HEADERS_TOOLS)
endif()
target_link_libraries(xmlsec PRIVATE
- ${LIBXML2_LIBRARIES} OpenSSL::SSL libxmlsec libxmlsec-openssl
+ ${LIBXML2_LIBRARIES} OpenSSL::SSL xmlsec1 xmlsec1-openssl
)
if(NOT Iconv_IS_BUILT_IN)
target_link_libraries(xmlsec PRIVATE Iconv::Iconv)
@@ -158,3 +158,22 @@ if(INSTALL_HEADERS_TOOLS)
endif()
install(TARGETS xmlsec DESTINATION tools/xmlsec)
endif()
+
+message(STATUS "Generating pkgconfig files")
+
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(exec_prefix ${prefix})
+set(libdir ${prefix}/${CMAKE_INSTALL_LIBDIR})
+set(includedir ${prefix}/${CMAKE_INSTALL_INCLUDEDIR})
+set(VERSION ${XMLSEC_VERSION})
+set(LIBXML_MIN_VERSION ${LIBXML2_VERSION_STRING})
+set(OPENSSL_LIBS "-lssl -lcrypto")
+set(XMLSEC_CORE_CFLAGS "${XMLSEC_CORE_CFLAGS} -DXMLSEC_DL_LIBLTDL=1 -I\${includedir}/xmlsec1 -DXMLSEC_CRYPTO_OPENSSL=1")
+set(XMLSEC_CORE_LIBS "-lxmlsec1 -lltdl")
+set(XMLSEC_OPENSSL_CFLAGS "${XMLSEC_OPENSSL_CFLAGS} -I\${includedir}/xmlsec1")
+set(XMLSEC_OPENSSL_LIBS "-L\${libdir} -lxmlsec1-openssl ${XMLSEC_CORE_LIBS} ${OPENSSL_LIBS}")
+
+configure_file(${PROJECT_SOURCE_DIR}/xmlsec.pc.in ${PROJECT_BINARY_DIR}/xmlsec1.pc @ONLY)
+configure_file(${PROJECT_SOURCE_DIR}/xmlsec-openssl.pc.in ${PROJECT_BINARY_DIR}/xmlsec1-openssl.pc @ONLY)
+install(FILES ${PROJECT_BINARY_DIR}/xmlsec1.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/)
+install(FILES ${PROJECT_BINARY_DIR}/xmlsec1-openssl.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/)
diff --git a/ports/xmlsec/CONTROL b/ports/xmlsec/CONTROL
deleted file mode 100644
index 095b99a17..000000000
--- a/ports/xmlsec/CONTROL
+++ /dev/null
@@ -1,5 +0,0 @@
-Source: xmlsec
-Version: 1.2.31
-Homepage: https://www.aleksey.com/xmlsec/
-Description: XML Security Library is a C library based on LibXML2. The library supports major XML security standards.
-Build-Depends: libxml2, openssl
diff --git a/ports/xmlsec/pkgconfig_fixes.patch b/ports/xmlsec/pkgconfig_fixes.patch
new file mode 100644
index 000000000..c923ea597
--- /dev/null
+++ b/ports/xmlsec/pkgconfig_fixes.patch
@@ -0,0 +1,21 @@
+diff --git a/xmlsec-openssl.pc.in b/xmlsec-openssl.pc.in
+index af3ae29..40635cf 100644
+--- a/xmlsec-openssl.pc.in
++++ b/xmlsec-openssl.pc.in
+@@ -8,5 +8,4 @@ Version: @VERSION@
+ Description: XML Security Library implements XML Signature and XML Encryption standards
+ Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ @LIBXSLT_PC_FILE_COND@
+ Cflags: @XMLSEC_OPENSSL_CFLAGS@
+-Cflags.private: -DXMLSEC_STATIC
+ Libs: @XMLSEC_OPENSSL_LIBS@
+diff --git a/xmlsec.pc.in b/xmlsec.pc.in
+index 2d5a3ad..0f72d68 100644
+--- a/xmlsec.pc.in
++++ b/xmlsec.pc.in
+@@ -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@
+-Cflags: -DXMLSEC_CRYPTO_DYNAMIC_LOADING=1 @XMLSEC_CORE_CFLAGS@
++Cflags: @XMLSEC_CORE_CFLAGS@
+ Libs: -L${libdir} @XMLSEC_CORE_LIBS@
diff --git a/ports/xmlsec/portfile.cmake b/ports/xmlsec/portfile.cmake
index a3f88a687..72a32d90c 100644
--- a/ports/xmlsec/portfile.cmake
+++ b/ports/xmlsec/portfile.cmake
@@ -6,6 +6,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
0001-uwp-fix.patch
+ pkgconfig_fixes.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
@@ -20,6 +21,7 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()
+vcpkg_fixup_pkgconfig()
file(INSTALL ${SOURCE_PATH}/Copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/ports/xmlsec/vcpkg.json b/ports/xmlsec/vcpkg.json
new file mode 100644
index 000000000..be3a5b97f
--- /dev/null
+++ b/ports/xmlsec/vcpkg.json
@@ -0,0 +1,11 @@
+{
+ "name": "xmlsec",
+ "version-string": "1.2.31",
+ "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/",
+ "dependencies": [
+ "libxml2",
+ "openssl"
+ ]
+}
diff --git a/versions/baseline.json b/versions/baseline.json
index 8ab78f030..f3162fbdc 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -6558,7 +6558,7 @@
},
"xmlsec": {
"baseline": "1.2.31",
- "port-version": 0
+ "port-version": 1
},
"xmsh": {
"baseline": "0.5.2-1",
diff --git a/versions/x-/xmlsec.json b/versions/x-/xmlsec.json
index e17cb47c2..cf67e3a34 100644
--- a/versions/x-/xmlsec.json
+++ b/versions/x-/xmlsec.json
@@ -1,6 +1,11 @@
{
"versions": [
{
+ "git-tree": "9bce4d43cc99b63c9be1b547fcede14a75a61447",
+ "version-string": "1.2.31",
+ "port-version": 1
+ },
+ {
"git-tree": "9f0df3480ea9d16e5857f7d6815ff6fb3107b05f",
"version-string": "1.2.31",
"port-version": 0