From f8c578513820d7f9993873a2836ac3a453e53ee7 Mon Sep 17 00:00:00 2001 From: zi-m Date: Mon, 13 Apr 2020 22:14:21 +0200 Subject: [PATCH] update to 1.18.1 and export blosc-config.cmake --- ports/blosc/0002-export-blosc-config.patch | 66 ++++++++++++++++++++++ ports/blosc/CONTROL | 2 +- ports/blosc/FindBlosc.cmake | 33 ----------- ports/blosc/portfile.cmake | 22 ++------ 4 files changed, 71 insertions(+), 52 deletions(-) create mode 100644 ports/blosc/0002-export-blosc-config.patch delete mode 100644 ports/blosc/FindBlosc.cmake diff --git a/ports/blosc/0002-export-blosc-config.patch b/ports/blosc/0002-export-blosc-config.patch new file mode 100644 index 000000000..31297f732 --- /dev/null +++ b/ports/blosc/0002-export-blosc-config.patch @@ -0,0 +1,66 @@ +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/CONTROL b/ports/blosc/CONTROL index 528435000..abda40db0 100644 --- a/ports/blosc/CONTROL +++ b/ports/blosc/CONTROL @@ -1,5 +1,5 @@ Source: blosc -Version: 1.17.1 +Version: 1.18.1-1 Build-Depends: lz4, snappy, zlib, zstd Homepage: https://github.com/Blosc/c-blosc Description: A blocking, shuffling and loss-less compression library that can be faster than `memcpy()` diff --git a/ports/blosc/FindBlosc.cmake b/ports/blosc/FindBlosc.cmake deleted file mode 100644 index 11385d46d..000000000 --- a/ports/blosc/FindBlosc.cmake +++ /dev/null @@ -1,33 +0,0 @@ -include(FindPackageHandleStandardArgs) - -find_path( - BLOSC_INCLUDE_DIRS - blosc.h -) - -get_filename_component(_prefix_path ${BLOSC_INCLUDE_DIRS} PATH) - -find_library( - BLOSC_LIBRARY_DEBUG - NAMES blosc - PATHS ${_prefix_path}/debug/lib - NO_DEFAULT_PATH -) - -find_library( - SNAPPY_LIBRARY_RELEASE - NAMES blosc - PATHS ${_prefix_path}/lib - NO_DEFAULT_PATH -) - -unset(_prefix_path) - -include(SelectLibraryConfigurations) -select_library_configurations(blosc) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args( - blosc - REQUIRED_VARS BLOSC_LIBRARIES BLOSC_INCLUDE_DIRS -) diff --git a/ports/blosc/portfile.cmake b/ports/blosc/portfile.cmake index c99898216..8326b04b9 100644 --- a/ports/blosc/portfile.cmake +++ b/ports/blosc/portfile.cmake @@ -3,11 +3,12 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Blosc/c-blosc - REF 30c55d6544613c846368de1faee420e56e992ffe # v1.17.1 - SHA512 c4ed1492fd8733c6acabc973c58d6763e2a3a2bd7965fbf4d267169f5b03055eccdbe2723bc5d98636b039625a55609a092ed65de45d7a2b361347513cc83a98 + REF 9fae1c9acb659159321aca69aefcdbce663e2374 # v1.18.1 + SHA512 6cc77832100041aca8f320e44aa803adc0d3344b52742b995a3155b953e5d149534de65c8244d964448150b73715a81f54285d7d01f1b45d7b10fe07f5bdb141 HEAD_REF master PATCHES 0001-find-deps.patch + 0002-export-blosc-config.patch ) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) @@ -34,26 +35,11 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() - -if (BLOSC_SHARED) vcpkg_copy_pdbs() - if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/blosc.dll") - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/blosc.dll ${CURRENT_PACKAGES_DIR}/bin/blosc.dll) - endif() - if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/blosc.dll") - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/blosc.dll ${CURRENT_PACKAGES_DIR}/debug/bin/blosc.dll) - endif() -endif() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/blosc) # cleanup 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) - -file(COPY - "${CMAKE_CURRENT_LIST_DIR}/FindBlosc.cmake" - DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} -)