Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ZSTD] Update to 1.4.5 #14395

Merged
merged 11 commits into from
Nov 12, 2020
2 changes: 1 addition & 1 deletion ports/arrow/CONTROL
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
10 changes: 6 additions & 4 deletions ports/arrow/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ports/orc/0003-dependencies-from-vcpkg.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)

Expand Down
1 change: 1 addition & 0 deletions ports/orc/CONTROL
Original file line number Diff line number Diff line change
@@ -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.
93 changes: 0 additions & 93 deletions ports/zstd/0001-export-zstd-config.patch

This file was deleted.

4 changes: 2 additions & 2 deletions ports/zstd/CONTROL
Original file line number Diff line number Diff line change
@@ -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 changes: 13 additions & 0 deletions ports/zstd/fix_assert.patch
Original file line number Diff line number Diff line change
@@ -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;

13 changes: 13 additions & 0 deletions ports/zstd/install_pkgpc.patch
Original file line number Diff line number Diff line change
@@ -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}")
30 changes: 24 additions & 6 deletions ports/zstd/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
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
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
Expand Down Expand Up @@ -35,14 +36,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)
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" "-lzstdd")
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)
Expand All @@ -58,3 +74,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")