From cd6c4e19fa4a7fcffdace70988454e51ddc35376 Mon Sep 17 00:00:00 2001 From: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> Date: Sat, 1 Aug 2020 02:35:04 +0800 Subject: [osgearth] update to 3.0 (#12531) * [osgearth] update to 3.0 * delete controlfile * fixjsonfile * Update ports/osgearth/portfile.cmake * fixJsonfile * deletejsonfile Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> --- ports/osgearth/CONTROL | 3 +- ports/osgearth/RocksDB.patch | 163 ++++++++++++++++++++---------------------- ports/osgearth/portfile.cmake | 15 ++-- 3 files changed, 87 insertions(+), 94 deletions(-) diff --git a/ports/osgearth/CONTROL b/ports/osgearth/CONTROL index 74f1c5875..3585c467e 100644 --- a/ports/osgearth/CONTROL +++ b/ports/osgearth/CONTROL @@ -1,4 +1,5 @@ Source: osgearth -Version: 2.10.2-1 +Version: 3.0 +Homepage: https://github.com/gwaldron/osgearth Description: osgEarth - Dynamic map generation toolkit for OpenSceneGraph Copyright 2015 Pelican Mapping. Build-Depends: osg[plugins] diff --git a/ports/osgearth/RocksDB.patch b/ports/osgearth/RocksDB.patch index 07fd7e603..c73cdad19 100644 --- a/ports/osgearth/RocksDB.patch +++ b/ports/osgearth/RocksDB.patch @@ -1,84 +1,79 @@ -diff --git a/CMakeModules/FindRocksDB.cmake b/CMakeModules/FindRocksDB.cmake -index 109b383..8382ed9 100644 ---- a/CMakeModules/FindRocksDB.cmake -+++ b/CMakeModules/FindRocksDB.cmake -@@ -40,5 +40,49 @@ find_package_handle_standard_args(ROCKSDB - "Could NOT find ROCKSDB" - ) - -+if(ROCKSDB_FOUND) -+ FIND_PACKAGE(ZLIB REQUIRED) -+ -+ include(SelectLibraryConfigurations) -+ # Find Snappy library -+ find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd) -+ find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy) -+ select_library_configurations(SNAPPY) -+ find_package_handle_standard_args(SNAPPY -+ FOUND_VAR -+ SNAPPY_FOUND -+ REQUIRED_VARS -+ SNAPPY_LIBRARY -+ FAIL_MESSAGE -+ "Could NOT find SNAPPY" -+ ) -+ -+ # Find LZ4 library -+ find_library(LZ4_LIBRARY_DEBUG NAMES lz4d) -+ find_library(LZ4_LIBRARY_RELEASE NAMES lz4) -+ select_library_configurations(LZ4) -+ find_package_handle_standard_args(LZ4 -+ FOUND_VAR -+ LZ4_FOUND -+ REQUIRED_VARS -+ LZ4_LIBRARY -+ FAIL_MESSAGE -+ "Could NOT find LZ4" -+ ) -+ -+ # Find ZSTD library -+ find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd) -+ find_library(ZSTD_LIBRARY_RELEASE NAMES zstd) -+ select_library_configurations(ZSTD) -+ find_package_handle_standard_args(ZSTD -+ FOUND_VAR -+ ZSTD_FOUND -+ REQUIRED_VARS -+ ZSTD_LIBRARY -+ FAIL_MESSAGE -+ "Could NOT find ZSTD_" -+ ) -+endif(ROCKSDB_FOUND) -+ - set(ROCKSDB_INCLUDE_DIRS ${ROCKSDB_INCLUDE_DIR} ) - set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY}) -- -- - -diff --git a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt -index 68ad85d..86bb18a 100644 ---- a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt -+++ b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt -@@ -16,7 +16,19 @@ SET(TARGET_SRC - RocksDBCacheDriver.cpp - ) - --SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY) -+if(SNAPPY_FOUND) -+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${SNAPPY_LIBRARY}) -+endif(SNAPPY_FOUND) -+ -+if(LZ4_FOUND) -+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${LZ4_LIBRARY}) -+endif(LZ4_FOUND) -+ -+if(ZSTD_FOUND) -+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${ZSTD_LIBRARY}) -+endif(ZSTD_FOUND) -+ -+SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY ROCKSDB_DEPENDENT_LIBRARY) - - IF(MSVC) - SET(TARGET_EXTERNAL_LIBRARIES ws2_32 winmm rpcrt4 shlwapi) -- -- \ No newline at end of file +diff --git a/CMakeModules/FindRocksDB.cmake b/CMakeModules/FindRocksDB.cmake +index b0692b0..984d3f2 100644 +--- a/CMakeModules/FindRocksDB.cmake ++++ b/CMakeModules/FindRocksDB.cmake +@@ -39,5 +39,49 @@ find_package_handle_standard_args(ROCKSDB + "Could NOT find ROCKSDB" + ) + ++if(ROCKSDB_FOUND) ++ FIND_PACKAGE(ZLIB REQUIRED) ++ ++ include(SelectLibraryConfigurations) ++ # Find Snappy library ++ find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd) ++ find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy) ++ select_library_configurations(SNAPPY) ++ find_package_handle_standard_args(SNAPPY ++ FOUND_VAR ++ SNAPPY_FOUND ++ REQUIRED_VARS ++ SNAPPY_LIBRARY ++ FAIL_MESSAGE ++ "Could NOT find SNAPPY" ++ ) ++ ++ # Find LZ4 library ++ find_library(LZ4_LIBRARY_DEBUG NAMES lz4d) ++ find_library(LZ4_LIBRARY_RELEASE NAMES lz4) ++ select_library_configurations(LZ4) ++ find_package_handle_standard_args(LZ4 ++ FOUND_VAR ++ LZ4_FOUND ++ REQUIRED_VARS ++ LZ4_LIBRARY ++ FAIL_MESSAGE ++ "Could NOT find LZ4" ++ ) ++ ++ # Find ZSTD library ++ find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd) ++ find_library(ZSTD_LIBRARY_RELEASE NAMES zstd) ++ select_library_configurations(ZSTD) ++ find_package_handle_standard_args(ZSTD ++ FOUND_VAR ++ ZSTD_FOUND ++ REQUIRED_VARS ++ ZSTD_LIBRARY ++ FAIL_MESSAGE ++ "Could NOT find ZSTD_" ++ ) ++endif(ROCKSDB_FOUND) ++ + set(ROCKSDB_INCLUDE_DIRS ${ROCKSDB_INCLUDE_DIR} ) + set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY}) +diff --git a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt +index ecaac34..b4ec764 100644 +--- a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt ++++ b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt +@@ -34,7 +34,19 @@ IF(ROCKSDB_FOUND OR RocksDB_FOUND) + RocksDBCacheDriver.cpp + ) + +- SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY) ++ if(SNAPPY_FOUND) ++ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${SNAPPY_LIBRARY}) ++ endif(SNAPPY_FOUND) ++ ++ if(LZ4_FOUND) ++ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${LZ4_LIBRARY}) ++ endif(LZ4_FOUND) ++ ++ if(ZSTD_FOUND) ++ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${ZSTD_LIBRARY}) ++ endif(ZSTD_FOUND) ++ ++ SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY ROCKSDB_DEPENDENT_LIBRARY) + + IF(MSVC) + SET(TARGET_EXTERNAL_LIBRARIES ws2_32 winmm rpcrt4 shlwapi) diff --git a/ports/osgearth/portfile.cmake b/ports/osgearth/portfile.cmake index 8f74dea63..3be639cb4 100644 --- a/ports/osgearth/portfile.cmake +++ b/ports/osgearth/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) file(GLOB OSG_PLUGINS_SUBDIR ${CURRENT_INSTALLED_DIR}/tools/osg/osgPlugins-*) @@ -12,11 +10,11 @@ string(REPLACE "${CURRENT_INSTALLED_DIR}/tools/osg/" "" OSG_PLUGINS_SUBDIR "${OS vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO gwaldron/osgearth - REF osgearth-2.10.2 - SHA512 fa306a82374716dafae9d834ed0fb07a7369ae0961696de36b6e2af45bc150040295985d9b9781ab713fd0707691451a6a8f173b34253749ab22764f51e60045 + REF 90ad04f281cbc87ffc45bed847ebaaecb188e593 #version 3.0 + SHA512 d1d59ae65cb4ef8a71e01b42411029e61bef20e2fd6d95b81c091d7d32b8c30f96d3156d7fd28e177ca83fd74ed113b9e31bf5ef360757524beb7cec7ced4996 HEAD_REF master PATCHES - RocksDB.patch + RocksDB.patch ) vcpkg_configure_cmake( @@ -27,7 +25,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() #Release -set(OSGEARTH_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/osgearth) +set(OSGEARTH_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/${PORT}) set(OSGEARTH_TOOL_PLUGIN_PATH ${OSGEARTH_TOOL_PATH}/${OSG_PLUGINS_SUBDIR}) file(MAKE_DIRECTORY ${OSGEARTH_TOOL_PATH}) @@ -45,7 +43,7 @@ file(REMOVE_RECURSE ${OSGDB_PLUGINS}) #Debug file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -set(OSGEARTH_DEBUG_TOOL_PATH ${CURRENT_PACKAGES_DIR}/debug/tools/osgearth) +set(OSGEARTH_DEBUG_TOOL_PATH ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}) set(OSGEARTH_DEBUG_TOOL_PLUGIN_PATH ${OSGEARTH_DEBUG_TOOL_PATH}/${OSG_PLUGINS_SUBDIR}) file(MAKE_DIRECTORY ${OSGEARTH_DEBUG_TOOL_PATH}) @@ -62,5 +60,4 @@ file(REMOVE_RECURSE ${OSGDB_DEBUG_PLUGINS}) # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/osgearth) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/osgearth/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/osgearth/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -- cgit v1.2.3