From c514f9e27c5df854dbfa536d902e7ab145241514 Mon Sep 17 00:00:00 2001 From: wzj219 <122512328+wzj219@users.noreply.github.com> Date: Sat, 4 Feb 2023 04:38:25 +0800 Subject: [PATCH] [blosc] Update to 1.21.3 (#28986) * [blosc] Update to 1.21.3 * Update version * [blosc] Update to 1.21.3 * update version * [blosc] update to 1.21.3 * [blosc] Modify review comments * [blosc]Modify CI Error * [blosc]Modify review comments * [blosc]Modify the patch name * [blosc]modify CI error * [blosc]update version * [blosc]update version * update version * update version * update git-tree --------- Co-authored-by: Lily Wang <494550702@qq.com> --- ports/blosc/0001-find-deps.patch | 52 --------- ports/blosc/0001-fix-CMake-config.patch | 117 +++++++++++++++++++++ ports/blosc/0002-export-blosc-config.patch | 66 ------------ ports/blosc/portfile.cmake | 61 ++++++----- ports/blosc/vcpkg.json | 12 ++- ports/openvdb/0003-fix-cmake.patch | 10 +- ports/openvdb/vcpkg.json | 1 + versions/b-/blosc.json | 5 + versions/baseline.json | 6 +- versions/o-/openvdb.json | 5 + 10 files changed, 181 insertions(+), 154 deletions(-) delete mode 100644 ports/blosc/0001-find-deps.patch create mode 100644 ports/blosc/0001-fix-CMake-config.patch delete mode 100644 ports/blosc/0002-export-blosc-config.patch diff --git a/ports/blosc/0001-find-deps.patch b/ports/blosc/0001-find-deps.patch deleted file mode 100644 index 33407b9b315..00000000000 --- a/ports/blosc/0001-find-deps.patch +++ /dev/null @@ -1,52 +0,0 @@ -diff --git a/cmake/FindLZ4.cmake b/cmake/FindLZ4.cmake -index e581a80..8ce17c5 100644 ---- a/cmake/FindLZ4.cmake -+++ b/cmake/FindLZ4.cmake -@@ -1,10 +1,13 @@ --find_path(LZ4_INCLUDE_DIR lz4.h) -+find_path(LZ4_INCLUDE_DIRS NAMES lz4.h) - --find_library(LZ4_LIBRARY NAMES lz4) -+find_library(LZ4_LIBRARY_DEBUG NAMES lz4d) -+find_library(LZ4_LIBRARY_RELEASE NAMES lz4) - --if (LZ4_INCLUDE_DIR AND LZ4_LIBRARY) -- set(LZ4_FOUND TRUE) -- message(STATUS "Found LZ4 library: ${LZ4_LIBRARY}") --else () -- message(STATUS "No LZ4 library found. Using internal sources.") --endif () -+include(SelectLibraryConfigurations) -+select_library_configurations(LZ4) -+ -+include(FindPackageHandleStandardArgs) -+find_package_handle_standard_args( -+ LZ4 -+ REQUIRED_VARS LZ4_LIBRARIES LZ4_INCLUDE_DIRS -+) -diff --git a/cmake/FindSnappy.cmake b/cmake/FindSnappy.cmake -index 688d4d5..c8b9a05 100644 ---- a/cmake/FindSnappy.cmake -+++ b/cmake/FindSnappy.cmake -@@ -1,10 +1,13 @@ --find_path(SNAPPY_INCLUDE_DIR snappy-c.h) -+find_path(SNAPPY_INCLUDE_DIR snappy.h) - --find_library(SNAPPY_LIBRARY NAMES snappy) -+find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd) -+find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy) - --if (SNAPPY_INCLUDE_DIR AND SNAPPY_LIBRARY) -- set(SNAPPY_FOUND TRUE) -- message(STATUS "Found SNAPPY library: ${SNAPPY_LIBRARY}") --else () -- message(STATUS "No snappy found. Using internal sources.") --endif () -+include(SelectLibraryConfigurations) -+select_library_configurations(SNAPPY) -+ -+include(FindPackageHandleStandardArgs) -+FIND_PACKAGE_HANDLE_STANDARD_ARGS( -+ SNAPPY DEFAULT_MSG -+ SNAPPY_LIBRARY SNAPPY_INCLUDE_DIR -+) diff --git a/ports/blosc/0001-fix-CMake-config.patch b/ports/blosc/0001-fix-CMake-config.patch new file mode 100644 index 00000000000..a1661794de9 --- /dev/null +++ b/ports/blosc/0001-fix-CMake-config.patch @@ -0,0 +1,117 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 54d4817..07b551a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -134,7 +134,7 @@ include(GNUInstallDirs) + + if(NOT DEACTIVATE_LZ4) + if(PREFER_EXTERNAL_LZ4) +- find_package(LZ4) ++ find_package(LZ4 NAMES lz4 CONFIG REQUIRED) + else() + message(STATUS "Using LZ4 internal sources.") + endif() +@@ -144,7 +144,7 @@ if(NOT DEACTIVATE_LZ4) + endif() + + if(NOT DEACTIVATE_SNAPPY) +- find_package(Snappy) ++ find_package(Snappy CONFIG REQUIRED) + if(SNAPPY_FOUND) + message(STATUS "Activating support for SNAPPY.") + set(HAVE_SNAPPY TRUE) +@@ -157,7 +157,7 @@ if(NOT DEACTIVATE_ZLIB) + # import the ZLIB_ROOT environment variable to help finding the zlib library + if(PREFER_EXTERNAL_ZLIB) + set(ZLIB_ROOT $ENV{ZLIB_ROOT}) +- find_package(ZLIB) ++ find_package(ZLIB REQUIRED) + if(NOT ZLIB_FOUND ) + message(STATUS "No zlib found. Using internal sources.") + endif() +@@ -171,7 +171,7 @@ endif() + + if(NOT DEACTIVATE_ZSTD) + if(PREFER_EXTERNAL_ZSTD) +- find_package(Zstd) ++ find_package(zstd CONFIG REQUIRED) + else() + message(STATUS "Using ZSTD internal sources.") + endif() +diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt +index 70f80a2..83d90d8 100644 +--- a/blosc/CMakeLists.txt ++++ b/blosc/CMakeLists.txt +@@ -88,7 +88,7 @@ endif(WIN32) + + if(NOT DEACTIVATE_LZ4) + if(LZ4_FOUND) +- set(LIBS ${LIBS} ${LZ4_LIBRARY}) ++ set(LIBS ${LIBS} lz4::lz4) + else(LZ4_FOUND) + file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) + set(SOURCES ${SOURCES} ${LZ4_FILES}) +@@ -98,7 +98,7 @@ endif(NOT DEACTIVATE_LZ4) + + if(NOT DEACTIVATE_SNAPPY) + if(SNAPPY_FOUND) +- set(LIBS ${LIBS} ${SNAPPY_LIBRARY}) ++ set(LIBS ${LIBS} Snappy::snappy) + else(SNAPPY_FOUND) + file(GLOB SNAPPY_FILES ${SNAPPY_LOCAL_DIR}/*.cc) + set(SOURCES ${SOURCES} ${SNAPPY_FILES}) +@@ -108,7 +108,7 @@ endif(NOT DEACTIVATE_SNAPPY) + + if(NOT DEACTIVATE_ZLIB) + if(ZLIB_FOUND) +- set(LIBS ${LIBS} ${ZLIB_LIBRARY}) ++ set(LIBS ${LIBS} ZLIB::ZLIB) + else(ZLIB_FOUND) + file(GLOB ZLIB_FILES ${ZLIB_LOCAL_DIR}/*.c) + set(SOURCES ${SOURCES} ${ZLIB_FILES}) +@@ -136,6 +136,7 @@ if (NOT DEACTIVATE_ZSTD) + set(ZSTD_FILES ${ZSTD_COMMON_FILES} ${ZSTD_COMPRESS_FILES} + ${ZSTD_DECOMPRESS_FILES} ${ZSTD_DICT_FILES}) + set(SOURCES ${SOURCES} ${ZSTD_FILES}) ++ set(LIBS ${LIBS} $,zstd::libzstd_shared,zstd::libzstd_static>) + source_group("Zstd" FILES ${ZSTD_FILES}) + endif (ZSTD_FOUND) + endif (NOT DEACTIVATE_ZSTD) +@@ -207,7 +208,7 @@ endif() + + if (BUILD_SHARED) + target_link_libraries(blosc_shared ${LIBS}) +- target_include_directories(blosc_shared PUBLIC ${BLOSC_INCLUDE_DIRS}) ++ target_include_directories(blosc_shared PUBLIC $ $) + endif() + + if (BUILD_TESTS) +@@ -222,7 +223,7 @@ if(BUILD_STATIC) + set_target_properties(blosc_static PROPERTIES PREFIX lib) + endif() + target_link_libraries(blosc_static ${LIBS}) +- target_include_directories(blosc_static PUBLIC ${BLOSC_INCLUDE_DIRS}) ++ target_include_directories(blosc_static PUBLIC $ $) + endif(BUILD_STATIC) + + # install +@@ -230,12 +231,14 @@ if(BLOSC_INSTALL) + install(FILES blosc.h blosc-export.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT DEV) + if(BUILD_SHARED) +- install(TARGETS blosc_shared ++ install(TARGETS blosc_shared EXPORT blosc-config + LIBRARY COMPONENT LIB +- ARCHIVE COMPONENT DEV +- RUNTIME COMPONENT LIB) ++ ARCHIVE COMPONENT LIB ++ RUNTIME COMPONENT BIN) + endif(BUILD_SHARED) + if(BUILD_STATIC) +- install(TARGETS blosc_static COMPONENT DEV) ++ install(TARGETS blosc_static EXPORT blosc-config LIBRARY COMPONENT LIB) + endif(BUILD_STATIC) + endif(BLOSC_INSTALL) ++ ++install(EXPORT blosc-config DESTINATION share/blosc) +\ No newline at end of file diff --git a/ports/blosc/0002-export-blosc-config.patch b/ports/blosc/0002-export-blosc-config.patch deleted file mode 100644 index 31297f732d6..00000000000 --- a/ports/blosc/0002-export-blosc-config.patch +++ /dev/null @@ -1,66 +0,0 @@ -diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt -index f4e5c29..24641ad 100644 ---- a/blosc/CMakeLists.txt -+++ b/blosc/CMakeLists.txt -@@ -122,14 +122,14 @@ endif (NOT DEACTIVATE_ZSTD) - - # targets - if (BUILD_SHARED) -- add_library(blosc_shared SHARED ${SOURCES}) -- set_target_properties(blosc_shared PROPERTIES OUTPUT_NAME blosc) -- set_target_properties(blosc_shared PROPERTIES -+ add_library(blosc SHARED ${SOURCES}) -+ #set_target_properties(blosc_shared PROPERTIES OUTPUT_NAME blosc) -+ set_target_properties(blosc PROPERTIES - VERSION ${version_string} - SOVERSION 1 # Change this when an ABI change happens - ) - set_property( -- TARGET blosc_shared -+ TARGET blosc - APPEND PROPERTY COMPILE_DEFINITIONS BLOSC_SHARED_LIBRARY) - endif() - -@@ -192,8 +192,8 @@ if (BUILD_TESTS) - endif() - - if (BUILD_SHARED) -- target_link_libraries(blosc_shared ${LIBS}) -- target_include_directories(blosc_shared PUBLIC ${BLOSC_INCLUDE_DIRS}) -+ target_link_libraries(blosc ${LIBS}) -+ target_include_directories(blosc PUBLIC $ $) - endif() - - if (BUILD_TESTS) -@@ -202,22 +202,24 @@ if (BUILD_TESTS) - endif() - - if(BUILD_STATIC) -- add_library(blosc_static STATIC ${SOURCES}) -- set_target_properties(blosc_static PROPERTIES OUTPUT_NAME blosc) -+ add_library(blosc STATIC ${SOURCES}) -+ #set_target_properties(blosc_static PROPERTIES OUTPUT_NAME blosc) - if (MSVC) -- set_target_properties(blosc_static PROPERTIES PREFIX lib) -+ #set_target_properties(blosc_static PROPERTIES PREFIX lib) - endif() -- target_link_libraries(blosc_static ${LIBS}) -- target_include_directories(blosc_static PUBLIC ${BLOSC_INCLUDE_DIRS}) -+ target_link_libraries(blosc ${LIBS}) -+ target_include_directories(blosc PUBLIC $ $) - endif(BUILD_STATIC) - - # install - if(BLOSC_INSTALL) - install(FILES blosc.h blosc-export.h DESTINATION include COMPONENT DEV) - if(BUILD_SHARED) -- install(TARGETS blosc_shared LIBRARY DESTINATION ${lib_dir} ARCHIVE DESTINATION ${lib_dir} RUNTIME DESTINATION bin COMPONENT LIB) -+ install(TARGETS blosc EXPORT blosc-config RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) - endif(BUILD_SHARED) - if(BUILD_STATIC) -- install(TARGETS blosc_static LIBRARY DESTINATION ${lib_dir} ARCHIVE DESTINATION ${lib_dir} RUNTIME DESTINATION bin COMPONENT DEV) -+ install(TARGETS blosc EXPORT blosc-config RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) - endif(BUILD_STATIC) - endif(BLOSC_INSTALL) -+ -+install(EXPORT blosc-config DESTINATION share/cmake/blosc) diff --git a/ports/blosc/portfile.cmake b/ports/blosc/portfile.cmake index 01c42a5631b..1ef04dc9075 100644 --- a/ports/blosc/portfile.cmake +++ b/ports/blosc/portfile.cmake @@ -1,45 +1,50 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Blosc/c-blosc - REF 9fae1c9acb659159321aca69aefcdbce663e2374 # v1.18.1 - SHA512 6cc77832100041aca8f320e44aa803adc0d3344b52742b995a3155b953e5d149534de65c8244d964448150b73715a81f54285d7d01f1b45d7b10fe07f5bdb141 + REF "v${VERSION}" + SHA512 e9542aa2d1ebae9f6dcc12916d7ac3b920d771281ab96e2b2d59c2951e5f51d02d2684859b8823643d43d320613fb9dd8a3ea411ade34e66e323fcefa8165a91 HEAD_REF master PATCHES - 0001-find-deps.patch - 0002-export-blosc-config.patch + 0001-fix-CMake-config.patch ) -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(BLOSC_STATIC ON) - set(BLOSC_SHARED OFF) -else() - set(BLOSC_STATIC OFF) - set(BLOSC_SHARED ON) -endif() +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BLOSC_STATIC) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BLOSC_SHARED) -file(REMOVE_RECURSE ${SOURCE_PATH}/internal-complibs) +file(REMOVE_RECURSE "${SOURCE_PATH}/internal-complibs") -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS -DPREFER_EXTERNAL_LZ4=ON - -DPREFER_EXTERNAL_SNAPPY=ON - -DPREFER_EXTERNAL_ZLIB=ON - -DPREFER_EXTERNAL_ZSTD=ON - -DBUILD_TESTS=OFF - -DBUILD_BENCHMARKS=OFF - -DBUILD_STATIC=${BLOSC_STATIC} - -DBUILD_SHARED=${BLOSC_SHARED} +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + DISABLE_PARALLEL_CONFIGURE + OPTIONS + -DPREFER_EXTERNAL_LZ4=ON + -DPREFER_EXTERNAL_ZLIB=ON + -DPREFER_EXTERNAL_ZSTD=ON + -DBUILD_TESTS=OFF + -DBUILD_FUZZERS=OFF + -DBUILD_BENCHMARKS=OFF + -DBUILD_STATIC=${BLOSC_STATIC} + -DBUILD_SHARED=${BLOSC_SHARED} ) -vcpkg_install_cmake() +vcpkg_cmake_install() vcpkg_copy_pdbs() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/blosc) +vcpkg_cmake_config_fixup(CONFIG_PATH share/${PORT}) + +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/blosc-config.cmake" + [[# Generated by CMake]] + [[# Generated by CMake +include(CMakeFindDependencyMacro) +find_dependency(lz4 CONFIG) +find_dependency(zstd CONFIG) +find_dependency(Snappy CONFIG) +find_dependency(ZLIB) +find_dependency(Threads)]] +) # cleanup -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSES/BLOSC.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/blosc RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSES/BLOSC.txt") vcpkg_fixup_pkgconfig() diff --git a/ports/blosc/vcpkg.json b/ports/blosc/vcpkg.json index ba1b06bc181..0d500dabc38 100644 --- a/ports/blosc/vcpkg.json +++ b/ports/blosc/vcpkg.json @@ -1,12 +1,20 @@ { "name": "blosc", - "version-string": "1.18.1", - "port-version": 4, + "version": "1.21.3", "description": "A blocking, shuffling and loss-less compression library that can be faster than `memcpy()`", "homepage": "https://github.com/Blosc/c-blosc", + "license": "BSD-3-Clause", "dependencies": [ "lz4", "snappy", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, "zlib", "zstd" ] diff --git a/ports/openvdb/0003-fix-cmake.patch b/ports/openvdb/0003-fix-cmake.patch index 5e84f6e1f57..ef10257c7aa 100644 --- a/ports/openvdb/0003-fix-cmake.patch +++ b/ports/openvdb/0003-fix-cmake.patch @@ -57,7 +57,7 @@ index 5ff96f6..c3de6f9 100644 if(OpenVDB_USES_ZLIB) list(APPEND _OPENVDB_HIDDEN_DEPENDENCIES ZLIB::ZLIB) diff --git a/openvdb/openvdb/CMakeLists.txt b/openvdb/openvdb/CMakeLists.txt -index 1b48e84..46eeea4 100644 +index 1b48e84..5d055ac 100644 --- a/openvdb/openvdb/CMakeLists.txt +++ b/openvdb/openvdb/CMakeLists.txt @@ -130,9 +130,9 @@ if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_BOOST_VERSION) @@ -109,12 +109,16 @@ index 1b48e84..46eeea4 100644 else() message(WARNING "Blosc support is disabled. It is strongly recommended to " "enable blosc for optimal builds of OpenVDB and to support compatible " -@@ -237,7 +218,7 @@ endif() +@@ -237,7 +218,11 @@ endif() # /usr/local if(USE_BLOSC) - list(APPEND OPENVDB_CORE_DEPENDENT_LIBS Blosc::blosc) -+ list(APPEND OPENVDB_CORE_DEPENDENT_LIBS blosc) ++ if(BUILD_SHARED_LIBS) ++ list(APPEND OPENVDB_CORE_DEPENDENT_LIBS blosc_shared) ++ else() ++ list(APPEND OPENVDB_CORE_DEPENDENT_LIBS blosc_static) ++ endif() endif() if(USE_BLOSC OR USE_ZLIB) diff --git a/ports/openvdb/vcpkg.json b/ports/openvdb/vcpkg.json index 30ce975658f..b1d25e74e0f 100644 --- a/ports/openvdb/vcpkg.json +++ b/ports/openvdb/vcpkg.json @@ -1,6 +1,7 @@ { "name": "openvdb", "version": "10.0.0", + "port-version": 1, "description": "Sparse volume data structure and tools", "homepage": "https://github.com/dreamworksanimation/openvdb", "license": "MPL-2.0", diff --git a/versions/b-/blosc.json b/versions/b-/blosc.json index e0ce0f1cf28..af1083339f2 100644 --- a/versions/b-/blosc.json +++ b/versions/b-/blosc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "08be7493a8b0644853e545f50d243680b1d13fd9", + "version": "1.21.3", + "port-version": 0 + }, { "git-tree": "a95e4b34ff47ed69f3e644405efe80b8c46aee14", "version-string": "1.18.1", diff --git a/versions/baseline.json b/versions/baseline.json index 632c88272bf..aaa11a62232 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -565,8 +565,8 @@ "port-version": 5 }, "blosc": { - "baseline": "1.18.1", - "port-version": 4 + "baseline": "1.21.3", + "port-version": 0 }, "boinc": { "baseline": "7.22.0", @@ -5714,7 +5714,7 @@ }, "openvdb": { "baseline": "10.0.0", - "port-version": 0 + "port-version": 1 }, "openvpn3": { "baseline": "3.7.0", diff --git a/versions/o-/openvdb.json b/versions/o-/openvdb.json index f41aeac9021..f65cbf1ec7c 100644 --- a/versions/o-/openvdb.json +++ b/versions/o-/openvdb.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "3b23307372371effd658ce072409367db12ed688", + "version": "10.0.0", + "port-version": 1 + }, { "git-tree": "da455f3dd793dc3d235db1a2fd3cbe68ab71ae04", "version": "10.0.0",