aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libxslt
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libxslt
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/libxslt')
-rw-r--r--vcpkg/ports/libxslt/cxx-for-libxml2-icu.diff13
-rw-r--r--vcpkg/ports/libxslt/fix-gcrypt-deps.patch45
-rw-r--r--vcpkg/ports/libxslt/libexslt-pkgconfig.patch14
-rw-r--r--vcpkg/ports/libxslt/msvc-no-suffix.patch22
-rw-r--r--vcpkg/ports/libxslt/portfile.cmake92
-rw-r--r--vcpkg/ports/libxslt/python3.patch16
-rw-r--r--vcpkg/ports/libxslt/skip-install-docs.patch19
-rw-r--r--vcpkg/ports/libxslt/usage12
-rw-r--r--vcpkg/ports/libxslt/vcpkg-cmake-wrapper.cmake5
-rw-r--r--vcpkg/ports/libxslt/vcpkg.json63
10 files changed, 301 insertions, 0 deletions
diff --git a/vcpkg/ports/libxslt/cxx-for-libxml2-icu.diff b/vcpkg/ports/libxslt/cxx-for-libxml2-icu.diff
new file mode 100644
index 0000000..c901174
--- /dev/null
+++ b/vcpkg/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/vcpkg/ports/libxslt/fix-gcrypt-deps.patch b/vcpkg/ports/libxslt/fix-gcrypt-deps.patch
new file mode 100644
index 0000000..fc5b07c
--- /dev/null
+++ b/vcpkg/ports/libxslt/fix-gcrypt-deps.patch
@@ -0,0 +1,45 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fb352475..4113fbff 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -319,7 +319,9 @@ target_include_directories(
+
+ if(LIBXSLT_WITH_CRYPTO AND NOT WIN32)
+ target_link_libraries(LibExslt PRIVATE Gcrypt::Gcrypt)
+- set(LIBGCRYPT_LIBS "-lgcrypt")
++ # For libexslt.pc
++ set(LIBGCRYPT_LIBS "")
++ string(APPEND EXSLT_PRIVATE_REQUIRES " libgcrypt")
+ endif()
+
+ if(UNIX)
+diff --git a/FindGcrypt.cmake b/FindGcrypt.cmake
+index 781113d5..6f680beb 100644
+--- a/FindGcrypt.cmake
++++ b/FindGcrypt.cmake
+@@ -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 +55,4 @@ if(GCRYPT_FOUND AND NOT TARGET Gcrypt::Gcrypt)
+ INTERFACE_INCLUDE_DIRECTORIES "${GCRYPT_INCLUDE_DIRS}"
+ )
+ endif()
++endif()
diff --git a/vcpkg/ports/libxslt/libexslt-pkgconfig.patch b/vcpkg/ports/libxslt/libexslt-pkgconfig.patch
new file mode 100644
index 0000000..be4933f
--- /dev/null
+++ b/vcpkg/ports/libxslt/libexslt-pkgconfig.patch
@@ -0,0 +1,14 @@
+diff --git a/libexslt.pc.in b/libexslt.pc.in
+index f448bb83..791bcdda 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@ @LIBEXSLT_CFLAGS@
+ Libs: @EXSLT_LIBDIR@ -lexslt
+ Libs.private: @EXSLT_PRIVATE_LIBS@
diff --git a/vcpkg/ports/libxslt/msvc-no-suffix.patch b/vcpkg/ports/libxslt/msvc-no-suffix.patch
new file mode 100644
index 0000000..421e933
--- /dev/null
+++ b/vcpkg/ports/libxslt/msvc-no-suffix.patch
@@ -0,0 +1,22 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fb352475..a4bb094e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -247,7 +247,7 @@ set_target_properties(
+ SOVERSION ${LIBXSLT_MAJOR_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
+@@ -340,7 +340,7 @@ set_target_properties(
+ SOVERSION ${LIBEXSLT_MAJOR_VERSION}
+ )
+
+-if(MSVC)
++if(0) # same reason as above
+ if(BUILD_SHARED_LIBS)
+ set_target_properties(
+ LibExslt
diff --git a/vcpkg/ports/libxslt/portfile.cmake b/vcpkg/ports/libxslt/portfile.cmake
new file mode 100644
index 0000000..8636922
--- /dev/null
+++ b/vcpkg/ports/libxslt/portfile.cmake
@@ -0,0 +1,92 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO GNOME/libxslt
+ REF "v${VERSION}"
+ SHA512 51d9e9586f78c5aa69ac67fac64b865625fefb16bf06f1f06dede0a57b3e382e78dea69145c7c0c59f06735b738bed209751e691dd9045c3cc33df096963f89d
+ HEAD_REF master
+ PATCHES
+ cxx-for-libxml2-icu.diff
+ 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
+ FEATURES
+ "python" LIBXSLT_WITH_PYTHON
+ "crypto" LIBXSLT_WITH_CRYPTO
+ "plugins" LIBXSLT_WITH_MODULES
+ "profiler" LIBXSLT_WITH_PROFILER
+ "thread" LIBXSLT_WITH_THREADS
+ "tools" LIBXSLT_WITH_PROGRAMS
+)
+if("python" IN_LIST FEATURES)
+ 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()
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DLIBXSLT_WITH_TESTS:BOOL=OFF
+ OPTIONS_RELEASE
+ ${FEATURE_OPTIONS_RELEASE}
+ -DLIBXSLT_WITH_XSLT_DEBUG:BOOL=OFF
+ -DLIBXSLT_WITH_DEBUGGER:BOOL=OFF
+ OPTIONS_DEBUG
+ ${FEATURE_OPTIONS_DEBUG}
+ -DLIBXSLT_WITH_XSLT_DEBUG:BOOL=ON
+ -DLIBXSLT_WITH_DEBUGGER:BOOL=ON
+ )
+vcpkg_cmake_install()
+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")
+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")
+ 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\"" "" IGNORE_UNCHANGED)
+if("tools" IN_LIST FEATURES)
+ vcpkg_copy_tools(TOOL_NAMES xsltproc AUTO_CLEAN)
+endif()
+
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_pdbs()
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libxslt/xsltexports.h" "ifdef LIBXSLT_STATIC" "if 1")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libexslt/exsltexports.h" "ifdef LIBEXSLT_STATIC" "if 1")
+endif()
+
+if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libxslt.pc" " -lxslt" " -llibxslt")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libexslt.pc" " -lexslt" " -llibexslt")
+ if(NOT VCPKG_BUILD_TYPE)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libxslt.pc" " -lxslt" " -llibxslt")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libexslt.pc" " -lexslt" " -llibexslt")
+ endif()
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
+endif()
+
+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}")
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/Copyright")
diff --git a/vcpkg/ports/libxslt/python3.patch b/vcpkg/ports/libxslt/python3.patch
new file mode 100644
index 0000000..bca1d1d
--- /dev/null
+++ b/vcpkg/ports/libxslt/python3.patch
@@ -0,0 +1,16 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fb352475..75bd44a5 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -63,6 +63,11 @@ if(LIBXSLT_WITH_PYTHON)
+ check_symbol_exists(F_GETFL fcntl.h HAVE_F_GETFL)
+ if(WIN32 OR (HAVE_UNISTD_H AND HAVE_F_GETFL))
+ find_package(Python COMPONENTS Interpreter Development REQUIRED)
++ elseif(1)
++ 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)
diff --git a/vcpkg/ports/libxslt/skip-install-docs.patch b/vcpkg/ports/libxslt/skip-install-docs.patch
new file mode 100644
index 0000000..5d11ea8
--- /dev/null
+++ b/vcpkg/ports/libxslt/skip-install-docs.patch
@@ -0,0 +1,19 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fb352475..23fe90f6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -474,12 +474,14 @@ if(LIBXSLT_WITH_PYTHON)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxslt.py DESTINATION ${LIBXSLT_PYTHON_INSTALL_DIR} COMPONENT runtime)
+ endif()
+
++if(VCPKG_INSTALL_DOCS)
+ install(FILES libexslt/libexslt.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 COMPONENT documentation)
+ install(FILES libxslt/libxslt.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 COMPONENT documentation)
+ if(LIBXSLT_WITH_PROGRAMS)
+ install(FILES doc/xsltproc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
+ endif()
+ install(DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libxslt COMPONENT documentation PATTERN Makefile.* EXCLUDE)
++endif()
+
+ if(LIBXSLT_WITH_CRYPTO AND NOT WIN32)
+ install(FILES FindGcrypt.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION} COMPONENT development)
diff --git a/vcpkg/ports/libxslt/usage b/vcpkg/ports/libxslt/usage
new file mode 100644
index 0000000..91daf34
--- /dev/null
+++ b/vcpkg/ports/libxslt/usage
@@ -0,0 +1,12 @@
+The package libxslt is compatible with built-in CMake targets:
+
+ # xslt library
+ find_package(LibXslt REQUIRED)
+ target_link_libraries(main PRIVATE LibXslt::LibXslt)
+
+ # exslt library
+ find_package(LibXslt REQUIRED)
+ target_link_libraries(main PRIVATE LibXslt::LibExslt)
+
+In order to use modules, you must set environment variable LIBXSLT_PLUGINS_PATH
+at runtime.
diff --git a/vcpkg/ports/libxslt/vcpkg-cmake-wrapper.cmake b/vcpkg/ports/libxslt/vcpkg-cmake-wrapper.cmake
new file mode 100644
index 0000000..b7e5ecd
--- /dev/null
+++ b/vcpkg/ports/libxslt/vcpkg-cmake-wrapper.cmake
@@ -0,0 +1,5 @@
+list(REMOVE_ITEM ARGS "NO_MODULE")
+list(REMOVE_ITEM ARGS "CONFIG")
+list(REMOVE_ITEM ARGS "MODULE")
+
+_find_package(${ARGS} CONFIG)
diff --git a/vcpkg/ports/libxslt/vcpkg.json b/vcpkg/ports/libxslt/vcpkg.json
new file mode 100644
index 0000000..a867417
--- /dev/null
+++ b/vcpkg/ports/libxslt/vcpkg.json
@@ -0,0 +1,63 @@
+{
+ "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,
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "libxml2",
+ "default-features": false
+ },
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "default-features": [
+ "profiler",
+ "thread"
+ ],
+ "features": {
+ "crypto": {
+ "description": "Build with crypto support",
+ "supports": "!windows",
+ "dependencies": [
+ "libgcrypt"
+ ]
+ },
+ "plugins": {
+ "description": "(deprecated)",
+ "supports": "!static"
+ },
+ "profiler": {
+ "description": "Build with profiling support"
+ },
+ "python": {
+ "description": "Builds with python support",
+ "supports": "!windows",
+ "dependencies": [
+ {
+ "name": "libxslt",
+ "default-features": false,
+ "features": [
+ "profiler"
+ ]
+ },
+ "python3"
+ ]
+ },
+ "thread": {
+ "description": "Enable multi-threading support"
+ },
+ "tools": {
+ "description": "Build the utilities"
+ }
+ }
+}