From 86e63837db1800e835766f9ed4174955f36ce12a Mon Sep 17 00:00:00 2001 From: Po-Chuan Hsieh Date: Thu, 30 Jun 2022 00:27:55 +0800 Subject: [PATCH] databases/tiledb: Update to 2.10.1 Changes: https://github.com/TileDB-Inc/TileDB/releases --- databases/tiledb/Makefile | 7 +- databases/tiledb/distinfo | 6 +- databases/tiledb/files/patch-magic | 170 ++++++++++++++++++ .../patch-tiledb-type-range-CMakeLists.txt | 10 ++ databases/tiledb/pkg-plist | 1 + 5 files changed, 188 insertions(+), 6 deletions(-) create mode 100644 databases/tiledb/files/patch-magic create mode 100644 databases/tiledb/files/patch-tiledb-type-range-CMakeLists.txt diff --git a/databases/tiledb/Makefile b/databases/tiledb/Makefile index 6d6635a81fd5..4f0334ebac1f 100644 --- a/databases/tiledb/Makefile +++ b/databases/tiledb/Makefile @@ -1,7 +1,7 @@ # Created by: Po-Chuan Hsieh PORTNAME= tiledb -PORTVERSION= 2.8.3 +PORTVERSION= 2.10.1 CATEGORIES= databases MAINTAINER= sunpoet@FreeBSD.org @@ -19,6 +19,7 @@ LIB_DEPENDS= libcapnp.so:devel/capnproto080 \ RUN_DEPENDS= capnproto080>=0.8.0:devel/capnproto080 \ catch>=2.13.8:devel/catch \ clipp>=1.2.3:devel/clipp \ + curl>=7.74.0:ftp/curl \ liblz4>=1.9.3,1:archivers/liblz4 \ spdlog>=1.9.0:devel/spdlog \ zstd>=1.4.8:archivers/zstd @@ -26,8 +27,8 @@ RUN_DEPENDS= capnproto080>=0.8.0:devel/capnproto080 \ USES= cmake compiler:c++17-lang localbase:ldflags pkgconfig ssl CFLAGS+= -DSPDLOG_FMT_EXTERNAL=1 -CMAKE_ARGS= -DCATCH_INCLUDE_DIR=${LOCALBASE}/include/catch2 -CMAKE_OFF= TILEDB_ALLOW_REGEX_CHAR_PATH TILEDB_ARROW_TESTS TILEDB_AZURE TILEDB_CMAKE_IDE TILEDB_FORCE_ALL_DEPS TILEDB_GCS TILEDB_HDFS TILEDB_S3 TILEDB_SKIP_S3AWSSDK_DIR_LENGTH_CHECK TILEDB_SUPERBUILD TILEDB_TESTS_AWS_S3_CONFIG TILEDB_TESTS_ENABLE_REST TILEDB_VERBOSE TILEDB_WERROR +CMAKE_ARGS= -DCATCH_INCLUDE_DIR=${LOCALBASE}/include/catch2 -Dlibmagic_DICTIONARY=/usr/share/misc/magic.mgc +CMAKE_OFF= TILEDB_ALLOW_REGEX_CHAR_PATH TILEDB_ARROW_TESTS TILEDB_AZURE TILEDB_CMAKE_IDE TILEDB_FORCE_ALL_DEPS TILEDB_GCS TILEDB_HDFS TILEDB_INSTALL_STATIC_DEPS TILEDB_S3 TILEDB_SKIP_S3AWSSDK_DIR_LENGTH_CHECK TILEDB_SUPERBUILD TILEDB_TESTS_AWS_S3_CONFIG TILEDB_TESTS_ENABLE_REST TILEDB_VERBOSE TILEDB_WERROR CMAKE_ON= TILEDB_CCACHE TILEDB_CPP_API TILEDB_LOG_OUTPUT_ON_FAILURE TILEDB_SERIALIZATION TILEDB_STATIC TILEDB_STATS TILEDB_TESTS TILEDB_TOOLS LDFLAGS+= -lfmt diff --git a/databases/tiledb/distinfo b/databases/tiledb/distinfo index 42199d4c6843..23585ece0d1e 100644 --- a/databases/tiledb/distinfo +++ b/databases/tiledb/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1652446240 -SHA256 (TileDB-Inc-TileDB-2.8.3_GH0.tar.gz) = 802e366bc166d34a7e8111a23c5ab782f0b406038607fcb76cd8fb536619a74a -SIZE (TileDB-Inc-TileDB-2.8.3_GH0.tar.gz) = 2328582 +TIMESTAMP = 1656092914 +SHA256 (TileDB-Inc-TileDB-2.10.1_GH0.tar.gz) = ec215a28b116cc596da749451990fa11f0e8860ab576e6cb7d3e68b81eda2ef4 +SIZE (TileDB-Inc-TileDB-2.10.1_GH0.tar.gz) = 2810234 diff --git a/databases/tiledb/files/patch-magic b/databases/tiledb/files/patch-magic new file mode 100644 index 000000000000..a30de0666dfb --- /dev/null +++ b/databases/tiledb/files/patch-magic @@ -0,0 +1,170 @@ +Obtained from: https://github.com/TileDB-Inc/TileDB/pull/3270 + +--- cmake/Modules/FindMagic_EP.cmake.orig 2022-06-24 19:24:23 UTC ++++ cmake/Modules/FindMagic_EP.cmake +@@ -3,7 +3,7 @@ + # + # The MIT License + # +-# Copyright (c) 2018-2021 TileDB, Inc. ++# Copyright (c) 2022 TileDB, Inc. + # + # Permission is hereby granted, free of charge, to any person obtaining a copy + # of this software and associated documentation files (the "Software"), to deal +@@ -34,47 +34,47 @@ + # Include some common helper functions. + include(TileDBCommon) + +-# Search the path set during the superbuild for the EP. +-set(LIBMAGIC_PATHS ${TILEDB_EP_INSTALL_PREFIX}) ++# First check for a static version in the EP prefix. ++find_library(libmagic_LIBRARIES ++ NAMES ++ magic${CMAKE_STATIC_LIBRARY_SUFFIX} ++ libmagic${CMAKE_STATIC_LIBRARY_SUFFIX} ++ PATHS ${TILEDB_EP_INSTALL_PREFIX} ++ PATH_SUFFIXES lib ++ NO_DEFAULT_PATH ++) + +-if(TILEDB_LIBMAGIC_EP_BUILT) +- find_package(libmagic PATHS ${TILEDB_EP_INSTALL_PREFIX} ${TILEDB_DEPS_NO_DEFAULT_PATH}) +-endif() +- +-if (TILEDB_LIBMAGIC_EP_BUILT) ++if (libmagic_LIBRARIES) ++ set(libmagic_STATIC_EP_FOUND TRUE) + find_path(libmagic_INCLUDE_DIR +- NAMES magic.h +- PATHS ${LIBMAGIC_PATHS} +- PATH_SUFFIXES include +- ${NO_DEFAULT_PATH} +- ) +- +- if (NOT libmagic_INCLUDE_DIR) +- find_path(libmagic_INCLUDE_DIR +- NAMES file/file.h +- PATHS ${LIBMAGIC_PATHS} +- PATH_SUFFIXES include +- ${NO_DEFAULT_PATH} +- ) +- endif() +- +- # Link statically if installed with the EP. ++ NAMES magic.h ++ PATHS ${TILEDB_EP_INSTALL_PREFIX} ++ PATH_SUFFIXES include ++ NO_DEFAULT_PATH ++ ) ++elseif(NOT TILEDB_FORCE_ALL_DEPS) ++ set(libmagic_STATIC_EP_FOUND FALSE) ++ # Static EP not found, search in system paths. + find_library(libmagic_LIBRARIES +- libmagic +- PATHS ${LIBMAGIC_PATHS} +- PATH_SUFFIXES lib a +- #${TILEDB_DEPS_NO_DEFAULT_PATH} +- ${NO_DEFAULT_PATH} +- ) +- +- include(FindPackageHandleStandardArgs) +- FIND_PACKAGE_HANDLE_STANDARD_ARGS(libmagic +- REQUIRED_VARS libmagic_LIBRARIES libmagic_INCLUDE_DIR +- ) ++ NAMES ++ magic libmagic ++ PATH_SUFFIXES lib bin ++ ${TILEDB_DEPS_NO_DEFAULT_PATH} ++ ) ++ find_path(libmagic_INCLUDE_DIR ++ NAMES magic.h ++ PATH_SUFFIXES include ++ ${TILEDB_DEPS_NO_DEFAULT_PATH} ++ ) + endif() + ++include(FindPackageHandleStandardArgs) ++FIND_PACKAGE_HANDLE_STANDARD_ARGS(libmagic ++ REQUIRED_VARS libmagic_LIBRARIES libmagic_INCLUDE_DIR ++) ++ + # if not yet built add it as an external project +-if(NOT TILEDB_LIBMAGIC_EP_BUILT) ++if(NOT libmagic_FOUND) + if (TILEDB_SUPERBUILD) + message(STATUS "Adding Magic as an external project") + +@@ -115,11 +115,22 @@ if(NOT TILEDB_LIBMAGIC_EP_BUILT) + endif() + endif() + +-find_file(libmagic_DICTIONARY magic.mgc +- PATHS ${LIBMAGIC_PATHS} +- PATH_SUFFIXES bin share +- ${NO_DEFAULT_PATH} +-) ++if(TILEDB_LIBMAGIC_EP_BUILT) ++ find_file(libmagic_DICTIONARY magic.mgc ++ PATHS ${LIBMAGIC_PATHS} ++ PATH_SUFFIXES bin share misc ++ ${TILEDB_DEPS_NO_DEFAULT_PATH} ++ ) ++else() ++ find_file(libmagic_DICTIONARY magic.mgc ++ PATH_SUFFIXES bin share misc share/misc ++ ${TILEDB_DEPS_NO_DEFAULT_PATH} ++ ) ++endif() ++ ++if(NOT TILEDB_SUPERBUILD AND NOT libmagic_DICTIONARY) ++ message(FATAL_ERROR "Unable to find libmagic dictionary") ++endif() + + if (libmagic_FOUND AND NOT TARGET libmagic) + message(STATUS "Found Magic, adding imported target: ${libmagic_LIBRARIES}") +--- tiledb/CMakeLists.txt.orig 2022-06-24 19:24:23 UTC ++++ tiledb/CMakeLists.txt +@@ -336,18 +336,22 @@ add_library(TILEDB_CORE_OBJECTS OBJECT + ############################################################ + # provide actions/target for preparation of magic.mgc data for embedding/build + +-#set(MGC_GZIPPED_BIN_PATH3 "${CMAKE_CURRENT_SOURCE_DIR}/sm/misc/magic_mgc_gzipped.bin") +-set(MGC_GZIPPED_BIN_OUTPUT_DIRECTORY "${TILEDB_EP_BASE}/install/include") ++set(MGC_GZIPPED_BIN_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/sm/misc") + set(MGC_GZIPPED_BIN_OUTPUT_FILE "${MGC_GZIPPED_BIN_OUTPUT_DIRECTORY}/magic_mgc_gzipped.bin") + set(MGC_GZIPPED_BIN_INPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/sm/misc") + set(MGC_GZIPPED_BIN_INPUT_FILE "${MGC_GZIPPED_BIN_INPUT_DIRECTORY}/magic_mgc_gzipped.bin.tar.bz2") + ++# Create the output directory if it does not exist ++add_custom_target(create_magic_bin_output_directory ALL ++ COMMAND ${CMAKE_COMMAND} -E make_directory ${MGC_GZIPPED_BIN_OUTPUT_DIRECTORY}) ++ + add_custom_command( + OUTPUT "${MGC_GZIPPED_BIN_OUTPUT_FILE}" +- DEPENDS "${MGC_GZIPPED_BIN_INPUT_FILE}" ++ DEPENDS "${MGC_GZIPPED_BIN_INPUT_FILE}" create_magic_bin_output_directory + COMMAND ${CMAKE_COMMAND} -E tar x "${MGC_GZIPPED_BIN_INPUT_FILE}" + WORKING_DIRECTORY "${MGC_GZIPPED_BIN_OUTPUT_DIRECTORY}" + ) ++ + add_custom_target(gen_mgc_unarch ALL + DEPENDS ${MGC_GZIPPED_BIN_OUTPUT_FILE} + ) +@@ -360,7 +364,7 @@ add_custom_target( + WORKING_DIRECTORY "${MGC_GZIPPED_BIN_OUTPUT_DIRECTORY}" + COMMAND ${CMAKE_COMMAND} -E tar cvj "magic_mgc_gzipped.bin.tar.bz2" "magic_mgc_gzipped.bin" + COMMAND ${CMAKE_COMMAND} -E copy "magic_mgc_gzipped.bin.tar.bz2" "${MGC_GZIPPED_BIN_INPUT_FILE}" +- DEPENDS "${libmagic_DICTIONARY}" ++ DEPENDS "${libmagic_DICTIONARY}" create_magic_bin_output_directory + COMMENT "Re-generate ${MGC_GZIPPED_BIN_INPUT_FILE} for embedded magic.mgc support" + ) + +@@ -374,6 +378,8 @@ target_include_directories(TILEDB_CORE_OBJECTS + "${TILEDB_EXTERNALS_INCLUDE_DIRS}" + # to pickup /tiledb for capnp gen'd files + "${CMAKE_CURRENT_BINARY_DIR}/.." ++ # For libmagic binary data include ++ "${CMAKE_CURRENT_BINARY_DIR}/sm/misc" + ) + + # Build a separate copy of the object library for use with static TileDB diff --git a/databases/tiledb/files/patch-tiledb-type-range-CMakeLists.txt b/databases/tiledb/files/patch-tiledb-type-range-CMakeLists.txt new file mode 100644 index 000000000000..0f7f192e9990 --- /dev/null +++ b/databases/tiledb/files/patch-tiledb-type-range-CMakeLists.txt @@ -0,0 +1,10 @@ +--- tiledb/type/range/CMakeLists.txt.orig 2022-06-24 19:24:23 UTC ++++ tiledb/type/range/CMakeLists.txt +@@ -29,6 +29,7 @@ include(common NO_POLICY_SCOPE) + + # Range library + add_library(range OBJECT range.h) ++set_target_properties(range PROPERTIES LINKER_LANGUAGE CXX) + target_link_libraries(range PUBLIC baseline $) + + # Test-compile of object library ensures link-completeness diff --git a/databases/tiledb/pkg-plist b/databases/tiledb/pkg-plist index 0946ef20d9b8..e02c58edb80b 100644 --- a/databases/tiledb/pkg-plist +++ b/databases/tiledb/pkg-plist @@ -37,6 +37,7 @@ include/tiledb/utils.h include/tiledb/version.h include/tiledb/vfs.h lib/cmake/TileDB/TileDBConfig.cmake +lib/cmake/TileDB/TileDBConfigVersion.cmake lib/cmake/TileDB/TileDBTargets-%%CMAKE_BUILD_TYPE%%.cmake lib/cmake/TileDB/TileDBTargets.cmake lib/libtiledb.a