From 72cdfe25ee67e86026286ed9d1acad51e956c048 Mon Sep 17 00:00:00 2001 From: Mengna Li <95600143+Adela0814@users.noreply.github.com> Date: Thu, 14 Jul 2022 01:30:11 +0800 Subject: [PATCH] [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 --- ports/libharu/add-boolean-typedef.patch | 12 ------- ports/libharu/export-targets.patch | 29 +++++++++++++++ ports/libharu/fix-build-fail.patch | 21 ----------- ports/libharu/fix-include-path.patch | 13 +++++++ ports/libharu/portfile.cmake | 47 +++++-------------------- ports/libharu/tiff.patch | 25 ------------- ports/libharu/vcpkg.json | 21 ++++------- ports/vtk/fix-find-libharu.patch | 36 +++++++++++++++++++ ports/vtk/portfile.cmake | 2 ++ ports/vtk/vcpkg.json | 9 ++--- versions/baseline.json | 6 ++-- versions/l-/libharu.json | 5 +++ versions/v-/vtk.json | 5 +++ 13 files changed, 111 insertions(+), 120 deletions(-) delete mode 100644 ports/libharu/add-boolean-typedef.patch create mode 100644 ports/libharu/export-targets.patch delete mode 100644 ports/libharu/fix-build-fail.patch create mode 100644 ports/libharu/fix-include-path.patch delete mode 100644 ports/libharu/tiff.patch create mode 100644 ports/vtk/fix-find-libharu.patch diff --git a/ports/libharu/add-boolean-typedef.patch b/ports/libharu/add-boolean-typedef.patch deleted file mode 100644 index 7768ed301bb..00000000000 --- a/ports/libharu/add-boolean-typedef.patch +++ /dev/null @@ -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; diff --git a/ports/libharu/export-targets.patch b/ports/libharu/export-targets.patch new file mode 100644 index 00000000000..3e7b62c9686 --- /dev/null +++ b/ports/libharu/export-targets.patch @@ -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 $ $) ++ + 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 ++) diff --git a/ports/libharu/fix-build-fail.patch b/ports/libharu/fix-build-fail.patch deleted file mode 100644 index 2f7066575ed..00000000000 --- a/ports/libharu/fix-build-fail.patch +++ /dev/null @@ -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}) diff --git a/ports/libharu/fix-include-path.patch b/ports/libharu/fix-include-path.patch new file mode 100644 index 00000000000..83ef8f324f1 --- /dev/null +++ b/ports/libharu/fix-include-path.patch @@ -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 .) diff --git a/ports/libharu/portfile.cmake b/ports/libharu/portfile.cmake index 20c5952547b..819bfff6425 100644 --- a/ports/libharu/portfile.cmake +++ b/ports/libharu/portfile.cmake @@ -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) diff --git a/ports/libharu/tiff.patch b/ports/libharu/tiff.patch deleted file mode 100644 index 2aabbe32e7c..00000000000 --- a/ports/libharu/tiff.patch +++ /dev/null @@ -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 - #include - --#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 diff --git a/ports/libharu/vcpkg.json b/ports/libharu/vcpkg.json index 76537e89f59..442551d6e91 100644 --- a/ports/libharu/vcpkg.json +++ b/ports/libharu/vcpkg.json @@ -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" - ] - } - } + ] } diff --git a/ports/vtk/fix-find-libharu.patch b/ports/vtk/fix-find-libharu.patch new file mode 100644 index 00000000000..4f707c757f1 --- /dev/null +++ b/ports/vtk/fix-find-libharu.patch @@ -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) diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake index 64dd5901a02..7be2566dd1c 100644 --- a/ports/vtk/portfile.cmake +++ b/ports/vtk/portfile.cmake @@ -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 diff --git a/ports/vtk/vcpkg.json b/ports/vtk/vcpkg.json index fb5a115dc61..244fd06887b 100644 --- a/ports/vtk/vcpkg.json +++ b/ports/vtk/vcpkg.json @@ -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", diff --git a/versions/baseline.json b/versions/baseline.json index 0d63b371845..f46d1f4c58d 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -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", diff --git a/versions/l-/libharu.json b/versions/l-/libharu.json index 176804b1366..579f9526230 100644 --- a/versions/l-/libharu.json +++ b/versions/l-/libharu.json @@ -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", diff --git a/versions/v-/vtk.json b/versions/v-/vtk.json index d7362563531..f4afbd9dd95 100644 --- a/versions/v-/vtk.json +++ b/versions/v-/vtk.json @@ -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",