[vcpkg baseline][libharu] update to 2.4.0-rc1 (#25569)

* update to 2.4.0-rc1

* update vtk vcpkg.json file

* export targets

* update patch

* update patch

* Fix FindLibHaru in vtk

* update ports/vtk/FindLibHaru.patch

* update patch

* fix find libharu
This commit is contained in:
Mengna Li 2022-07-14 01:30:11 +08:00 committed by GitHub
parent 5f8189bc48
commit 72cdfe25ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 111 additions and 120 deletions

View File

@ -1,12 +0,0 @@
diff --git a/include/hpdf.h b/include/hpdf.h
index 1cf0dd9..cce9b59 100644
--- a/include/hpdf.h
+++ b/include/hpdf.h
@@ -54,6 +54,7 @@
#include "hpdf_types.h"
typedef void *HPDF_HANDLE;
+typedef HPDF_HANDLE HPDF_Boolean;
typedef HPDF_HANDLE HPDF_Doc;
typedef HPDF_HANDLE HPDF_Page;
typedef HPDF_HANDLE HPDF_Pages;

View File

@ -0,0 +1,29 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4ca0f14..02ad1ab 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -87,9 +87,23 @@ if(UNIX AND NOT APPLE)
target_link_libraries (haru ${M_LIB})
endif()
+if(LIBHPDF_SHARED)
+ if(WIN32 AND NOT CYGWIN)
+ set_target_properties(haru PROPERTIES DEFINE_SYMBOL HPDF_DLL_MAKE)
+ endif(WIN32 AND NOT CYGWIN)
+endif(LIBHPDF_SHARED)
+
+target_include_directories(haru PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
+
install(
- TARGETS
+ TARGETS haru
+ EXPORT unofficial-libharu-config
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
+
+install(EXPORT unofficial-libharu-config
+ NAMESPACE unofficial::libharu::
+ DESTINATION share/unofficial-libharu
+)

View File

@ -1,21 +0,0 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9d2a604..be8e964 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -79,11 +79,11 @@ if(LIBHPDF_STATIC)
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
- if(WIN32 AND NOT CYGWIN)
- foreach(addlib ${ADDITIONAL_LIBRARIES})
- install(FILES ${addlib} DESTINATION lib)
- endforeach(addlib)
- endif(WIN32 AND NOT CYGWIN)
+ #if(WIN32 AND NOT CYGWIN)
+ #foreach(addlib ${ADDITIONAL_LIBRARIES})
+ #install(FILES ${addlib} DESTINATION lib)
+ #endforeach(addlib)
+ #endif(WIN32 AND NOT CYGWIN)
endif(LIBHPDF_STATIC)
if(LIBHPDF_SHARED)
add_library(${LIBHPDF_NAME} SHARED ${LIBHPDF_SRCS})

View File

@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 14ed67d..57673c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -126,7 +126,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 .)

View File

@ -1,26 +1,12 @@
if("notiffsymbols" IN_LIST FEATURES)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(DISABLETIFF tiff.patch)
endif()
endif()
vcpkg_download_distfile(SHADING_PR
URLS "https://github.com/libharu/libharu/pull/157.diff"
FILENAME "libharu-shading-pr-157.patch"
SHA512 f2ddb22b54b4eccc79400b6a4b2d245a221898f75456a5a559523eab7a523a87dfc5dfd0ec5fb17a771697e03c7ea6ed4c6095eff73e0a4302cd6eb24584c957
)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libharu/libharu
REF d84867ebf9f3de6afd661d2cdaff102457fbc371
SHA512 789579dd52c1056ae90a4ce5360c26ba92cadae5341a3901c4159afe624129a1f628fa6412952a398e048b0e5040c93f7ed5b4e4bc620a22d897098298fe2a99
REF 6997cf775b2345e3db82ac774fe2931faf348458 #2.4.0-rc1
SHA512 758753b0f977c6b9f0b6309958e1edfba491851682c9b04cead6ebebc9af726fdec7265f36ca1b1e80f1849f9b4a43ad329a688b4844eb911c64d42a92cd7823
HEAD_REF master
PATCHES
fix-build-fail.patch
add-boolean-typedef.patch
# This patch adds shading support which is required for VTK. If desired, this could be moved into an on-by-default feature.
${SHADING_PR}
${DISABLETIFF}
fix-include-path.patch
export-targets.patch
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
@ -40,34 +26,19 @@ vcpkg_cmake_configure(
vcpkg_cmake_install()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/libhpdfs.lib" "${CURRENT_PACKAGES_DIR}/lib/libhpdf.lib")
endif()
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libhpdfsd.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/libhpdfd.lib")
endif()
else()
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/libhpdfs.a" "${CURRENT_PACKAGES_DIR}/lib/libhpdf.a")
endif()
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libhpdfs.a" "${CURRENT_PACKAGES_DIR}/debug/lib/libhpdfd.a")
endif()
endif()
endif()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libharu)
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/README"
"${CURRENT_PACKAGES_DIR}/debug/README.md"
"${CURRENT_PACKAGES_DIR}/debug/CHANGES"
"${CURRENT_PACKAGES_DIR}/debug/INSTALL"
"${CURRENT_PACKAGES_DIR}/README"
"${CURRENT_PACKAGES_DIR}/README.md"
"${CURRENT_PACKAGES_DIR}/CHANGES"
"${CURRENT_PACKAGES_DIR}/INSTALL"
)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
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}")
@ -85,4 +56,4 @@ endif()
file(WRITE "${CURRENT_PACKAGES_DIR}/include/hpdf_types.h" "${_contents}")
vcpkg_copy_pdbs()
file(INSTALL "${SOURCE_PATH}/LICENCE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,25 +0,0 @@
diff --git a/src/hpdf_image_ccitt.c b/src/hpdf_image_ccitt.c
index 2937fc90d..a1a35d0ed 100644
--- a/src/hpdf_image_ccitt.c
+++ b/src/hpdf_image_ccitt.c
@@ -21,7 +21,6 @@
#include <memory.h>
#include <assert.h>
-#define G3CODES
#include "t4.h"
typedef unsigned int uint32;
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 354ca7526..ee301d9af 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -99,6 +99,8 @@ if(PNG_FOUND)
set(ADDITIONAL_LIBRARIES ${ADDITIONAL_LIBRARIES} ${PNG_LIBRARIES})
endif(PNG_FOUND)
+find_package(TIFF REQUIRED)
+list(APPEND ADDITIONAL_LIBRARIES TIFF::TIFF)
# =======================================================================
# configure header files, add compiler flags

View File

@ -1,26 +1,19 @@
{
"name": "libharu",
"version-string": "2017-08-15",
"port-version": 10,
"version-semver": "2.4.0-rc1",
"description": "libharu - free PDF library",
"homepage": "https://github.com/libharu/libharu",
"license": "Zlib",
"dependencies": [
"libpng",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
],
"default-features": [
"notiffsymbols"
],
"features": {
"notiffsymbols": {
"description": "disable symbols also defined by the tiff port",
"dependencies": [
"tiff"
]
}
}
]
}

