From 5ef129e8806529cc552db6a017e44592e1222f56 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Thu, 8 Feb 2018 23:13:38 +0900 Subject: Add libgeotiff port Signed-off-by: Hiroshi Miura --- ports/libgeotiff/CONTROL | 4 ++++ ports/libgeotiff/portfile.cmake | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 ports/libgeotiff/CONTROL create mode 100644 ports/libgeotiff/portfile.cmake diff --git a/ports/libgeotiff/CONTROL b/ports/libgeotiff/CONTROL new file mode 100644 index 000000000..ba7bc134d --- /dev/null +++ b/ports/libgeotiff/CONTROL @@ -0,0 +1,4 @@ +Source: libgeotiff +Version: 1.4.2 +Description: libgeotiff. +Build-Depends: tiff, proj4, zlib, libjpeg-turbo diff --git a/ports/libgeotiff/portfile.cmake b/ports/libgeotiff/portfile.cmake new file mode 100644 index 000000000..d62c26d82 --- /dev/null +++ b/ports/libgeotiff/portfile.cmake @@ -0,0 +1,32 @@ +include(vcpkg_common_functions) + +set(LIBGEOTIFF_VERSION 1.4.2) +set(LIBGEOTIFF_HASH 059c6e05eb0c47f17b102c7217a2e1636e76d622c4d1bdcf0bd89fb3505f3130bffa881e21c73cfd2ca0d6863b81322f85784658ba3539b53b63c3a8f38d1deb) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libgeotiff-${LIBGEOTIFF_VERSION}) + +vcpkg_download_distfile(ARCHIVE + URLS "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-${LIBGEOTIFF_VERSION}.tar.gz" + FILENAME "libgeotiff-${LIBGEOTIFF_VERSION}.tar.gz" + SHA512 ${LIBGEOTIFF_HASH}) + +vcpkg_extract_source_archive(${ARCHIVE}) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(BUILD_SHARED_LIBS ON) +else() + set(BUILD_SHARED_LIBS OFF) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} + -DWITH_UTILITIES=OFF +) + +vcpkg_build_cmake() +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libgeotiff RENAME copyright) -- cgit v1.2.3 From f68711ed02ac2041f8760c8dc32b9b3804422189 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Fri, 9 Feb 2018 07:15:21 +0900 Subject: [libgeotiff] fix install directory for cmake configurations Signed-off-by: Hiroshi Miura --- ports/libgeotiff/fix-directory-output.patch | 14 ++++++++++++++ ports/libgeotiff/portfile.cmake | 4 ++++ 2 files changed, 18 insertions(+) create mode 100644 ports/libgeotiff/fix-directory-output.patch diff --git a/ports/libgeotiff/fix-directory-output.patch b/ports/libgeotiff/fix-directory-output.patch new file mode 100644 index 000000000..82032daa1 --- /dev/null +++ b/ports/libgeotiff/fix-directory-output.patch @@ -0,0 +1,14 @@ +diff -urN a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +--- a/cmake/CMakeLists.txt 2016-08-12 00:40:10.000000000 +0900 ++++ b/cmake/CMakeLists.txt 2018-02-09 07:12:40.422110239 +0900 +@@ -10,8 +10,8 @@ + set (INSTALL_CMAKE_DIR "share/cmake/${PROJECT_NAME}") + set (PROJECT_ROOT_DIR "../../..") + else () +- set (INSTALL_CMAKE_DIR "cmake") +- set (PROJECT_ROOT_DIR "..") ++ set (INSTALL_CMAKE_DIR "share/${PROJECT_NAME}") ++ set (PROJECT_ROOT_DIR "../..") + endif () + + configure_file (project-config.cmake.in project-config.cmake @ONLY) diff --git a/ports/libgeotiff/portfile.cmake b/ports/libgeotiff/portfile.cmake index d62c26d82..5920a0853 100644 --- a/ports/libgeotiff/portfile.cmake +++ b/ports/libgeotiff/portfile.cmake @@ -11,6 +11,10 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-directory-output.patch") + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) set(BUILD_SHARED_LIBS ON) else() -- cgit v1.2.3 From fc888e46178675bb708448f24cb07a72b13d7cd1 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Fri, 9 Feb 2018 13:29:00 +0900 Subject: fix tiff detection error when static build --- ports/libgeotiff/fix-cmake-tiff-detection.patch | 21 +++++++++++++++++++++ ports/libgeotiff/portfile.cmake | 7 ++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 ports/libgeotiff/fix-cmake-tiff-detection.patch diff --git a/ports/libgeotiff/fix-cmake-tiff-detection.patch b/ports/libgeotiff/fix-cmake-tiff-detection.patch new file mode 100644 index 000000000..166aa7d44 --- /dev/null +++ b/ports/libgeotiff/fix-cmake-tiff-detection.patch @@ -0,0 +1,21 @@ +--- a/CMakeLists.txt 2016-08-12 00:40:12.000000000 +0900 ++++ b/CMakeLists.txt 2018-02-09 13:27:05.721561755 +0900 +@@ -192,7 +192,8 @@ + IF(TIFF_FOUND) + # Confirm required API is available + INCLUDE(CheckFunctionExists) +- SET(CMAKE_REQUIRED_LIBRARIES ${TIFF_LIBRARIES}) ++ FIND_PACKAGE(LibLZMA) ++ SET(CMAKE_REQUIRED_LIBRARIES ${TIFF_LIBRARIES} ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES} ${LIBLZMA_LIBRARIES}) + + CHECK_FUNCTION_EXISTS(TIFFOpen HAVE_TIFFOPEN) + IF(NOT HAVE_TIFFOPEN) +@@ -205,7 +206,7 @@ + SET(TIFF_FOUND) # ReSET to NOT found for TIFF library + MESSAGE(FATAL_ERROR "Failed to link with libtiff - TIFFMergeFieldInfo function not found. libtiff 3.6.0 Beta or later required. Please upgrade or use an older version of libgeotiff") + ENDIF() +- ++ SET(CMAKE_REQUIRED_LIBRARIES) + INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR}) + ADD_DEFINITIONS(-DHAVE_TIFF=1) + ENDIF(TIFF_FOUND) diff --git a/ports/libgeotiff/portfile.cmake b/ports/libgeotiff/portfile.cmake index 5920a0853..b974ebc35 100644 --- a/ports/libgeotiff/portfile.cmake +++ b/ports/libgeotiff/portfile.cmake @@ -13,7 +13,8 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} - PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-directory-output.patch") + PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-directory-output.patch" + "${CMAKE_CURRENT_LIST_DIR}/fix-cmake-tiff-detection.patch") if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) set(BUILD_SHARED_LIBS ON) @@ -26,6 +27,10 @@ vcpkg_configure_cmake( PREFER_NINJA OPTIONS -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -DWITH_UTILITIES=OFF + -DWITH_TIFF=ON + -DWITH_PROJ4=ON + -DWITH_ZLIB=ON + -DWITH_JPEG=ON ) vcpkg_build_cmake() -- cgit v1.2.3 From e8899b37d28fe5b4d5843b2c2b44a939c8030a3f Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Fri, 9 Feb 2018 13:39:22 +0900 Subject: [libgeotiff] remove installed dlls when static build --- ports/libgeotiff/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/libgeotiff/portfile.cmake b/ports/libgeotiff/portfile.cmake index b974ebc35..36be37bb6 100644 --- a/ports/libgeotiff/portfile.cmake +++ b/ports/libgeotiff/portfile.cmake @@ -39,3 +39,7 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libgeotiff RENAME copyright) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/bin) +endif() \ No newline at end of file -- cgit v1.2.3 From ee84a44871daf45c9f1b127da0a1a4972cfe161f Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Fri, 9 Feb 2018 13:44:45 +0900 Subject: [libgeotiff] update description --- ports/libgeotiff/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libgeotiff/CONTROL b/ports/libgeotiff/CONTROL index ba7bc134d..8950200d9 100644 --- a/ports/libgeotiff/CONTROL +++ b/ports/libgeotiff/CONTROL @@ -1,4 +1,4 @@ Source: libgeotiff Version: 1.4.2 -Description: libgeotiff. +Description: Libgeotiff is an open source library normally hosted on top of ​libtiff for reading, and writing GeoTIFF information tags. Build-Depends: tiff, proj4, zlib, libjpeg-turbo -- cgit v1.2.3