diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/xlnt | |
Diffstat (limited to 'vcpkg/ports/xlnt')
| -rw-r--r-- | vcpkg/ports/xlnt/fix-configure-dependencies.patch | 34 | ||||
| -rw-r--r-- | vcpkg/ports/xlnt/fix-not-found-include.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/xlnt/portfile.cmake | 47 | ||||
| -rw-r--r-- | vcpkg/ports/xlnt/usage | 9 | ||||
| -rw-r--r-- | vcpkg/ports/xlnt/vcpkg.json | 21 |
5 files changed, 123 insertions, 0 deletions
diff --git a/vcpkg/ports/xlnt/fix-configure-dependencies.patch b/vcpkg/ports/xlnt/fix-configure-dependencies.patch new file mode 100644 index 0000000..8a01ddc --- /dev/null +++ b/vcpkg/ports/xlnt/fix-configure-dependencies.patch @@ -0,0 +1,34 @@ +diff --git a/cmake/XlntConfig.cmake.in b/cmake/XlntConfig.cmake.in +index 2100b91b..c3a1f1d8 100644 +--- a/cmake/XlntConfig.cmake.in ++++ b/cmake/XlntConfig.cmake.in +@@ -11,3 +11,8 @@ check_required_components(xlnt) + if(NOT TARGET xlnt::xlnt) + include("${XLNT_CMAKE_DIR}/XlntTargets.cmake") + endif() ++ ++include(CMakeFindDependencyMacro) ++find_dependency(FastFloat CONFIG) ++find_dependency(fmt CONFIG) ++find_dependency(utf8cpp CONFIG) +diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt +index 752fb3fb..3362deb3 100644 +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -182,6 +182,16 @@ else() + target_compile_definitions(xlnt PUBLIC XLNT_STATIC=1) + endif() + ++# configure dependencies (outside vcpkg they are included as git submodules) ++find_package(FastFloat CONFIG REQUIRED) ++target_link_libraries(xlnt PRIVATE FastFloat::fast_float) ++ ++find_package(fmt CONFIG REQUIRED) ++target_link_libraries(xlnt PRIVATE fmt::fmt-header-only) ++ ++find_package(utf8cpp CONFIG REQUIRED) ++target_link_libraries(xlnt PRIVATE utf8cpp::utf8cpp) ++ + # hide all symbols by default + set_target_properties(xlnt PROPERTIES CXX_VISIBILITY_PRESET hidden) + diff --git a/vcpkg/ports/xlnt/fix-not-found-include.patch b/vcpkg/ports/xlnt/fix-not-found-include.patch new file mode 100644 index 0000000..a3068b1 --- /dev/null +++ b/vcpkg/ports/xlnt/fix-not-found-include.patch @@ -0,0 +1,12 @@ +diff --git a/cmake/XlntConfig.cmake.in b/cmake/XlntConfig.cmake.in +index 01fe4981..9cefa6e0 100644 +--- a/cmake/XlntConfig.cmake.in ++++ b/cmake/XlntConfig.cmake.in +@@ -7,7 +7,6 @@ + get_filename_component(XLNT_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + +-set_and_check(XLNT_INCLUDE_DIR "@XLNT_INCLUDE_INSTALL_DIR@") + + check_required_components(xlnt) + + if(NOT TARGET xlnt::xlnt) diff --git a/vcpkg/ports/xlnt/portfile.cmake b/vcpkg/ports/xlnt/portfile.cmake new file mode 100644 index 0000000..b912d3a --- /dev/null +++ b/vcpkg/ports/xlnt/portfile.cmake @@ -0,0 +1,47 @@ +# Download the xlnt source code +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO xlnt-community/xlnt + REF "v${VERSION}" + SHA512 2d016416447b56c3902fc86c0441fd1d10cb86c3a542a2a38929e32f8f55470c33e4a3938f9c47b1a672ac4d6784a981c4738a61fd076622a2baa64dbc632810 + HEAD_REF master + PATCHES + fix-not-found-include.patch + fix-configure-dependencies.patch +) + +# Download the libstudxml dependencies and copy it to the third-party folder as expected by xlnt (outside vcpkg libstudxml is included as a git submodule) +vcpkg_from_git( + OUT_SOURCE_PATH SOURCE_PATH_LIBSTUDXML + URL https://git.codesynthesis.com/libstudxml/libstudxml.git + FETCH_REF v1.1.0-b.10+2 + REF c8015cb75d7d3b3c499ec86b84d099c4c1ab942b + HEAD_REF master +) +file(COPY "${SOURCE_PATH_LIBSTUDXML}/" DESTINATION "${SOURCE_PATH}/third-party/libstudxml") + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(STATIC OFF) +else() + set(STATIC ON) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + DISABLE_PARALLEL_CONFIGURE + OPTIONS -DTESTS=OFF -DSAMPLES=OFF -DBENCHMARKS=OFF -DSTATIC=${STATIC} +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/xlnt) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/man") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +vcpkg_copy_pdbs() + +vcpkg_fixup_pkgconfig() diff --git a/vcpkg/ports/xlnt/usage b/vcpkg/ports/xlnt/usage new file mode 100644 index 0000000..72422a2 --- /dev/null +++ b/vcpkg/ports/xlnt/usage @@ -0,0 +1,9 @@ +xlnt provides CMake targets: + + find_package(Xlnt CONFIG REQUIRED) + target_link_libraries(main PRIVATE xlnt::xlnt) + +xlnt provides pkg-config modules: + + # cross-platform user-friendly xlsx library for C++11 + xlnt diff --git a/vcpkg/ports/xlnt/vcpkg.json b/vcpkg/ports/xlnt/vcpkg.json new file mode 100644 index 0000000..7e28393 --- /dev/null +++ b/vcpkg/ports/xlnt/vcpkg.json @@ -0,0 +1,21 @@ +{ + "name": "xlnt", + "version": "1.6.1", + "description": "Cross-platform user-friendly xlsx (Microsoft Excel®) library for C++11 (and above)", + "homepage": "https://github.com/xlnt-community/xlnt", + "documentation": "https://xlnt-community.gitbook.io/xlnt", + "license": "MIT AND BSD-3-Clause AND BSD-2-Clause", + "dependencies": [ + "fast-float", + "fmt", + "utfcpp", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |