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

[libxml2,libxslt] Revise dependency handling #24935

Merged
merged 39 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f0065d1
Update mingw support expressions
dg0yt May 26, 2022
71fc4b9
Update versions
dg0yt May 26, 2022
66c0dc5
Use pkg-config for complete libgcrypt dependencies
dg0yt May 26, 2022
a439041
Remove crypto from default features
dg0yt May 26, 2022
330081a
Drop unused liblzma dependency
dg0yt May 26, 2022
ec78f62
Update versions
dg0yt May 26, 2022
5f947f5
Skip installation of docs
dg0yt May 26, 2022
7253dcb
Update versions
dg0yt May 26, 2022
6e7741a
Restructure patches
dg0yt May 27, 2022
098eaf0
Update versions
dg0yt May 27, 2022
3e6bbab
CI [skip actions]
dg0yt May 27, 2022
251cb3f
Revise libxml2 wrapper
dg0yt May 30, 2022
731a9cf
Omit CONFIG from find_package(LibXml2)
dg0yt May 30, 2022
3a33f72
Test libxml2 with, and fix for, CMake 3.7
dg0yt May 30, 2022
5d0ebb5
Update versions
dg0yt May 30, 2022
e959af6
More libxml2 wrapper changes
dg0yt May 31, 2022
f9805ae
libxslt gcrypt variable name changes
dg0yt May 31, 2022
c9c02ca
Install usage
dg0yt May 31, 2022
13f9b52
Trim portfile
dg0yt May 31, 2022
ba8bb66
[openscap] Use vcpkg pkg-config database
dg0yt Jun 1, 2022
5dc46a4
[openscap] Unbreak find_package(Threads)
dg0yt Jun 1, 2022
5b4865b
Update versions
dg0yt Jun 1, 2022
6c157fa
Update CI baseline
dg0yt Jun 1, 2022
2885f46
REQUIRED is a literal
dg0yt Jun 2, 2022
4f7e657
Update versions
dg0yt Jun 2, 2022
9e02962
Always load libxml2 config instead of find module [skip actions]
dg0yt Jun 8, 2022
40b185c
[libxmlmm] Fix linking to libxml2
dg0yt Jun 9, 2022
d6a30bf
[libxmlmm] License field and processing
dg0yt Jun 9, 2022
37c32f1
[libxmlmm] Export unofficial CMake config
dg0yt Jun 9, 2022
4a33284
[libxmlmm] Change target prefix, not global default
dg0yt Jun 9, 2022
5f0f0f4
Revert cmake-user changes
dg0yt Jun 11, 2022
0493243
Set LIBXML2_FOUND
dg0yt Jun 11, 2022
72f74dd
Update versions
dg0yt Jun 11, 2022
7a7fb87
Merge remote-tracking branch 'origin/master'
dg0yt Jun 11, 2022
439b921
Merge remote-tracking branch 'origin/master' into HEAD
BillyONeal Jun 21, 2022
a9c47a7
Fix xslt-config
dg0yt Jun 29, 2022
dea90be
Update versions
dg0yt Jun 29, 2022
4e7b84c
Adjust tidy-html5
dg0yt Jun 29, 2022
3906fd2
Update versions
dg0yt Jun 29, 2022
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
8 changes: 5 additions & 3 deletions ports/libxml2/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ vcpkg_fixup_pkgconfig()

vcpkg_copy_pdbs()

configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)

if("tools" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES xmllint xmlcatalog AUTO_CLEAN)
endif()
Expand All @@ -91,5 +89,9 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/xml2Conf.sh" "${CURRENT_PACKAGES_DIR}/debug/lib/xml2Conf.sh")

