Skip to content

Commit

Permalink
[libharu,wt] Update libharu to 2.4.2 and Wt to 4.8.1 (#26945)
Browse files Browse the repository at this point in the history
* [libharu] Update to 2.4.2

I updated the patches for libharu so they apply to 2.4.2 properly.
The target name changed from haru to hpdf, the haru imported
library is included for backwards compatibility. I added a usage
file that only mentions hpdf.

I added a patch for VTK so that it compiles with libharu 2.4.x,
since the type of one the HPDF_Page_SetDash arguments changed
from HPDF_UINT16 to HPDF_REAL.

POCO also has an optional libharu dependency when the 'pdf'
feature is enabled, but at the moment the PocoPDF library
doesn't seem to be built even when enabled.

* [wt] Update to 4.8.1

This release fixes compatibility with libharu 2.4.x
  • Loading branch information
RockinRoel committed Sep 30, 2022
1 parent fc5a7c6 commit 65521f7
Show file tree
Hide file tree
Showing 16 changed files with 96 additions and 38 deletions.
27 changes: 15 additions & 12 deletions ports/libharu/export-targets.patch
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4ca0f14..02ad1ab 100644
index b87af66..10ec58f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -87,9 +87,23 @@ if(UNIX AND NOT APPLE)
target_link_libraries (haru ${M_LIB})
@@ -87,9 +87,26 @@ if(UNIX AND NOT APPLE)
target_link_libraries (hpdf ${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)
+ if(WIN32 AND NOT CYGWIN)
+ set_target_properties(hpdf PROPERTIES DEFINE_SYMBOL HPDF_DLL_MAKE)
+ endif()
+endif()
+
+target_include_directories(haru PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
+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
+ TARGETS haru
- TARGETS hpdf
+ TARGETS hpdf 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
+ NAMESPACE unofficial::libharu::
+ DESTINATION share/unofficial-libharu
+)
6 changes: 3 additions & 3 deletions ports/libharu/fix-include-path.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 14ed67d..57673c1 100644
index 1c75e5a..9a6c575 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -126,7 +126,7 @@ set(
@@ -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 .)
install(FILES README.md CHANGES INSTALL DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/libharu)
5 changes: 3 additions & 2 deletions ports/libharu/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libharu/libharu
REF 6997cf775b2345e3db82ac774fe2931faf348458 #2.4.0-rc1
SHA512 758753b0f977c6b9f0b6309958e1edfba491851682c9b04cead6ebebc9af726fdec7265f36ca1b1e80f1849f9b4a43ad329a688b4844eb911c64d42a92cd7823
REF 0eb5cdc5a7b5f2b03de20de7a0a57921f56b59f3 # 2.4.2
SHA512 f6be210b09eee348d5de87a0e6edbab360091db121baa21d9e1b3c45fb4dda4f6351353605cc247fc375e0daf2f05b576a73244110e44cfb02798b3f3d1836db
HEAD_REF master
PATCHES
fix-include-path.patch
Expand Down Expand Up @@ -56,4 +56,5 @@ endif()
file(WRITE "${CURRENT_PACKAGES_DIR}/include/hpdf_types.h" "${_contents}")

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)
4 changes: 4 additions & 0 deletions ports/libharu/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
libharu provides CMake targets:

find_package(unofficial-libharu CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::libharu::hpdf)
2 changes: 1 addition & 1 deletion ports/libharu/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "libharu",
"version-semver": "2.4.0-rc1",
"version-semver": "2.4.2",
"description": "libharu - free PDF library",
"homepage": "https://github.com/libharu/libharu",
"license": "Zlib",
Expand Down
8 changes: 4 additions & 4 deletions ports/vtk/fix-find-libharu.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMake/vtkInstallCMakePackage.cmake b/CMake/vtkInstallCMakePackage.cmake
index c87bb9c..0c0133e 100644
index bcb20446c2..24c06ed8ad 100644
--- a/CMake/vtkInstallCMakePackage.cmake
+++ b/CMake/vtkInstallCMakePackage.cmake
@@ -62,7 +62,6 @@ set(vtk_cmake_module_files
Expand All @@ -11,7 +11,7 @@ index c87bb9c..0c0133e 100644
FindLibXml2.cmake
FindLZ4.cmake
diff --git a/ThirdParty/libharu/CMakeLists.txt b/ThirdParty/libharu/CMakeLists.txt
index bac8dce..c0b98cd 100644
index bac8dce188..44004fd9bb 100644
--- a/ThirdParty/libharu/CMakeLists.txt
+++ b/ThirdParty/libharu/CMakeLists.txt
@@ -4,16 +4,15 @@ vtk_module_third_party(
Expand All @@ -25,12 +25,12 @@ index bac8dce..c0b98cd 100644
# https://github.com/libharu/libharu/pull/187
- VERSION 2.4.0
- TARGETS LibHaru::LibHaru
+ TARGETS unofficial::libharu::haru
+ TARGETS unofficial::libharu::hpdf
STANDARD_INCLUDE_DIRS)

include(vtkDetectLibraryType)
-vtk_detect_library_shared(vtklibharu LibHaru::LibHaru)
+vtk_detect_library_shared(vtklibharu unofficial::libharu::haru)
+vtk_detect_library_shared(vtklibharu unofficial::libharu::hpdf)

set(HPDF_DLL 0)
if (WIN32 AND vtklibharu_is_shared)
32 changes: 32 additions & 0 deletions ports/vtk/fix-libharu2.4-compat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/IO/ExportPDF/vtkPDFContextDevice2D.cxx b/IO/ExportPDF/vtkPDFContextDevice2D.cxx
index a51945dc9b..1cbc3945af 100644
--- a/IO/ExportPDF/vtkPDFContextDevice2D.cxx
+++ b/IO/ExportPDF/vtkPDFContextDevice2D.cxx
@@ -1631,21 +1631,21 @@ void vtkPDFContextDevice2D::ApplyLineWidth(float width)
void vtkPDFContextDevice2D::ApplyLineType(int type)
{
// These match the OpenGL2 implementation:
- static const HPDF_UINT16 noPen[] = { 0, 10 };
+ static const HPDF_REAL noPen[] = { 0, 10 };
static const HPDF_UINT noPenLen = 2;

- static const HPDF_UINT16 dash[] = { 8 };
+ static const HPDF_REAL dash[] = { 8 };
static const HPDF_UINT dashLen = 1;

- static const HPDF_UINT16 dot[] = { 1, 7 };
- static const HPDF_UINT16 denseDot[] = { 1, 3 };
+ static const HPDF_REAL dot[] = { 1, 7 };
+ static const HPDF_REAL denseDot[] = { 1, 3 };
static const HPDF_UINT dotLen = 2;

- static const HPDF_UINT16 dashDot[] = { 4, 6, 2, 4 };
+ static const HPDF_REAL dashDot[] = { 4, 6, 2, 4 };
static const HPDF_UINT dashDotLen = 4;

// This is dash-dot-dash, but eh. It matches the OpenGL2 0x1C47 pattern.
- static const HPDF_UINT16 dashDotDot[] = { 3, 3, 1, 3, 3, 3 };
+ static const HPDF_REAL dashDotDot[] = { 3, 3, 1, 3, 3, 3 };
static const HPDF_UINT dashDotDotLen = 6;

switch (type)
1 change: 1 addition & 0 deletions ports/vtk/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ vcpkg_from_github(
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
fix-libharu2.4-compat.patch
)

# =============================================================================
Expand Down
2 changes: 1 addition & 1 deletion ports/vtk/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vtk",
"version-semver": "9.0.3-pv5.9.1",
"port-version": 11,
"port-version": 12,
"description": "Software system for 3D computer graphics, image processing, and visualization",
"homepage": "https://github.com/Kitware/VTK",
"license": "BSD-3-Clause",
Expand Down
20 changes: 11 additions & 9 deletions ports/wt/0006-GraphicsMagick.patch
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5012cfd1b..95f812685 100644
index 7fe932fb7..ae122f03a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -338,7 +338,7 @@ ELSE (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 8)
ENDIF (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 8)
@@ -342,9 +342,9 @@ SET(WT_WRASTERIMAGE_IMPLEMENTATION ${WT_WRASTERIMAGE_DEFAULT_IMPLEMENTATION} CAC
SET_PROPERTY(CACHE WT_WRASTERIMAGE_IMPLEMENTATION PROPERTY STRINGS GraphicsMagick Direct2D none)

IF (${WT_WRASTERIMAGE_IMPLEMENTATION} STREQUAL "GraphicsMagick")
- IF (NOT GM_FOUND)
+ IF (0)
MESSAGE(FATAL_ERROR "WT_WRASTERIMAGE_IMPLEMENTATION set to GraphicsMagick but GM is not found. Indicate the location of your graphicsmagick library using -DGM_PREFIX=...")
ENDIF (NOT GM_FOUND)
- ENDIF (NOT GM_FOUND)
+ ENDIF ()
SET(WT_HAS_WRASTERIMAGE true)
ELSEIF (${WT_WRASTERIMAGE_IMPLEMENTATION} STREQUAL "Direct2D")
IF (WIN32)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 78d82ee53..01ac5f42a 100644
index fb398ff0d..16b5f76b3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -595,8 +595,9 @@ ELSE(HAVE_HARU)
@@ -632,8 +632,8 @@ ELSE(HAVE_HARU)
ENDIF(HAVE_HARU)

IF("${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "GraphicsMagick")
- TARGET_LINK_LIBRARIES(wt PRIVATE ${GM_LIBRARIES})
- INCLUDE_DIRECTORIES(${GM_INCLUDE_DIRS})
+ find_package(unofficial-graphicsmagick REQUIRED)
+ TARGET_LINK_LIBRARIES(wt PRIVATE unofficial::graphicsmagick::graphicsmagick)
+ # INCLUDE_DIRECTORIES(${GM_INCLUDE_DIRS})
ADD_DEFINITIONS(-DHAVE_GRAPHICSMAGICK)
ELSEIF("${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "skia")
TARGET_LINK_LIBRARIES(wt PRIVATE ${SKIA_LIBRARIES})
ELSEIF("${WT_WRASTERIMAGE_IMPLEMENTATION}" STREQUAL "Direct2D")
TARGET_LINK_LIBRARIES(wt PRIVATE d2d1 dwrite windowscodecs shlwapi)
4 changes: 2 additions & 2 deletions ports/wt/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO emweb/wt
REF d0e9f2e8096a1acb4558130a851812dd424d8f3e # 4.7.1
SHA512 ddda642e464a0c93017161404911cd8261e105971162171cd6aa0e4334e22b5f284a753e8b81a4f43c9269b14389abd28c61e2cdfe706b414808e82fc4bc1680
REF 402c55d196da761ec982beabaf11a8675fa76518 # 4.8.1
SHA512 de89e0de17bcfa142b9e94fde2b398b26046ecb66ef9ab673cd278e1d60a366965d3de524884f17a54ab65ffdc5d9ade5f8df457d3ff157af214476fe1285140
HEAD_REF master
PATCHES
0002-link-glew.patch
Expand Down
2 changes: 1 addition & 1 deletion ports/wt/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wt",
"version": "4.7.1",
"version": "4.8.1",
"description": "Wt is a C++ library for developing web applications",
"homepage": "https://github.com/emweb/wt",
"license": "GPL-2.0-only",
Expand Down
6 changes: 3 additions & 3 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3757,7 +3757,7 @@
"port-version": 1
},
"libharu": {
"baseline": "2.4.0-rc1",
"baseline": "2.4.2",
"port-version": 0
},
"libhdfs3": {
Expand Down Expand Up @@ -7714,7 +7714,7 @@
},
"vtk": {
"baseline": "9.0.3-pv5.9.1",
"port-version": 11
"port-version": 12
},
"vtk-dicom": {
"baseline": "0.8.12",
Expand Down Expand Up @@ -7857,7 +7857,7 @@
"port-version": 0
},
"wt": {
"baseline": "4.7.1",
"baseline": "4.8.1",
"port-version": 0
},
"wtl": {
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libharu.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "7df48b846add8eaed23517704e6a130fe8dca2ec",
"version-semver": "2.4.2",
"port-version": 0
},
{
"git-tree": "7119cd9fe86c40e908ef4c65be267b35caf8d010",
"version-semver": "2.4.0-rc1",
Expand Down
5 changes: 5 additions & 0 deletions versions/v-/vtk.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "64cd3c51764272ed1c8acc2d5fa37106d9f76b66",
"version-semver": "9.0.3-pv5.9.1",
"port-version": 12
},
{
"git-tree": "3193e1219e09f8f67d2762fa4fe823f4327a1c93",
"version-semver": "9.0.3-pv5.9.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/w-/wt.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1617b936bd6c68b1a5e3e316ccc773c405036135",
"version": "4.8.1",
"port-version": 0
},
{
"git-tree": "24546bcb3aa44c987d85536d39420e4159d4ad99",
"version": "4.7.1",
Expand Down

0 comments on commit 65521f7

Please sign in to comment.