View File

@ -0,0 +1,36 @@
diff --git a/CMake/vtkInstallCMakePackage.cmake b/CMake/vtkInstallCMakePackage.cmake
index c87bb9c..0c0133e 100644
--- a/CMake/vtkInstallCMakePackage.cmake
+++ b/CMake/vtkInstallCMakePackage.cmake
@@ -62,7 +62,6 @@ set(vtk_cmake_module_files
FindGLEW.cmake
FindJOGL.cmake
FindJsonCpp.cmake
- FindLibHaru.cmake
FindLibPROJ.cmake
FindLibXml2.cmake
FindLZ4.cmake
diff --git a/ThirdParty/libharu/CMakeLists.txt b/ThirdParty/libharu/CMakeLists.txt
index bac8dce..c0b98cd 100644
--- a/ThirdParty/libharu/CMakeLists.txt
+++ b/ThirdParty/libharu/CMakeLists.txt
@@ -4,16 +4,15 @@ vtk_module_third_party(
VERSION "2.4.0"
STANDARD_INCLUDE_DIRS
EXTERNAL
- PACKAGE LibHaru
+ PACKAGE unofficial-libharu CONFIG_MODE
# Unreleased. Requires these PRs:
# https://github.com/libharu/libharu/pull/157
# https://github.com/libharu/libharu/pull/187
- VERSION 2.4.0
- TARGETS LibHaru::LibHaru
+ TARGETS unofficial::libharu::haru
STANDARD_INCLUDE_DIRS)
include(vtkDetectLibraryType)
-vtk_detect_library_shared(vtklibharu LibHaru::LibHaru)
+vtk_detect_library_shared(vtklibharu unofficial::libharu::haru)
set(HPDF_DLL 0)
if (WIN32 AND vtklibharu_is_shared)

View File

@ -30,6 +30,7 @@ vcpkg_from_github(
fix-gdal.patch
missing-limits.patch # This patch can be removed in next version. Since it has been merged to upstream via https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7611
UseProj5Api.patch # Allow Proj 8.0+ (commit b66e4a7, backported). Should be in soon after 9.0.3
fix-find-libharu.patch
)
# =============================================================================
@ -143,6 +144,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
"mpi" VTK_USE_MPI
"all" VTK_BUILD_ALL_MODULES
)
# =============================================================================
# Configure & Install

View File

@ -1,7 +1,7 @@
{
"name": "vtk",
"version-semver": "9.0.3-pv5.9.1",
"port-version": 10,
"port-version": 11,
"description": "Software system for 3D computer graphics, image processing, and visualization",
"homepage": "https://github.com/Kitware/VTK",
"license": "BSD-3-Clause",
@ -16,12 +16,7 @@
"default-features": false
},
"jsoncpp",
{
"name": "libharu",
"features": [
"notiffsymbols"
]
},
"libharu",
"libjpeg-turbo",
"liblzma",
"libogg",

View File

@ -3677,8 +3677,8 @@
"port-version": 1
},
"libharu": {
"baseline": "2017-08-15",
"port-version": 10
"baseline": "2.4.0-rc1",
"port-version": 0
},
"libhdfs3": {
"baseline": "2019-11-05",
@ -7502,7 +7502,7 @@
},
"vtk": {
"baseline": "9.0.3-pv5.9.1",
"port-version": 10
"port-version": 11
},
"vtk-dicom": {
"baseline": "0.8.12",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "7119cd9fe86c40e908ef4c65be267b35caf8d010",
"version-semver": "2.4.0-rc1",
"port-version": 0
},
{
"git-tree": "bfeaf0d13fce9156ac216daa37a2c945290fc0ed",
"version-date": "2017-08-15",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "3193e1219e09f8f67d2762fa4fe823f4327a1c93",
"version-semver": "9.0.3-pv5.9.1",
"port-version": 11
},
{
"git-tree": "6a7eea485be980aa5c9fae1e0a75084f98e5dc27",
"version-semver": "9.0.3-pv5.9.1",