From 77df385ff64d70bea9a86152fa0307d9381cefe9 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Thu, 28 Dec 2023 09:06:40 +0100 Subject: [PATCH] [shapelib] Update to 1.6.0 (#35840) --- ports/shapelib/fix-usage.patch | 34 ----------- ports/shapelib/option-build-test.patch | 13 ---- ports/shapelib/portfile.cmake | 84 +++++++++++++++++--------- ports/shapelib/vcpkg.json | 12 +++- versions/baseline.json | 4 +- versions/s-/shapelib.json | 5 ++ 6 files changed, 70 insertions(+), 82 deletions(-) delete mode 100644 ports/shapelib/fix-usage.patch delete mode 100644 ports/shapelib/option-build-test.patch diff --git a/ports/shapelib/fix-usage.patch b/ports/shapelib/fix-usage.patch deleted file mode 100644 index 8b22423fa2..0000000000 --- a/ports/shapelib/fix-usage.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b3b3b51..ea3f129 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -73,8 +73,8 @@ set( - - # Export build information to help other projects link installed - # shapelib software. Only one of these signatures is required --# for the export_shp name. --install(EXPORT export_shp DESTINATION ${CMAKE_INSTALL_SHP_DATADIR}) -+# for the shpConfig name. -+install(EXPORT shpConfig DESTINATION ${CMAKE_INSTALL_SHP_DATADIR}) - - # Initial boilerplate done, now build library and executables. - -@@ -127,12 +127,17 @@ if(USE_RPATH) - endif(USE_RPATH) - - install(TARGETS shp -- EXPORT export_shp -+ EXPORT shpConfig - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ) - -+INSTALL(EXPORT shpConfig -+ DESTINATION share/shp -+) -+ -+ - # executables to be built and installed. - set(executables - shpcreate diff --git a/ports/shapelib/option-build-test.patch b/ports/shapelib/option-build-test.patch deleted file mode 100644 index c91410f386..0000000000 --- a/ports/shapelib/option-build-test.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c3ef935..845ec06 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -148,7 +148,7 @@ set(executables - find_program(BASH_EXECUTABLE bash) - find_program(SED_EXECUTABLE sed) - if(BASH_EXECUTABLE AND SED_EXECUTABLE) -- set(BUILD_TEST ON) -+ option(BUILD_TEST "" ON) - else(BASH_EXECUTABLE AND SED_EXECUTABLE) - message(STATUS "WARNING: sed or bash not available so disabling testing") - endif(BASH_EXECUTABLE AND SED_EXECUTABLE) diff --git a/ports/shapelib/portfile.cmake b/ports/shapelib/portfile.cmake index 89c00b2e13..146b05b91f 100644 --- a/ports/shapelib/portfile.cmake +++ b/ports/shapelib/portfile.cmake @@ -1,50 +1,74 @@ -set(SHAPELIB_VERSION 1.5.0) -set(SHAPELIB_HASH 230939afb33aee042808a32b38ee9dfc7ec1f39432e5a4ebe3fda99c2f87bfbebc91830d4e21691c51aae3f4bb65d7e71e7061472bb08124dcd3402c46800d6c) - vcpkg_download_distfile(ARCHIVE - URLS "http://download.osgeo.org/shapelib/shapelib-${SHAPELIB_VERSION}.zip" - FILENAME "shapelib-${SHAPELIB_VERSION}.zip" - SHA512 ${SHAPELIB_HASH} + URLS "http://download.osgeo.org/shapelib/shapelib-${VERSION}.zip" + FILENAME "shapelib-${VERSION}.zip" + SHA512 f3f43f2028fe442e020558de2559b24eae9c7a1d0c84cc242f23ea985cf1fb5ff39fbfef7738f9b8ef5df9a5d0b9f3e891a61b3d5fbbe5b224f41a46589723a3 ) vcpkg_extract_source_archive( SOURCE_PATH - ARCHIVE ${ARCHIVE} - PATCHES - option-build-test.patch + ARCHIVE "${ARCHIVE}" +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS options + FEATURES + contrib BUILD_SHAPELIB_CONTRIB ) vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS - -DBUILD_TEST=OFF + ${options} + -DBUILD_TESTING=OFF ) vcpkg_cmake_install() - -vcpkg_cmake_config_fixup(PACKAGE_NAME shp) +vcpkg_copy_pdbs() +vcpkg_cmake_config_fixup() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -file(GLOB EXES "${CURRENT_PACKAGES_DIR}/bin/*.exe") -if(EXES) - file(COPY ${EXES} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/shapelib") - file(REMOVE ${EXES}) +vcpkg_copy_tools( + TOOL_NAMES + dbfadd + dbfcreate + dbfdump + shpadd + shpcreate + shpdump + shprewind + shptreedump + AUTO_CLEAN +) +if(BUILD_SHAPELIB_CONTRIB) + vcpkg_copy_tools( + TOOL_NAMES + csv2shp + dbfcat + dbfinfo + Shape_PointInPoly + shpcat + shpcentrd + shpdata + shpdxf + shpfix + shpinfo + shpsort + shpwkb + AUTO_CLEAN + ) endif() -file(GLOB DEBUG_EXES "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe") -if(DEBUG_EXES) - file(REMOVE ${DEBUG_EXES}) -endif() +vcpkg_install_copyright( + FILE_LIST "${SOURCE_PATH}/LICENSE-LGPL" "${SOURCE_PATH}/LICENSE-MIT" + # Cf. web/license.html + COMMENT [[ +The core portions of the library are made available under two +possible licenses. The licensee can choose to use the code under +either the Library GNU Public License described in LICENSE-LGPL +or under the MIT license described in LICENSE-MIT. -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin") -endif() - -file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) - -vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/shapelib") - -vcpkg_copy_pdbs() +Some auxiliary portions of Shapelib, notably some of the components +in the contrib directory come under slightly different license restrictions. +Check the source files that you are actually using for conditions. +]]) diff --git a/ports/shapelib/vcpkg.json b/ports/shapelib/vcpkg.json index 099b5147ee..99eaaff058 100644 --- a/ports/shapelib/vcpkg.json +++ b/ports/shapelib/vcpkg.json @@ -1,9 +1,9 @@ { "name": "shapelib", - "version": "1.5.0", - "port-version": 4, + "version": "1.6.0", "description": "Shapefile C Library is simple C API for reading and writing ESRI Shapefiles", "homepage": "https://download.osgeo.org/shapelib", + "license": "MIT OR LGPL-2.0-or-later", "dependencies": [ { "name": "vcpkg-cmake", @@ -13,5 +13,11 @@ "name": "vcpkg-cmake-config", "host": true } - ] + ], + "features": { + "contrib": { + "description": "Build utilities (from contrib)", + "license": null + } + } } diff --git a/versions/baseline.json b/versions/baseline.json index 318b604934..5b7d100d69 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7849,8 +7849,8 @@ "port-version": 0 }, "shapelib": { - "baseline": "1.5.0", - "port-version": 4 + "baseline": "1.6.0", + "port-version": 0 }, "shiftmedia-libgcrypt": { "baseline": "1.10.1-1", diff --git a/versions/s-/shapelib.json b/versions/s-/shapelib.json index 2cd29737ec..7c575b57d2 100644 --- a/versions/s-/shapelib.json +++ b/versions/s-/shapelib.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "6b89a941de4bb79399a81b9199cf15e66a882956", + "version": "1.6.0", + "port-version": 0 + }, { "git-tree": "07bc870ae6b0fd620c817bd35c8ec499ecbf4f22", "version": "1.5.0",