[podofo] Update to 1.0.0 (#45699)

This commit is contained in:
Kai Pastor 2025-06-04 11:03:49 +02:00 committed by GitHub
parent 737c3c9662
commit 2ec6572586
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 170 additions and 55 deletions

View File

@ -0,0 +1,77 @@
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,26 @@ 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(unofficial-utf8proc CONFIG REQUIRED)
+add_library(imported::utf8proc ALIAS utf8proc)
+
+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>
+ imported::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(unofficial-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

View File

@ -1,20 +0,0 @@
diff --git a/src/podofo/CMakeLists.txt b/src/podofo/CMakeLists.txt
index 697e475..6c12036 100644
--- a/src/podofo/CMakeLists.txt
+++ b/src/podofo/CMakeLists.txt
@@ -72,6 +72,7 @@ if(PODOFO_BUILD_STATIC)
add_library(podofo_static STATIC ${PODOFO_SOURCES})
add_library(podofo::podofo ALIAS podofo_static)
target_link_libraries(podofo_static podofo_private ${PODOFO_LIB_DEPENDS})
+ target_include_directories(podofo_static PUBLIC "$<INSTALL_INTERFACE:include>")
set_target_properties(podofo_static PROPERTIES
VERSION "${PODOFO_VERSION}"
SOVERSION "${PODOFO_SOVERSION}"
@@ -96,6 +97,7 @@ if(PODOFO_BUILD_SHARED)
add_library(podofo_shared SHARED ${PODOFO_SOURCES})
add_library(podofo::podofo ALIAS podofo_shared)
target_link_libraries(podofo_shared PRIVATE podofo_private ${PODOFO_LIB_DEPENDS})
+ target_include_directories(podofo_shared PUBLIC "$<INSTALL_INTERFACE:include>")
# TODO: set /wd4251 flag if we're doing a debug build with
# Visual Studio, since it produces invalid warnings about STL
# use.

View File

@ -2,23 +2,25 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO podofo/podofo
REF "${VERSION}"
SHA512 963d8e2ad6516a0be4d3d416881e58e2384f07f0c006a8a33656d25f6a6b52858344750a4959e0aef568370df1cb052fc08f308aeec3795844a59cc8c47cff23
SHA512 ab6975270f47d584ba8a8259bb5fe7edbaa8ae29dc0d9311685eab6f0923c62a895f3e42926608d8a7d93ddd23aad8f335aa6dbfb2fa3a115d2a5dcec50ff66c
PATCHES
fix-interface-include.patch
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 CMAKE_REQUIRE_FIND_PACKAGE_Fontconfig
INVERTED_FEATURES
fontconfig CMAKE_DISABLE_FIND_PACKAGE_Fontconfig
fontconfig VCPKG_LOCK_FIND_PACKAGE_Fontconfig
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" PODOFO_BUILD_STATIC)
file(REMOVE "${SOURCE_PATH}/cmake/modules/FindOpenSSL.cmake")
file(REMOVE "${SOURCE_PATH}/cmake/modules/FindZLIB.cmake")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
@ -26,34 +28,17 @@ vcpkg_cmake_configure(
-DPKG_CONFIG_FOUND=true # enable pc file for shared linkage
-DPODOFO_BUILD_LIB_ONLY=1
-DPODOFO_BUILD_STATIC=${PODOFO_BUILD_STATIC}
-DCMAKE_DISABLE_FIND_PACKAGE_Libidn=ON
MAYBE_UNUSED_VARIABLES
PKG_CONFIG_FOUND # Fix the warning of static build.
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_replace_string( "${CURRENT_PACKAGES_DIR}/share/${PORT}/podofo-config.cmake"
"# Generated by CMake"
"include(CMakeFindDependencyMacro)
find_dependency(Freetype)
find_dependency(JPEG)
find_dependency(LibXml2)
find_dependency(OpenSSL)
find_dependency(PNG)
find_dependency(TIFF)
find_dependency(ZLIB)
if(\"${CMAKE_REQUIRE_FIND_PACKAGE_Fontconfig}\")
find_dependency(Fontconfig)
endif()
\n# Generated by CMake")
vcpkg_cmake_config_fixup()
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")
# Handle copyright
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")

View File

@ -1,4 +1,9 @@
podofo provides CMake targets:
find_package(podofo CONFIG REQUIRED)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:podofo_shared>,podofo_shared,podofo_static>)
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

View File

@ -1,11 +1,14 @@
{
"name": "podofo",
"version": "0.10.4",
"version": "1.0.0",
"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",
@ -18,6 +21,8 @@
"name": "tiff",
"default-features": false
},
"utf8proc",
"utfcpp",
{
"name": "vcpkg-cmake",
"host": true

View File

@ -0,0 +1,10 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
vcpkg_find_acquire_program(PKGCONFIG)
vcpkg_cmake_configure(
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
OPTIONS
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
)
vcpkg_cmake_build()

View File

@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.16)
project(podofo-test)
set(CMAKE_CXX_STANDARD 17)
find_package(podofo CONFIG REQUIRED)
add_executable(main main.cxx)
target_link_libraries(main PRIVATE podofo::podofo)
find_package(PkgConfig REQUIRED)
pkg_check_modules(podofo_pc libpodofo REQUIRED IMPORTED_TARGET)
add_executable(main-pkconfig main.cxx)
target_link_libraries(main-pkconfig PRIVATE PkgConfig::podofo_pc)

View File

@ -0,0 +1,16 @@
#include <stdio.h>
#include <podofo/podofo.h>
int main()
{
PoDoFo::PdfMemDocument document;
auto font = document.GetFonts().SearchFont("Arial");
if (document.GetPages().GetCount() > 0)
{
auto& page = document.GetPages().GetPageAt(0);
auto& signature = page.CreateField<PoDoFo::PdfSignature>("Signature2", PoDoFo::Rect());
char x509certbuffer[256], pkeybuffer[256];
PoDoFo::PdfSignerCms signer(x509certbuffer, pkeybuffer);
}
return 0;
}

View File

@ -0,0 +1,17 @@
{
"name": "vcpkg-ci-podofo",
"version-string": "ci",
"description": "Port to fvalidate podofo CI",
"homepage": "https://github.com/microsoft/vcpkg",
"license": "MIT",
"dependencies": [
{
"name": "podofo",
"default-features": false
},
{
"name": "vcpkg-cmake",
"host": true
}
]
}

View File

@ -7365,7 +7365,7 @@
"port-version": 2
},
"podofo": {
"baseline": "0.10.4",
"baseline": "1.0.0",
"port-version": 0
},
"poissonrecon": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f330f6f38e957896d09c8e1ee07c7d336b4246d3",
"version": "1.0.0",
"port-version": 0
},
{
"git-tree": "995e105bc9f91fe7bd50e386c798eaeb006b1112",
"version": "0.10.4",