From 8c242b4457233c82b679a0c4c638573e4833637b Mon Sep 17 00:00:00 2001 From: Long Huan <8551701+longhuan2018@users.noreply.github.com> Date: Thu, 27 May 2021 06:02:26 +0800 Subject: [PATCH] [libspatialindex] Update to 1.9.3 (#17506) * update to 1.9.3 * update version * fix static build failed * Update ports/libspatialindex/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * format * Update libspatialindex.json * Update ports/libspatialindex/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libspatialindex/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update libspatialindex.json * Update ports/libspatialindex/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update libspatialindex.json Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> --- ports/libspatialindex/CONTROL | 6 --- ports/libspatialindex/portfile.cmake | 13 ++--- ports/libspatialindex/static.patch | 76 ++++++++++++++++++++++++---- ports/libspatialindex/vcpkg.json | 9 ++++ versions/baseline.json | 2 +- versions/l-/libspatialindex.json | 5 ++ 6 files changed, 88 insertions(+), 23 deletions(-) delete mode 100644 ports/libspatialindex/CONTROL create mode 100644 ports/libspatialindex/vcpkg.json diff --git a/ports/libspatialindex/CONTROL b/ports/libspatialindex/CONTROL deleted file mode 100644 index aa1da63c19..0000000000 --- a/ports/libspatialindex/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: libspatialindex -Version: 1.9.0 -Homepage: http://libspatialindex.github.com -Description: C++ implementation of R*-tree, an MVR-tree and a TPR-tree with C API. -Build-Depends: zlib - diff --git a/ports/libspatialindex/portfile.cmake b/ports/libspatialindex/portfile.cmake index 3c800b49a3..17d89d36c5 100644 --- a/ports/libspatialindex/portfile.cmake +++ b/ports/libspatialindex/portfile.cmake @@ -1,16 +1,18 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libspatialindex/libspatialindex - REF 1.9.0 - SHA512 368537e9bfe52db96486a1febfabe035f9f7714fd1cb50450e3ab89d51c5ffffb0e2ea219e08bee34f772ba9813a3a7f9e63d8b8946887ce83811ef68d17d1cc + REF 1.9.3 + SHA512 d4c608abbd631dc163b7b4fb6bf09dee3e85ce692a5f8875d51f05a26e09c75cd17dff1ed9d2c232a071f0f5864d21d877b4cbc252f3416896db24dfa3fa18cb HEAD_REF master - PATCHES + PATCHES static.patch ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS -DCMAKE_DEBUG_POSTFIX=d -DSIDX_BUILD_TESTS:BOOL=OFF + OPTIONS + -DCMAKE_DEBUG_POSTFIX=d + -DSIDX_BUILD_TESTS:BOOL=OFF ) vcpkg_install_cmake() @@ -21,5 +23,4 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libspatialindex) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libspatialindex/COPYING ${CURRENT_PACKAGES_DIR}/share/libspatialindex/copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libspatialindex/static.patch b/ports/libspatialindex/static.patch index bf783bcca3..1ce2b9d6a1 100644 --- a/ports/libspatialindex/static.patch +++ b/ports/libspatialindex/static.patch @@ -1,21 +1,77 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c34ee8d71..84e4a9247 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,7 +43,7 @@ SET(SIDX_VERSION_MINOR "9") + SET(SIDX_VERSION_PATCH "3") + SET(SIDX_LIB_VERSION "6.1.1") + SET(SIDX_LIB_SOVERSION "6") +-SET(BUILD_SHARED_LIBS ON) ++option(BUILD_SHARED_LIBS "Build shared libs" ON) + + + set(SIDX_VERSION_STRING "${SIDX_VERSION_MAJOR}.${SIDX_VERSION_MINOR}.${SIDX_VERSION_PATCH}") + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index e6b733bd..8f227ab0 100644 +index 90f4501bc..aad327181 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -194,9 +194,13 @@ if (NOT WITH_STATIC_LASZIP) - endif() - endif() +@@ -188,9 +188,13 @@ set(SIDX_SOURCES + #endif() --add_library(${SIDX_LIB_NAME} SHARED ${SIDX_SOURCES}) + +-add_library(${SIDX_LIB_NAME} ${SIDX_SOURCES}) - --add_library(${SIDX_C_LIB_NAME} SHARED ${SIDX_CAPI_CPP}) +-add_library(${SIDX_C_LIB_NAME} ${SIDX_CAPI_CPP}) +if(BUILD_SHARED_LIBS) -+ add_library(${SIDX_LIB_NAME} SHARED ${SIDX_SOURCES}) -+ add_library(${SIDX_C_LIB_NAME} SHARED ${SIDX_CAPI_CPP}) ++ add_library(${SIDX_LIB_NAME} SHARED ${SIDX_SOURCES}) ++ add_library(${SIDX_C_LIB_NAME} SHARED ${SIDX_CAPI_CPP}) +else(BUILD_SHARED_LIBS) -+ add_library(${SIDX_LIB_NAME} STATIC ${SIDX_SOURCES}) -+ add_library(${SIDX_C_LIB_NAME} STATIC ${SIDX_CAPI_CPP}) ++ add_library(${SIDX_LIB_NAME} STATIC ${SIDX_SOURCES}) ++ add_library(${SIDX_C_LIB_NAME} STATIC ${SIDX_CAPI_CPP}) +endif(BUILD_SHARED_LIBS) target_link_libraries(${SIDX_C_LIB_NAME} ${SIDX_LIB_NAME} +@@ -208,9 +212,10 @@ if(WIN32) + target_compile_options(${SIDX_LIB_NAME} PRIVATE "/wd4068") + target_compile_options(${SIDX_C_LIB_NAME} PRIVATE "/wd4068") + +- target_compile_definitions(${SIDX_C_LIB_NAME} PRIVATE "-DSIDX_DLL_EXPORT=1") +- target_compile_definitions(${SIDX_LIB_NAME} PRIVATE "-DSIDX_DLL_EXPORT=1") +- if (NOT WITH_STATIC_SIDX) ++ if (BUILD_SHARED_LIBS) ++ target_compile_definitions(${SIDX_C_LIB_NAME} PRIVATE "-DSIDX_DLL_EXPORT=1") ++ target_compile_definitions(${SIDX_LIB_NAME} PRIVATE "-DSIDX_DLL_EXPORT=1") ++ else() + target_compile_definitions(${SIDX_LIB_NAME} PRIVATE "-DSIDX_DLL_IMPORT=1") + target_compile_definitions(${SIDX_C_LIB_NAME} PRIVATE "-DSIDX_DLL_IMPORT=1") + endif() + +diff --git a/include/spatialindex/capi/sidx_export.h b/include/spatialindex/capi/sidx_export.h +index b6c84f1ef..7b0a39364 100644 +--- a/include/spatialindex/capi/sidx_export.h ++++ b/include/spatialindex/capi/sidx_export.h +@@ -29,7 +29,7 @@ + #pragma once + + #ifndef SIDX_C_DLL +-#if defined(_MSC_VER) ++#if defined(_MSC_VER) && defined(SIDX_DLL_EXPORT) + # define SIDX_C_DLL __declspec(dllexport) + # define SIDX_DLL __declspec(dllexport) + #else + +diff --git a/include/spatialindex/tools/Tools.h b/include/spatialindex/tools/Tools.h +index 322bc819e..46b62fa00 100644 +--- a/include/spatialindex/tools/Tools.h ++++ b/include/spatialindex/tools/Tools.h +@@ -46,7 +46,7 @@ + #ifdef SIDX_DLL_EXPORT + #define SIDX_DLL __declspec(dllexport) + #else +- #define SIDX_DLL __declspec(dllimport) ++ #define SIDX_DLL + #endif + + // Nuke this annoying warning. See http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html diff --git a/ports/libspatialindex/vcpkg.json b/ports/libspatialindex/vcpkg.json new file mode 100644 index 0000000000..9caadda04f --- /dev/null +++ b/ports/libspatialindex/vcpkg.json @@ -0,0 +1,9 @@ +{ + "name": "libspatialindex", + "version": "1.9.3", + "description": "C++ implementation of R*-tree, an MVR-tree and a TPR-tree with C API.", + "homepage": "http://libspatialindex.github.com", + "dependencies": [ + "zlib" + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 1f17b61e4b..4f9f7a4a14 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3521,7 +3521,7 @@ "port-version": 4 }, "libspatialindex": { - "baseline": "1.9.0", + "baseline": "1.9.3", "port-version": 0 }, "libspatialite": { diff --git a/versions/l-/libspatialindex.json b/versions/l-/libspatialindex.json index f68403cd10..9f034e9d08 100644 --- a/versions/l-/libspatialindex.json +++ b/versions/l-/libspatialindex.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "2e1fceafc0be5ea8fd1b2961104f46a5e29c9a6c", + "version": "1.9.3", + "port-version": 0 + }, { "git-tree": "4313465aee191d0e9e0154f01beaf2e4e47a3e4f", "version-string": "1.9.0",