Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xerces-c] Fix dependencies #32259

Merged
merged 6 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ports/libe57/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "libe57",
"version-semver": "1.1.332",
"port-version": 3,
"port-version": 4,
"description": "An open source implementation of the ASTM E2807 Standard Specification for 3D Imaging Data Exchange in the C++ language.",
"homepage": "http://www.libe57.org/",
"license": "BSL-1.0",
"supports": "!android",
"dependencies": [
"boost-crc",
"boost-filesystem",
Expand Down
65 changes: 63 additions & 2 deletions ports/xerces-c/dependencies.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,77 @@
diff --git a/cmake/XercesNetAccessorSelection.cmake b/cmake/XercesNetAccessorSelection.cmake
index 7a63f1f..22ea65b 100644
--- a/cmake/XercesNetAccessorSelection.cmake
+++ b/cmake/XercesNetAccessorSelection.cmake
@@ -23,7 +23,7 @@ option(network "Network support" ON)

if(network)
find_library(SOCKET_LIBRARY socket)
- find_library(NSL_LIBRARY nsl)
+ set(NSL_LIBRARY "" CACHE INTERNAL "Not used")

# netaccessors in order of preference

diff --git a/cmake/XercesTranscoderSelection.cmake b/cmake/XercesTranscoderSelection.cmake
index 4ff5b16..48e274c 100644
--- a/cmake/XercesTranscoderSelection.cmake
+++ b/cmake/XercesTranscoderSelection.cmake
@@ -25,6 +25,7 @@

if(ICU_FOUND)
list(APPEND transcoders icu)
+ set(TRANSCODER_REQUIRES "icu-uc")
endif()

# MacOS
@@ -41,6 +42,20 @@ endif()

# GNU iconv

+if(NOT transcoder AND NOT transcoders AND NOT WIN32)
+ find_package(Iconv)
+ set(FIND_DEPENDENCY_ICONV "${Iconv_FOUND}")
+ if(Iconv_FOUND AND NOT Iconv_IS_BUILT_IN)
+ list(APPEND libxerces_c_DEPS Iconv::Iconv)
+ set(TRANSCODER_LIBS "-liconv -lcharset")
+ list(APPEND CMAKE_REQUIRED_LIBRARIES Iconv::Iconv)
+ include(CheckSymbolExists)
+ check_symbol_exists(iconv_open "iconv.h" HAVE_ICONV_OPEN)
+ check_symbol_exists(iconv_close "iconv.h" HAVE_ICONV_CLOSE)
+ check_symbol_exists(iconv "iconv.h" HAVE_ICONV)
+ endif()
+endif()
+
check_include_file_cxx(iconv.h HAVE_ICONV_H)
check_include_file_cxx(wchar.h HAVE_WCHAR_H)
check_include_file_cxx(string.h HAVE_STRING_H)
diff --git a/src/XercesCConfig.cmake.in b/src/XercesCConfig.cmake.in
index aa8fc2e..07ec56d 100644
index aa8fc2e..754c425 100644
--- a/src/XercesCConfig.cmake.in
+++ b/src/XercesCConfig.cmake.in
@@ -1,5 +1,11 @@
@@ -1,5 +1,14 @@
@PACKAGE_INIT@

+include(CMakeFindDependencyMacro)
+find_dependency(Threads)
+if("@CMAKE_REQUIRE_FIND_PACKAGE_ICU@")
+ find_dependency(ICU COMPONENTS uc data)
+endif()
+if("@FIND_DEPENDENCY_ICONV@")
+ find_dependency(Iconv)
+endif()
+
include(${CMAKE_CURRENT_LIST_DIR}/XercesCConfigInternal.cmake)

add_library(XercesC::XercesC INTERFACE IMPORTED)
diff --git a/xerces-c.pc.in b/xerces-c.pc.in
index 16b18c7..077296b 100644
--- a/xerces-c.pc.in
+++ b/xerces-c.pc.in
@@ -7,5 +7,6 @@ Name: Xerces-C++
Description: Validating XML parser library for C++
Version: @VERSION@
Libs: -L${libdir} -lxerces-c
-Libs.private: @CURL_LIBS@
+Libs.private: @CURL_LIBS@ @TRANSCODER_LIBS@
+Requires.private: @TRANSCODER_REQUIRES@
Cflags: -I${includedir}
3 changes: 3 additions & 0 deletions ports/xerces-c/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ vcpkg_check_features(
OUT_FEATURE_OPTIONS options
FEATURES
icu CMAKE_REQUIRE_FIND_PACKAGE_ICU
network network
INVERTED_FEATURES
icu CMAKE_DISABLE_FIND_PACKAGE_ICU
)
Expand Down Expand Up @@ -47,6 +48,8 @@ vcpkg_cmake_configure(
-DDISABLE_SAMPLES=ON
-DCMAKE_DISABLE_FIND_PACKAGE_CURL=ON
${options}
MAYBE_UNUSED_VARIABLES
CMAKE_DISABLE_FIND_PACKAGE_CURL
)

vcpkg_cmake_install()
Expand Down
9 changes: 8 additions & 1 deletion ports/xerces-c/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "xerces-c",
"version": "3.2.4",
"port-version": 2,
"port-version": 3,
"description": "Xerces-C++ is a XML parser, for parsing, generating, manipulating, and validating XML documents using the DOM, SAX, and SAX2 APIs.",
"homepage": "https://github.com/apache/xerces-c",
"license": "Apache-2.0",
"supports": "!uwp",
"dependencies": [
{
"name": "libiconv",
Expand All @@ -19,13 +20,19 @@
"host": true
}
],
"default-features": [
"network"
],
"features": {
"icu": {
"description": "ICU support",
"dependencies": [
"icu"
]
},
"network": {
"description": "Network support"
},
"xmlch-wchar": {
"description": "XMLCh type uses wchar_t"
}
Expand Down
5 changes: 0 additions & 5 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1699,11 +1699,6 @@ xbitmaps:arm-neon-android=fail
xbitmaps:arm64-android=fail
xbitmaps:x64-android=fail
xbitmaps:x64-osx=skip
xerces-c:arm-neon-android=fail
xerces-c:arm-uwp=fail
xerces-c:arm64-android=fail
xerces-c:x64-android=fail
xerces-c:x64-uwp=fail
xmlsec:arm-uwp=fail
xmlsec:x64-uwp=fail
yara:arm-uwp=fail
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4002,7 +4002,7 @@
},
"libe57": {
"baseline": "1.1.332",
"port-version": 3
"port-version": 4
},
"libe57format": {
"baseline": "3.0.0",
Expand Down Expand Up @@ -8786,7 +8786,7 @@
},
"xerces-c": {
"baseline": "3.2.4",
"port-version": 2
"port-version": 3
},
"xeus": {
"baseline": "0.24.3",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libe57.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "d5a7a88a7e28608ff30f48533cec32ac07f6f7c2",
"version-semver": "1.1.332",
"port-version": 4
},
{
"git-tree": "ecdcbb16ecd99e8d8a25b7dde4b2b1f040c5c3ed",
"version-semver": "1.1.332",
Expand Down
5 changes: 5 additions & 0 deletions versions/x-/xerces-c.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4026f062e68881d5a72ecd5d900c70a46f92a8d9",
"version": "3.2.4",
"port-version": 3
},
{
"git-tree": "2eabf69ed6317e6b9b9fbb7cdb19e884a762f545",
"version": "3.2.4",
Expand Down