From c6d89090a934177da391e1b5771d5099e2083781 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Mon, 9 Dec 2019 19:43:07 +0100 Subject: fix duplicated symbols of tiff/libharu --- ports/libharu/CONTROL | 7 ++++++- ports/libharu/portfile.cmake | 6 ++++-- ports/libharu/tiff.patch | 12 ++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 ports/libharu/tiff.patch diff --git a/ports/libharu/CONTROL b/ports/libharu/CONTROL index f8d2ca29a..95e84e34a 100644 --- a/ports/libharu/CONTROL +++ b/ports/libharu/CONTROL @@ -1,5 +1,10 @@ Source: libharu -Version: 2017-08-15-8 +Version: 2017-08-15-9 Homepage: https://github.com/libharu/libharu Description: libharu - free PDF library Build-Depends: zlib, libpng +Default-Features: notiffsymbols + +Feature: notiffsymbols +Description: disable symbols also defined by the tiff port +Build-Depends: tiff \ No newline at end of file diff --git a/ports/libharu/portfile.cmake b/ports/libharu/portfile.cmake index 962550ca8..58b55a6fc 100644 --- a/ports/libharu/portfile.cmake +++ b/ports/libharu/portfile.cmake @@ -1,5 +1,6 @@ -include(vcpkg_common_functions) - +if("notiffsymbols" IN_LIST FEATURES) + set(DISABLETIFF tiff.patch) +endif() vcpkg_download_distfile(SHADING_PR URLS "https://github.com/libharu/libharu/pull/157.diff" FILENAME "libharu-shading-pr-157.patch" @@ -17,6 +18,7 @@ vcpkg_from_github( 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} ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") diff --git a/ports/libharu/tiff.patch b/ports/libharu/tiff.patch new file mode 100644 index 000000000..e40a9bb9e --- /dev/null +++ b/ports/libharu/tiff.patch @@ -0,0 +1,12 @@ +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; -- cgit v1.2.3 From 0b51f928db5b132b83fc926fb529e5a446819bca Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Mon, 9 Dec 2019 21:57:03 +0100 Subject: symbols only clash in static builds --- ports/libharu/portfile.cmake | 4 +++- ports/libharu/tiff.patch | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ports/libharu/portfile.cmake b/ports/libharu/portfile.cmake index 58b55a6fc..7a9f6891c 100644 --- a/ports/libharu/portfile.cmake +++ b/ports/libharu/portfile.cmake @@ -1,5 +1,7 @@ if("notiffsymbols" IN_LIST FEATURES) - set(DISABLETIFF tiff.patch) + 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" diff --git a/ports/libharu/tiff.patch b/ports/libharu/tiff.patch index e40a9bb9e..2aabbe32e 100644 --- a/ports/libharu/tiff.patch +++ b/ports/libharu/tiff.patch @@ -10,3 +10,16 @@ index 2937fc90d..a1a35d0ed 100644 #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 -- cgit v1.2.3