mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 13:54:46 +08:00
[ZSTD] Update to 1.4.5 (#14395)
* [ZSTD] Update to 1.4.5 * [zstd] fix wrong assert to fix uwp regressions * always install *.pc file. Correct -l flag in pc file * fix orc regression * fix arrow regressions * fix orc zstd linkage * fix find_package(ZSTD) * install zstd dlls. * fix the patch due to a replacement error Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
parent
f50c0eae60
commit
b518035a33
@ -1,6 +1,6 @@
|
||||
Source: arrow
|
||||
Version: 1.0.1
|
||||
Port-Version: 1
|
||||
Port-Version: 2
|
||||
Build-Depends: boost-system, boost-filesystem, boost-multiprecision, boost-algorithm, flatbuffers, rapidjson, zlib, lz4, brotli, bzip2, zstd, snappy, gflags, thrift, double-conversion, glog, uriparser, openssl, utf8proc
|
||||
Homepage: https://github.com/apache/arrow
|
||||
Description: Apache Arrow is a columnar in-memory analytics layer designed to accelerate big data. It houses a set of canonical in-memory representations of flat and hierarchical data along with multiple language-bindings for structure manipulation. It also provides IPC and common algorithm implementations.
|
||||
|
@ -20,6 +20,8 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
"filesystem" ARROW_FILESYSTEM
|
||||
)
|
||||
|
||||
file(REMOVE "${SOURCE_PATH}/cpp/cmake_modules/FindZSTD.cmake")
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}/cpp
|
||||
PREFER_NINJA
|
||||
@ -30,10 +32,10 @@ vcpkg_configure_cmake(
|
||||
${FEATURE_OPTIONS}
|
||||
-DARROW_BUILD_STATIC=${ARROW_BUILD_STATIC}
|
||||
-DARROW_BUILD_SHARED=${ARROW_BUILD_SHARED}
|
||||
-DARROW_BROTLI_USE_SHARED=${ARROW_BUILD_SHARED}
|
||||
-DARROW_GFLAGS_USE_SHARED=${ARROW_BUILD_SHARED}
|
||||
-DARROW_UTF8PROC_USE_SHARED=${ARROW_BUILD_SHARED}
|
||||
-DARROW_ZSTD_USE_SHARED=${ARROW_BUILD_SHARED}
|
||||
-DARROW_BROTLI_USE_SHARED=${ARROW_BUILD_SHARED} # This can be wrong in custom triplets
|
||||
-DARROW_GFLAGS_USE_SHARED=${ARROW_BUILD_SHARED} # This can be wrong in custom triplets
|
||||
-DARROW_UTF8PROC_USE_SHARED=${ARROW_BUILD_SHARED} # This can be wrong in custom triplets
|
||||
-DARROW_ZSTD_USE_SHARED=${ARROW_BUILD_SHARED} # This can be wrong in custom triplets
|
||||
-DARROW_JEMALLOC=OFF
|
||||
-DARROW_BUILD_UTILITIES=OFF
|
||||
-DARROW_WITH_BZ2=ON
|
||||
|
@ -17,7 +17,7 @@ index 3d4a162..6926bc3 100644
|
||||
+ ZLIB::ZLIB
|
||||
+ Snappy::snappy
|
||||
+ lz4::lz4
|
||||
+ libzstd
|
||||
+ $<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>
|
||||
+ ${LIBHDFSPP_LIBRARIES}
|
||||
)
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
Source: orc
|
||||
Version: 1.6.4
|
||||
Port-Version: 1
|
||||
Homepage: https://orc.apache.org/
|
||||
Build-Depends: zlib, protobuf, lz4, snappy, zstd, gtest
|
||||
Description: The smallest, fastest columnar storage for Hadoop workloads.
|
||||
|
@ -1,93 +0,0 @@
|
||||
diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt
|
||||
index 7adca875..8835d1c6 100644
|
||||
--- a/build/cmake/lib/CMakeLists.txt
|
||||
+++ b/build/cmake/lib/CMakeLists.txt
|
||||
@@ -78,20 +78,20 @@ endif ()
|
||||
|
||||
# Split project to static and shared libraries build
|
||||
if (ZSTD_BUILD_SHARED)
|
||||
- add_library(libzstd_shared SHARED ${Sources} ${Headers} ${PlatformDependResources})
|
||||
+ add_library(libzstd SHARED ${Sources} ${Headers} ${PlatformDependResources})
|
||||
if (ZSTD_MULTITHREAD_SUPPORT)
|
||||
- set_property(TARGET libzstd_shared APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD")
|
||||
+ set_property(TARGET libzstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD")
|
||||
if (UNIX)
|
||||
- target_link_libraries(libzstd_shared ${THREADS_LIBS})
|
||||
+ target_link_libraries(libzstd ${THREADS_LIBS})
|
||||
endif ()
|
||||
endif()
|
||||
endif ()
|
||||
if (ZSTD_BUILD_STATIC)
|
||||
- add_library(libzstd_static STATIC ${Sources} ${Headers})
|
||||
+ add_library(libzstd STATIC ${Sources} ${Headers})
|
||||
if (ZSTD_MULTITHREAD_SUPPORT)
|
||||
- set_property(TARGET libzstd_static APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD")
|
||||
+ set_property(TARGET libzstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD")
|
||||
if (UNIX)
|
||||
- target_link_libraries(libzstd_static ${THREADS_LIBS})
|
||||
+ target_link_libraries(libzstd ${THREADS_LIBS})
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
@@ -99,16 +99,16 @@ endif ()
|
||||
# Add specific compile definitions for MSVC project
|
||||
if (MSVC)
|
||||
if (ZSTD_BUILD_SHARED)
|
||||
- set_property(TARGET libzstd_shared APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_DLL_EXPORT=1;ZSTD_HEAPMODE=0;_CONSOLE;_CRT_SECURE_NO_WARNINGS")
|
||||
+ set_property(TARGET libzstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_DLL_EXPORT=1;ZSTD_HEAPMODE=0;_CONSOLE;_CRT_SECURE_NO_WARNINGS")
|
||||
endif ()
|
||||
if (ZSTD_BUILD_STATIC)
|
||||
- set_property(TARGET libzstd_static APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_HEAPMODE=0;_CRT_SECURE_NO_WARNINGS")
|
||||
+ set_property(TARGET libzstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_HEAPMODE=0;_CRT_SECURE_NO_WARNINGS")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# With MSVC static library needs to be renamed to avoid conflict with import library
|
||||
if (MSVC)
|
||||
- set(STATIC_LIBRARY_BASE_NAME zstd_static)
|
||||
+ set(STATIC_LIBRARY_BASE_NAME zstd)
|
||||
else ()
|
||||
set(STATIC_LIBRARY_BASE_NAME zstd)
|
||||
endif ()
|
||||
@@ -116,7 +116,7 @@ endif ()
|
||||
# Define static and shared library names
|
||||
if (ZSTD_BUILD_SHARED)
|
||||
set_target_properties(
|
||||
- libzstd_shared
|
||||
+ libzstd
|
||||
PROPERTIES
|
||||
OUTPUT_NAME zstd
|
||||
VERSION ${zstd_VERSION_MAJOR}.${zstd_VERSION_MINOR}.${zstd_VERSION_PATCH}
|
||||
@@ -125,7 +125,7 @@ endif ()
|
||||
|
||||
if (ZSTD_BUILD_STATIC)
|
||||
set_target_properties(
|
||||
- libzstd_static
|
||||
+ libzstd
|
||||
PROPERTIES
|
||||
OUTPUT_NAME ${STATIC_LIBRARY_BASE_NAME})
|
||||
endif ()
|
||||
@@ -154,12 +154,14 @@ install(FILES
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
if (ZSTD_BUILD_SHARED)
|
||||
- install(TARGETS libzstd_shared RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
+ install(TARGETS libzstd EXPORT zstd-config
|
||||
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
if (ZSTD_BUILD_STATIC)
|
||||
- install(TARGETS libzstd_static ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
+ install(TARGETS libzstd EXPORT zstd-config
|
||||
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
endif ()
|
||||
|
||||
# uninstall target
|
||||
@@ -172,3 +174,6 @@ if (NOT TARGET uninstall)
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
endif ()
|
||||
+
|
||||
+target_include_directories(libzstd PUBLIC $<INSTALL_INTERFACE:include>)
|
||||
+install(EXPORT zstd-config DESTINATION share/cmake/zstd)
|
@ -1,5 +1,5 @@
|
||||
Source: zstd
|
||||
Version: 1.4.4
|
||||
Port-Version: 3
|
||||
Version: 1.4.5
|
||||
Port-Version: 1
|
||||
Description: Zstandard - Fast real-time compression algorithm
|
||||
Homepage: https://facebook.github.io/zstd/
|
||||
|
13
ports/zstd/fix_assert.patch
Normal file
13
ports/zstd/fix_assert.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/lib/decompress/zstd_decompress.c b/lib/decompress/zstd_decompress.c
|
||||
index be5c7cfc3..539190998 100644
|
||||
--- a/lib/decompress/zstd_decompress.c
|
||||
+++ b/lib/decompress/zstd_decompress.c
|
||||
@@ -721,7 +721,7 @@ static size_t ZSTD_decompressMultiFrame(ZSTD_DCtx* dctx,
|
||||
decodedSize = ZSTD_decompressLegacy(dst, dstCapacity, src, frameSize, dict, dictSize);
|
||||
if (ZSTD_isError(decodedSize)) return decodedSize;
|
||||
|
||||
- assert(decodedSize <=- dstCapacity);
|
||||
+ assert(decodedSize <= dstCapacity);
|
||||
dst = (BYTE*)dst + decodedSize;
|
||||
dstCapacity -= decodedSize;
|
||||
|
12
ports/zstd/install_dll.patch
Normal file
12
ports/zstd/install_dll.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt
|
||||
index 4274cbdd3..ea1b5f088 100644
|
||||
--- a/build/cmake/lib/CMakeLists.txt
|
||||
+++ b/build/cmake/lib/CMakeLists.txt
|
||||
@@ -163,6 +163,7 @@ install(TARGETS ${library_targets}
|
||||
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
)
|
||||
|
||||
# uninstall target
|
13
ports/zstd/install_pkgpc.patch
Normal file
13
ports/zstd/install_pkgpc.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt
|
||||
index 666da60c1..4274cbdd3 100644
|
||||
--- a/build/cmake/lib/CMakeLists.txt
|
||||
+++ b/build/cmake/lib/CMakeLists.txt
|
||||
@@ -134,7 +134,7 @@ if (ZSTD_BUILD_STATIC)
|
||||
OUTPUT_NAME ${STATIC_LIBRARY_BASE_NAME})
|
||||
endif ()
|
||||
|
||||
-if (UNIX)
|
||||
+if (1)
|
||||
# pkg-config
|
||||
set(PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
set(LIBDIR "${CMAKE_INSTALL_LIBDIR}")
|
@ -1,12 +1,14 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO facebook/zstd
|
||||
REF 10f0e6993f9d2f682da6d04aa2385b7d53cbb4ee # v1.4.4
|
||||
SHA512 869eb031d2f8cfd9d93502835a373f6f2ec39dc1f41dd5fd0463d3d442c153915987d00bc862ae66bded5c5697e1803a1e68491803bd1a7b358397e6eba58f64
|
||||
REF b706286adbba780006a47ef92df0ad7a785666b6 # v1.4.5
|
||||
SHA512 1be43e8cc1dad9dd59036f86a7dd579b8fcbf16b3ebae62f38aa0397f45ab0eab2e97e924cede40428fa9125a2e5e567694bb04a0c9ec0c4275a79cd2ef8eb11
|
||||
HEAD_REF dev
|
||||
PATCHES
|
||||
0001-export-zstd-config.patch
|
||||
0002-crosscompile-windows.patch
|
||||
fix_assert.patch
|
||||
install_pkgpc.patch
|
||||
install_dll.patch
|
||||
)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
@ -35,14 +37,29 @@ vcpkg_configure_cmake(
|
||||
-DZSTD_BUILD_TESTS=0
|
||||
-DZSTD_BUILD_CONTRIB=0
|
||||
OPTIONS_DEBUG
|
||||
-DCMAKE_DEBUG_POSTFIX=d)
|
||||
-DCMAKE_DEBUG_POSTFIX=d) # this is against the maintainer guidelines.
|
||||
# Removing it probably requires a vcpkg-cmake-wrapper.cmake to correct downstreams FindZSTD.cmake
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/zstd)
|
||||
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libzstd.pc")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libzstd.pc" "-lzstd" "-lzstdd")
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/zstd)
|
||||
|
||||
# This enables find_package(ZSTD) and find_package(zstd) to find zstd on Linux(case sensitive filesystems)
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/zstdConfig.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/zstd-config.cmake")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/zstdConfigVersion.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/zstd-configVersion.cmake")
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" AND VCPKG_TARGET_IS_WINDOWS)
|
||||
set(static_suffix "_static")
|
||||
else()
|
||||
set(static_suffix )
|
||||
endif()
|
||||
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libzstd.pc")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libzstd.pc" "-lzstd" "-lzstd${static_suffix}")
|
||||
endif()
|
||||
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libzstd.pc")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libzstd.pc" "-lzstd" "-lzstd${static_suffix}d")
|
||||
endif()
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
@ -58,3 +75,5 @@ endif()
|
||||
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
||||
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "ZSTD is dual licensed - see LICENSE and COPYING files\n")
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user