aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/podofo
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/podofo
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/podofo')
-rw-r--r--vcpkg/ports/podofo/dependencies.diff76
-rw-r--r--vcpkg/ports/podofo/portfile.cmake44
-rw-r--r--vcpkg/ports/podofo/usage9
-rw-r--r--vcpkg/ports/podofo/vcpkg.json61
4 files changed, 190 insertions, 0 deletions
diff --git a/vcpkg/ports/podofo/dependencies.diff b/vcpkg/ports/podofo/dependencies.diff
new file mode 100644
index 0000000..3c61cc8
--- /dev/null
+++ b/vcpkg/ports/podofo/dependencies.diff
@@ -0,0 +1,76 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0441083c..ff19fe8e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -246,6 +246,7 @@ if(JPEG_FOUND)
+ string(APPEND PODOFO_PKGCONFIG_REQUIRES_PRIVATE " libjpeg")
+ endif()
+ list(APPEND PODOFO_LIB_DEPENDS ZLIB::ZLIB)
++string(APPEND PODOFO_PKGCONFIG_REQUIRES_PRIVATE " libutf8proc")
+ string(APPEND PODOFO_PKGCONFIG_REQUIRES_PRIVATE " zlib")
+ list(APPEND PODOFO_LIB_DEPENDS ${PLATFORM_SYSTEM_LIBRARIES})
+
+@@ -276,6 +277,25 @@ add_subdirectory(3rdparty)
+ add_subdirectory(src/podofo)
+ include_directories(${PODOFO_INCLUDE_DIRS})
+
++find_package(date CONFIG REQUIRED)
++find_package(FastFloat CONFIG REQUIRED)
++find_package(fmt CONFIG REQUIRED)
++find_package(utf8cpp CONFIG REQUIRED)
++find_package(utf8proc CONFIG REQUIRED)
++
++target_link_libraries(podofo_private PRIVATE
++ $<COMPILE_ONLY:date::date>
++ $<COMPILE_ONLY:FastFloat::fast_float>
++ $<COMPILE_ONLY:fmt::fmt-header-only>
++ $<COMPILE_ONLY:utf8cpp::utf8cpp>
++ utf8proc::utf8proc
++)
++if(PODOFO_BUILD_STATIC)
++ target_link_libraries(podofo_static $<COMPILE_ONLY:utf8cpp::utf8cpp>)
++else()
++ target_link_libraries(podofo_shared PRIVATE $<COMPILE_ONLY:utf8cpp::utf8cpp>)
++endif()
++
+ if(PODOFO_BUILD_TEST)
+ enable_testing()
+ add_subdirectory(test)
+diff --git a/src/podofo/podofo-config.cmake.in b/src/podofo/podofo-config.cmake.in
+index 700619bb..3ab4afce 100644
+--- a/src/podofo/podofo-config.cmake.in
++++ b/src/podofo/podofo-config.cmake.in
+@@ -2,6 +2,7 @@
+
+ if("@PODOFO_BUILD_STATIC@")
+ include(CMakeFindDependencyMacro)
++ find_dependency(utf8proc CONFIG)
+ if("@Fontconfig_FOUND@")
+ find_dependency(Fontconfig)
+ endif()
+diff --git a/src/podofo/private/SASLprep.cpp b/src/podofo/private/SASLprep.cpp
+index a9c8a672..6899b9f0 100644
+--- a/src/podofo/private/SASLprep.cpp
++++ b/src/podofo/private/SASLprep.cpp
+@@ -8,7 +8,7 @@
+ #include <cassert>
+ #include <vector>
+
+-#include <utf8proc/utf8proc.h>
++#include <utf8proc.h>
+ #include <utf8cpp/utf8.h>
+
+ #include "SASLprepPrivate.h"
+diff --git a/src/podofo/private/charconv_compat.h b/src/podofo/private/charconv_compat.h
+index 1f72d9d9..b20c860b 100644
+--- a/src/podofo/private/charconv_compat.h
++++ b/src/podofo/private/charconv_compat.h
+@@ -15,7 +15,7 @@
+ #endif
+
+ #if defined(WANT_CHARS_FORMAT) || defined(WANT_FROM_CHARS)
+-#include <fast_float.h>
++#include <fast_float/fast_float.h>
+ #endif
+
+ #ifdef WANT_TO_CHARS
diff --git a/vcpkg/ports/podofo/portfile.cmake b/vcpkg/ports/podofo/portfile.cmake
new file mode 100644
index 0000000..3ef0ffb
--- /dev/null
+++ b/vcpkg/ports/podofo/portfile.cmake
@@ -0,0 +1,44 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO podofo/podofo
+ REF "${VERSION}"
+ SHA512 685c5771c58195ce8b70c76f1ef352a6740e716845988d75ca0f0f1abaa548766e22bed9608143737e5cdaef284d61c189031564e0cfe4bba8103f678667dcd1
+ PATCHES
+ dependencies.diff
+)
+file(REMOVE_RECURSE
+ "${SOURCE_PATH}/3rdparty/date"
+ "${SOURCE_PATH}/3rdparty/fast_float.h"
+ "${SOURCE_PATH}/3rdparty/fmt"
+ "${SOURCE_PATH}/3rdparty/utf8cpp"
+ "${SOURCE_PATH}/3rdparty/utf8proc"
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ fontconfig VCPKG_LOCK_FIND_PACKAGE_Fontconfig
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" PODOFO_BUILD_STATIC)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DPKG_CONFIG_FOUND=true # enable pc file for shared linkage
+ -DPODOFO_BUILD_LIB_ONLY=1
+ -DPODOFO_BUILD_STATIC=${PODOFO_BUILD_STATIC}
+)
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_fixup_pkgconfig()
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/podofo)
+
+if(PODOFO_BUILD_STATIC)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/podofo/auxiliary/basedefs.h" "#ifdef PODOFO_STATIC" "#if 1")
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
diff --git a/vcpkg/ports/podofo/usage b/vcpkg/ports/podofo/usage
new file mode 100644
index 0000000..52c4961
--- /dev/null
+++ b/vcpkg/ports/podofo/usage
@@ -0,0 +1,9 @@
+podofo provides CMake targets:
+
+ find_package(podofo CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE podofo::podofo)
+
+podofo provides pkg-config modules:
+
+ # A C++ library to work with the PDF file format
+ libpodofo
diff --git a/vcpkg/ports/podofo/vcpkg.json b/vcpkg/ports/podofo/vcpkg.json
new file mode 100644
index 0000000..e653422
--- /dev/null
+++ b/vcpkg/ports/podofo/vcpkg.json
@@ -0,0 +1,61 @@
+{
+ "name": "podofo",
+ "version": "1.0.2",
+ "port-version": 1,
+ "description": "PoDoFo is a library to work with the PDF file format",
+ "homepage": "https://github.com/podofo/podofo",
+ "license": "LGPL-2.0-or-later",
+ "supports": "!uwp & !xbox",
+ "dependencies": [
+ "date",
+ "fast-float",
+ "fmt",
+ "freetype",
+ "libjpeg-turbo",
+ "libpng",
+ {
+ "name": "libxml2",
+ "default-features": false
+ },
+ "openssl",
+ {
+ "name": "tiff",
+ "default-features": false
+ },
+ "utf8proc",
+ "utfcpp",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ },
+ "zlib"
+ ],
+ "default-features": [
+ "fontmanager"
+ ],
+ "features": {
+ "fontconfig": {
+ "description": "Use Fontconfig",
+ "dependencies": [
+ "fontconfig"
+ ]
+ },
+ "fontmanager": {
+ "description": "Enable font manager",
+ "dependencies": [
+ {
+ "name": "podofo",
+ "default-features": false,
+ "features": [
+ "fontconfig"
+ ],
+ "platform": "!windows"
+ }
+ ]
+ }
+ }
+}