diff --git a/ports/podofo/dependencies.diff b/ports/podofo/dependencies.diff new file mode 100644 index 0000000000..38f2f86c69 --- /dev/null +++ b/ports/podofo/dependencies.diff @@ -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 ++ $ ++ $ ++ $ ++ $ ++ imported::utf8proc ++) ++if(PODOFO_BUILD_STATIC) ++ target_link_libraries(podofo_static $) ++else() ++ target_link_libraries(podofo_shared PRIVATE $) ++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 + #include + +-#include ++#include + #include + + #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 ++#include + #endif + + #ifdef WANT_TO_CHARS diff --git a/ports/podofo/fix-interface-include.patch b/ports/podofo/fix-interface-include.patch deleted file mode 100644 index a4a2ae6c7c..0000000000 --- a/ports/podofo/fix-interface-include.patch +++ /dev/null @@ -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 "$") - 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 "$") - # TODO: set /wd4251 flag if we're doing a debug build with - # Visual Studio, since it produces invalid warnings about STL - # use. diff --git a/ports/podofo/portfile.cmake b/ports/podofo/portfile.cmake index 5fbe2c87bf..d1a173d72a 100644 --- a/ports/podofo/portfile.cmake +++ b/ports/podofo/portfile.cmake @@ -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") diff --git a/ports/podofo/usage b/ports/podofo/usage index b21f4bb792..52c49613dd 100644 --- a/ports/podofo/usage +++ b/ports/podofo/usage @@ -1,4 +1,9 @@ podofo provides CMake targets: - find_package(podofo CONFIG REQUIRED) - target_link_libraries(main PRIVATE $,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 diff --git a/ports/podofo/vcpkg.json b/ports/podofo/vcpkg.json index 2503dffb61..f40a1c4489 100644 --- a/ports/podofo/vcpkg.json +++ b/ports/podofo/vcpkg.json @@ -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 diff --git a/scripts/test_ports/vcpkg-ci-podofo/portfile.cmake b/scripts/test_ports/vcpkg-ci-podofo/portfile.cmake new file mode 100644 index 0000000000..dd25706120 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-podofo/portfile.cmake @@ -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() diff --git a/scripts/test_ports/vcpkg-ci-podofo/project/CMakeLists.txt b/scripts/test_ports/vcpkg-ci-podofo/project/CMakeLists.txt new file mode 100644 index 0000000000..eb248ce921 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-podofo/project/CMakeLists.txt @@ -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) diff --git a/scripts/test_ports/vcpkg-ci-podofo/project/main.cxx b/scripts/test_ports/vcpkg-ci-podofo/project/main.cxx new file mode 100644 index 0000000000..595c445fef --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-podofo/project/main.cxx @@ -0,0 +1,16 @@ +#include +#include + +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("Signature2", PoDoFo::Rect()); + char x509certbuffer[256], pkeybuffer[256]; + PoDoFo::PdfSignerCms signer(x509certbuffer, pkeybuffer); + } + return 0; +} diff --git a/scripts/test_ports/vcpkg-ci-podofo/vcpkg.json b/scripts/test_ports/vcpkg-ci-podofo/vcpkg.json new file mode 100644 index 0000000000..5fbea688b4 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-podofo/vcpkg.json @@ -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 + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index e51b4cfec3..0ee9c876eb 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7365,7 +7365,7 @@ "port-version": 2 }, "podofo": { - "baseline": "0.10.4", + "baseline": "1.0.0", "port-version": 0 }, "poissonrecon": { diff --git a/versions/p-/podofo.json b/versions/p-/podofo.json index f2b25562b9..15120ba82d 100644 --- a/versions/p-/podofo.json +++ b/versions/p-/podofo.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "f330f6f38e957896d09c8e1ee07c7d336b4246d3", + "version": "1.0.0", + "port-version": 0 + }, { "git-tree": "995e105bc9f91fe7bd50e386c798eaeb006b1112", "version": "0.10.4",