file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(COPY
"${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake"
"${CMAKE_CURRENT_LIST_DIR}/usage"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
)
file(INSTALL "${SOURCE_PATH}/Copyright" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
2 changes: 1 addition & 1 deletion ports/libxml2/usage
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The package libxml2 is compatible with built-in CMake targets:

find_package(LibXml2 CONFIG REQUIRED)
find_package(LibXml2 REQUIRED)
target_link_libraries(main PRIVATE LibXml2::LibXml2)
52 changes: 3 additions & 49 deletions ports/libxml2/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -1,49 +1,3 @@
_find_package(${ARGS})
if(LibXml2_FOUND)
list(APPEND LIBXML2_INCLUDE_DIRS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
list(APPEND LIBXML2_INCLUDE_DIR "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") # This is wrong but downstream doesn't correctly use _DIR vs _DIRS variables
if(TARGET LibXml2::LibXml2)
target_include_directories(LibXml2::LibXml2 INTERFACE "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
endif()
endif()
if(LibXml2_FOUND AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND NOT ${ARGV0}_CONFIG)
find_package(LibLZMA)
find_package(ZLIB)
find_package(Iconv)
include(SelectLibraryConfigurations)
find_library(LIBXML2_LIBRARY_DEBUG NAMES xml2 libxml2 xml2s libxml2s xml2d libxml2d xml2sd libxml2sd NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_INSTALLED_DIR}/debug" NO_DEFAULT_PATH)
find_library(LIBXML2_LIBRARY_RELEASE NAMES xml2 libxml2 xml2s libxml2s NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH)
unset(LIBXML2_LIBRARIES)
unset(LIBXML2_LIBRARY CACHE)
select_library_configurations(LIBXML2)
list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES} ${ZLIB_LIBRARIES})
if(Iconv_LIBRARIES)
list(APPEND LIBXML2_LIBRARIES ${Iconv_LIBRARIES})
endif()
if(TARGET LibXml2::LibXml2 AND LIBXML2_LIBRARY_RELEASE)
set_target_properties(LibXml2::LibXml2 PROPERTIES IMPORTED_LOCATION_RELEASE "${LIBXML2_LIBRARY_RELEASE}")
endif()
if(TARGET LibXml2::LibXml2 AND LIBXML2_LIBRARY_DEBUG)
set_target_properties(LibXml2::LibXml2 PROPERTIES IMPORTED_LOCATION_DEBUG "${LIBXML2_LIBRARY_DEBUG}")
endif()
cmake_policy(PUSH)
cmake_policy(SET CMP0079 NEW)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND LIBXML2_LIBRARIES m)
if(TARGET LibXml2::LibXml2)
set_property(TARGET LibXml2::LibXml2 APPEND PROPERTY INTERFACE_LINK_LIBRARIES "m")
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
list(APPEND LIBXML2_LIBRARIES ws2_32)
if(TARGET LibXml2::LibXml2)
set_property(TARGET LibXml2::LibXml2 APPEND PROPERTY INTERFACE_LINK_LIBRARIES "ws2_32")
endif()
endif()
if(TARGET LibXml2::LibXml2)
set_property(TARGET LibXml2::LibXml2 APPEND PROPERTY INTERFACE_LINK_LIBRARIES "LibLZMA::LibLZMA" "ZLIB::ZLIB")
if(TARGET Iconv::Iconv)
set_property(TARGET LibXml2::LibXml2 APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Iconv::Iconv")
endif()
endif()
cmake_policy(POP)
endif()
list(REMOVE_ITEM ARGS "NO_MODULE" "CONFIG" "MODULE")
_find_package(${ARGS} CONFIG)
set(LIBXML2_FOUND "${LibXml2_FOUND}") # fphsa compatibility
1 change: 1 addition & 0 deletions ports/libxml2/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "libxml2",
"version": "2.9.14",
"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://xmlsoft.org/",
"license": "MIT",
Expand Down
15 changes: 8 additions & 7 deletions ports/libxmlmm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
cmake_minimum_required(VERSION 3.8)
project(libxmlmm CXX)

set(CMAKE_SHARED_LIBRARY_PREFIX)
set(CMAKE_STATIC_LIBRARY_PREFIX)

find_package(LibXml2 REQUIRED)

set(HEADERS_LIBXMLMM
Expand Down Expand Up @@ -38,22 +35,26 @@ set(SOURCES_LIBXMLMM
)

add_library(libxmlmm ${SOURCES_LIBXMLMM})
include_directories(${LIBXML2_INCLUDE_DIR})
target_link_libraries (libxmlmm ${LIBXML2_LIBRARIES})
target_link_libraries (libxmlmm PUBLIC LibXml2::LibXml2)

set_target_properties(libxmlmm PROPERTIES
CXX_STANDARD 17
PUBLIC_HEADER "${HEADERS_LIBXMLMM}"
PREFIX ""
)

target_include_directories(libxmlmm PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libxmlmm>
$<INSTALL_INTERFACE:include/libxmlmm>)

install(TARGETS ${PROJECT_NAME}
EXPORT litehtmlTargets
install(TARGETS libxmlmm
EXPORT unofficial-libxmlmm-targets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include/libxmlmm
)
install(EXPORT unofficial-libxmlmm-targets
NAMESPACE unofficial::libxmlmm::
DESTINATION share/unofficial-libxmlmm
)
8 changes: 6 additions & 2 deletions ports/libxmlmm/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ vcpkg_cmake_install()

vcpkg_copy_pdbs()

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/unofficial-libxmlmm-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/unofficial-libxmlmm")
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libxmlmm)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

# Handle copyright
file(INSTALL "${SOURCE_PATH}/README.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(READ "${SOURCE_PATH}/README.md" readme)
string(REGEX REPLACE "^.*## Copying\n" "" copyright "${readme}")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "${copyright}")
3 changes: 3 additions & 0 deletions ports/libxmlmm/unofficial-libxmlmm-config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include(CMakeFindDependencyMacro)
find_dependency(LibXml2)
include("${CMAKE_CURRENT_LIST_DIR}/unofficial-libxmlmm-config.cmake")
7 changes: 6 additions & 1 deletion ports/libxmlmm/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{
"name": "libxmlmm",
"version": "0.6.0",
"port-version": 2,
"port-version": 3,
"description": "Libxmlmm is a C++ wrapper for libxml 2.0 that only relies on standard C++ and libxml2.",
"homepage": "https://github.com/rioki/libxmlmm",
"license": "MIT",
"dependencies": [
"libxml2",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
50 changes: 0 additions & 50 deletions ports/libxslt/cmake.patch

This file was deleted.

45 changes: 45 additions & 0 deletions ports/libxslt/fix-gcrypt-deps.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6dc6501..d36a049 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -317,7 +317,9 @@ target_include_directories(

if(LIBXSLT_WITH_CRYPTO)
target_link_libraries(LibExslt PRIVATE Gcrypt::Gcrypt)
- set(LIBGCRYPT_LIBS "-lgcrypt")
+ # For libexslt.pc
+ set(LIBGCRYPT_LIBS "")
+ string(APPEND EXSLT_PRIVATE_REQUIRES " libgcrypt")
endif()

target_link_libraries(LibExslt PUBLIC LibXslt LibXml2::LibXml2)
diff --git a/FindGcrypt.cmake b/FindGcrypt.cmake
index 781113d..a78fa84 100644
--- a/FindGcrypt.cmake
+++ b/FindGcrypt.cmake
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
@@ -1,3 +1,20 @@
+cmake_policy(PUSH)
+cmake_policy(SET CMP0012 NEW)
+cmake_policy(SET CMP0057 NEW)
+find_package(PkgConfig)
+if("REQUIRED" IN_LIST ${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
+ pkg_check_modules(libxslt_gcrypt REQUIRED IMPORTED_TARGET libgcrypt)
+else()
+ pkg_check_modules(libxslt_gcrypt IMPORTED_TARGET libgcrypt)
+endif()
+set(Gcrypt_FOUND "${libxslt_gcrypt_FOUND}") # CMake standard, needed for find_dependency
+set(GCRYPT_FOUND "${libxslt_gcrypt_FOUND}") # libxslt usage
+if(libxslt_gcrypt_FOUND AND NOT TARGET Gcrypt::Gcrypt)
+ add_library(Gcrypt::Gcrypt INTERFACE IMPORTED)
+ set_target_properties(Gcrypt::Gcrypt PROPERTIES INTERFACE_LINK_LIBRARIES PkgConfig::libxslt_gcrypt)
+endif()
+cmake_policy(POP)
+if(0)
include(FindPackageHandleStandardArgs)
include(SelectLibraryConfigurations)

@@ -38,3 +53,4 @@ if(GCRYPT_FOUND AND NOT TARGET Gcrypt::Gcrypt)
INTERFACE_INCLUDE_DIRECTORIES "${GCRYPT_INCLUDE_DIRS}"
)
endif()
+endif()
14 changes: 14 additions & 0 deletions ports/libxslt/libexslt-pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/libexslt.pc.in b/libexslt.pc.in
index 1d60563..50089e8 100644
--- a/libexslt.pc.in
+++ b/libexslt.pc.in
@@ -7,7 +7,8 @@ includedir=@includedir@
Name: libexslt
Version: @LIBEXSLT_VERSION@
Description: EXSLT Extension library
-Requires: libxml-2.0, libxslt
+Requires: libxslt
+Requires.private: @EXSLT_PRIVATE_REQUIRES@
Cflags: @EXSLT_INCLUDEDIR@
Libs: @EXSLT_LIBDIR@ -lexslt
Libs.private: @EXSLT_PRIVATE_LIBS@
22 changes: 22 additions & 0 deletions ports/libxslt/msvc-no-suffix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8679fb..6dc6501 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -244,7 +249,7 @@ set_target_properties(
VERSION ${PROJECT_VERSION}
)

-if(MSVC)
+if(0) # Never add suffixes which are not added by the autotools build or the nmake makefiles
if(BUILD_SHARED_LIBS)
set_target_properties(
LibXslt
@@ -327,7 +332,7 @@ set_target_properties(
VERSION ${LIBEXSLT_VERSION}
)

-if(MSVC)
+if(0) # same reason as above
if(BUILD_SHARED_LIBS)
set_target_properties(
LibExslt
49 changes: 21 additions & 28 deletions ports/libxslt/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Get this value from configure.ac:21
set(LIBEXSLT_VERSION 0.8.20)
set(VERSION 1.1.35)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO GNOME/libxslt
REF v${VERSION}
REF v1.1.35
SHA512 1ab264a8d3996d74a89a22e4062950ef968b9252736e0b5f975e6f45d63a6484993fe383b85831cef0e4b9c9c90f9b2b3d5432c15ee9381dbaeb2fa681ab9b46
HEAD_REF master
PATCHES
cmake.patch
python3.patch
msvc-no-suffix.patch
libexslt-pkgconfig.patch
fix-gcrypt-deps.patch
skip-install-docs.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down Expand Up @@ -40,44 +41,36 @@ vcpkg_cmake_configure(
-DLIBXSLT_WITH_DEBUGGER:BOOL=ON
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}-${VERSION}")
file(GLOB config_path RELATIVE "${CURRENT_PACKAGES_DIR}" "${CURRENT_PACKAGES_DIR}/lib/cmake/libxslt-*")
vcpkg_cmake_config_fixup(CONFIG_PATH "${config_path}")

file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/xsltConf.sh" "${CURRENT_PACKAGES_DIR}/debug/lib/xsltConf.sh")

file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/libxslt/bin")
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/xslt-config" "${CURRENT_PACKAGES_DIR}/tools/libxslt/bin/xslt-config")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/libxslt/bin/xslt-config" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../../")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/libxslt")
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/xslt-config" "${CURRENT_PACKAGES_DIR}/tools/libxslt/xslt-config")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/libxslt/xslt-config" [[$(cd "$(dirname "$0")"; pwd -P)/..]] [[$(cd "$(dirname "$0")/../.."; pwd -P)]])
if(NOT VCPKG_BUILD_TYPE)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/libxslt/debug/bin")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/xslt-config" "${CURRENT_PACKAGES_DIR}/tools/libxslt/debug/bin/xslt-config")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/libxslt/debug/bin/xslt-config" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../../../")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/libxslt/debug")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/xslt-config" "${CURRENT_PACKAGES_DIR}/tools/libxslt/debug/xslt-config")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/libxslt/debug/xslt-config" [[$(cd "$(dirname "$0")"; pwd -P)/..]] [[$(cd "$(dirname "$0")/../../../debug"; pwd -P)]])
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/libxslt/debug/xslt-config" [[${prefix}/include]] [[${prefix}/../include]])
endif()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libxslt/xsltconfig.h" "#define LIBXSLT_DEFAULT_PLUGINS_PATH() \"${CURRENT_INSTALLED_DIR}/lib/libxslt-plugins\"" "")
vcpkg_copy_tools(TOOL_NAMES xsltproc AUTO_CLEAN)

vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()

# You have to define LIB(E)XSLT_STATIC or not, depending on how you link
file(READ "${CURRENT_PACKAGES_DIR}/include/libxslt/xsltexports.h" XSLTEXPORTS_H)
set(not_static 1)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
string(REPLACE "!defined(LIBXSLT_STATIC)" "0" XSLTEXPORTS_H "${XSLTEXPORTS_H}")
else()
string(REPLACE "!defined(LIBXSLT_STATIC)" "1" XSLTEXPORTS_H "${XSLTEXPORTS_H}")
set(not_static 0)
endif()
file(WRITE "${CURRENT_PACKAGES_DIR}/include/libxslt/xsltexports.h" "${XSLTEXPORTS_H}")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libxslt/xsltexports.h" "!defined(LIBXSLT_STATIC)" "${not_static}")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libexslt/exsltexports.h" "!defined(LIBEXSLT_STATIC)" "${not_static}")

file(READ "${CURRENT_PACKAGES_DIR}/include/libexslt/exsltexports.h" EXSLTEXPORTS_H)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
string(REPLACE "!defined(LIBEXSLT_STATIC)" "0" EXSLTEXPORTS_H "${EXSLTEXPORTS_H}")
else()
string(REPLACE "!defined(LIBEXSLT_STATIC)" "1" EXSLTEXPORTS_H "${EXSLTEXPORTS_H}")
endif()
file(WRITE "${CURRENT_PACKAGES_DIR}/include/libexslt/exsltexports.h" "${EXSLTEXPORTS_H}")

# Remove tools and debug include directories
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/libxslt")
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)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/libxslt")
16 changes: 16 additions & 0 deletions ports/libxslt/python3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8679fb..6dc6501 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,11 @@ if(LIBXSLT_WITH_PYTHON)
check_symbol_exists(F_GETFL fcntl.h HAVE_F_GETFL)
if(HAVE_UNISTD_H AND HAVE_F_GETFL)
find_package(Python COMPONENTS Interpreter Development REQUIRED)
+ elseif(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to force the first clause to fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, I just factored it out of the else clause in the original patch.

+ find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
+ add_library(Python::Python ALIAS Python3::Python)
+ set(Python_EXECUTABLE ${Python3_EXECUTABLE})
+ set(Python_SITEARCH ${Python3_SITEARCH})
else()
find_package(Python2 COMPONENTS Interpreter Development REQUIRED)
add_library(Python::Python ALIAS Python2::Python)
Loading