[libharu] Update to 2.4.5 (#49855)

This commit is contained in:
SunBlack 2026-02-10 03:51:23 +01:00 committed by GitHub
parent 36865f993b
commit 5a11134d9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 58 additions and 68 deletions

View File

@ -1,25 +1,22 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b87af66..10ec58f 100644
index fd54315..873c504 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -87,9 +87,26 @@ if(UNIX AND NOT APPLE)
@@ -96,9 +96,24 @@ if(UNIX AND NOT APPLE)
target_link_libraries (hpdf ${M_LIB})
endif()
+if(LIBHPDF_SHARED)
+if(BUILD_SHARED_LIBS)
+ if(WIN32 AND NOT CYGWIN)
+ set_target_properties(hpdf PROPERTIES DEFINE_SYMBOL HPDF_DLL_MAKE)
+ target_compile_definitions(hpdf INTERFACE HPDF_DLL)
+ target_compile_definitions(hpdf PRIVATE HPDF_DLL_MAKE)
+ endif()
+endif()
+
+target_include_directories(hpdf PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
+
+add_library(haru INTERFACE)
+set_property(TARGET haru APPEND PROPERTY INTERFACE_LINK_LIBRARIES hpdf)
+
install(
- TARGETS hpdf
+ TARGETS hpdf haru
TARGETS hpdf
+ EXPORT unofficial-libharu-config
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}

View File

@ -1,13 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1c75e5a..9a6c575 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -148,7 +148,7 @@ set(
)
# install header files
-install(FILES ${haru_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+install(FILES ${haru_HDRS} DESTINATION include/)
# install various files
install(FILES README.md CHANGES INSTALL DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/libharu)

View File

@ -1,29 +1,23 @@
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
vcpkg_download_distfile(
PR351
URLS "https://github.com/libharu/libharu/commit/4c87178a92097d59ecb9a3271341df4944b52225.patch?full_index=1"
FILENAME "pr351.patch"
SHA512 43049c3db9ab52f4550dd71218f0115c5f039caaf82e19671e295bb0e12ae6f9750cd18a944bf88819f7fc67cfecdbc8425eff1e387b2a6935847b5810d8c048
)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libharu/libharu
REF v${VERSION}
SHA512 422210b09f89643cb25808559aeea109db5cce8a71c779d51f87222cdd50434f4f0f92322ebe429fca8f85ad73592bcabb14c3e36cd0bea19b6ec4c729220522
REF "v${VERSION}"
SHA512 677523f927ecc925d95c91ebb1cb3d1146c2ffc86031c6fc05fc038893fd38babde2abf16683e0b76d1e2b8554c64bf2278649a0f70b08a0f187c2135fc14220
HEAD_REF master
PATCHES
fix-include-path.patch
export-targets.patch
"${PR351}"
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(VCPKG_BUILD_SHARED_LIBS ON)
set(VCPKG_BUILD_STATIC_LIBS OFF)
else()
set(VCPKG_BUILD_SHARED_LIBS OFF)
set(VCPKG_BUILD_STATIC_LIBS ON)
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DLIBHPDF_STATIC=${VCPKG_BUILD_STATIC_LIBS}
-DLIBHPDF_SHARED=${VCPKG_BUILD_SHARED_LIBS}
)
vcpkg_cmake_install()
@ -32,34 +26,13 @@ vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libharu)
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/README.md"
"${CURRENT_PACKAGES_DIR}/debug/CHANGES"
"${CURRENT_PACKAGES_DIR}/debug/INSTALL"
"${CURRENT_PACKAGES_DIR}/README.md"
"${CURRENT_PACKAGES_DIR}/CHANGES"
"${CURRENT_PACKAGES_DIR}/INSTALL"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/share/libharu/bindings"
"${CURRENT_PACKAGES_DIR}/share/libharu/README.md"
"${CURRENT_PACKAGES_DIR}/share/libharu/CHANGES"
"${CURRENT_PACKAGES_DIR}/share/libharu/INSTALL"
)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
if(VCPKG_TARGET_IS_WINDOWS)
file(READ "${CURRENT_PACKAGES_DIR}/include/hpdf.h" _contents)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
string(REPLACE "#ifdef HPDF_DLL\n" "#if 1\n" _contents "${_contents}")
else()
string(REPLACE "#ifdef HPDF_DLL\n" "#if 0\n" _contents "${_contents}")
endif()
file(WRITE "${CURRENT_PACKAGES_DIR}/include/hpdf.h" "${_contents}")
file(READ "${CURRENT_PACKAGES_DIR}/include/hpdf_types.h" _contents)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
string(REPLACE "#ifdef HPDF_DLL\n" "#if 1\n" _contents "${_contents}")
else()
string(REPLACE "#ifdef HPDF_DLL\n" "#if 0\n" _contents "${_contents}")
endif()
file(WRITE "${CURRENT_PACKAGES_DIR}/include/hpdf_types.h" "${_contents}")
endif()
vcpkg_copy_pdbs()
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

View File

@ -1,7 +1,6 @@
{
"name": "libharu",
"version": "2.4.4",
"port-version": 1,
"version": "2.4.5",
"description": "libharu - free PDF library",
"homepage": "https://github.com/libharu/libharu",
"license": "Zlib",

View File

@ -0,0 +1,4 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
vcpkg_cmake_configure(SOURCE_PATH "${CURRENT_PORT_DIR}/project")
vcpkg_cmake_build()

View File

@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.16)
project(libharu-test CXX)
add_executable(main main.cpp)
find_package(unofficial-libharu CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::libharu::hpdf)

View File

@ -0,0 +1,6 @@
#include "hpdf.h"
int main() {
const auto version = HPDF_GetVersion();
return 0;
}

View File

@ -0,0 +1,12 @@
{
"name": "vcpkg-ci-libharu",
"version-string": "ci",
"description": "Validates libharu",
"dependencies": [
"libharu",
{
"name": "vcpkg-cmake",
"host": true
}
]
}

View File

@ -4957,8 +4957,8 @@
"port-version": 5
},
"libharu": {
"baseline": "2.4.4",
"port-version": 1
"baseline": "2.4.5",
"port-version": 0
},
"libhat": {
"baseline": "0.9.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4212fe7855d8b719108395a93cacea35244fdec7",
"version": "2.4.5",
"port-version": 0
},
{
"git-tree": "b7b936e1377328e2f1421b8727762bebb302813f",
"version": "2.4.4",