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.5.0 #18915

Merged
merged 17 commits into from
Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ports/zstd/fix-c4703-error.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/lib/compress/zstd_lazy.c b/lib/compress/zstd_lazy.c
index 3d523e8..3dd1426 100644
--- a/lib/compress/zstd_lazy.c
+++ b/lib/compress/zstd_lazy.c
@@ -1296,8 +1296,8 @@ size_t ZSTD_RowFindBestMatch_generic (
size_t ddsIdx;
U32 ddsExtraAttempts; /* cctx hash tables are limited in searches, but allow extra searches into DDS */
U32 dmsTag;
- U32* dmsRow;
- BYTE* dmsTagRow;
+ U32* dmsRow = NULL;
+ BYTE* dmsTagRow = NULL;

if (dictMode == ZSTD_dedicatedDictSearch) {
const U32 ddsHashLog = dms->cParams.hashLog - ZSTD_LAZY_DDSS_BUCKET_LOG;
7 changes: 3 additions & 4 deletions ports/zstd/install_pkgpc.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt
index 179c9762..f86efdbc 100644
index 5f75665..dabc9d5 100644
--- a/build/cmake/lib/CMakeLists.txt
+++ b/build/cmake/lib/CMakeLists.txt
@@ -134,7 +134,7 @@ if (ZSTD_BUILD_STATIC)
@@ -130,7 +130,7 @@ if (ZSTD_BUILD_STATIC)
OUTPUT_NAME ${STATIC_LIBRARY_BASE_NAME})
endif ()

-if (UNIX OR MINGW)
+if (1)
# pkg-config
set(PREFIX "${CMAKE_INSTALL_PREFIX}")
set(EXEC_PREFIX "\${prefix}")

24 changes: 11 additions & 13 deletions ports/zstd/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO facebook/zstd
REF v1.4.9
SHA512 f529db9c094f9ae26428bf1fdfcc91c6d783d400980e0f0d802d2cf13c2be2931465ef568907e03841ff76a369a1447e7371f8799d8526edb9a513ba5c6db133
REF a488ba114ec17ea1054b9057c26a046fc122b3b6 #v1.5.0
SHA512 659576d0f52d2271b6b53f638b407b873888b1cffe4f014c3149d33a961653c2fcf7ff270bc669a5647205b573ef2809907645a4c89ab6c030ad65bce15547ae
HEAD_REF dev
PATCHES
install_pkgpc.patch
fix-c4703-error.patch
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
NancyLi1013 marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -23,9 +24,8 @@ if(VCPKG_TARGET_IS_WINDOWS)
set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS}")
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}/build/cmake
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/build/cmake"
OPTIONS
-DZSTD_BUILD_SHARED=${ZSTD_SHARED}
-DZSTD_BUILD_STATIC=${ZSTD_STATIC}
Expand All @@ -37,9 +37,9 @@ vcpkg_configure_cmake(
-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_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/zstd)
vcpkg_cmake_config_fixup(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")
Expand All @@ -59,18 +59,16 @@ endif()

vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")

if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
foreach(HEADER zdict.h zstd.h zstd_errors.h)
file(READ ${CURRENT_PACKAGES_DIR}/include/${HEADER} HEADER_CONTENTS)
string(REPLACE "defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)" "1" HEADER_CONTENTS "${HEADER_CONTENTS}")
file(WRITE ${CURRENT_PACKAGES_DIR}/include/${HEADER} "${HEADER_CONTENTS}")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/${HEADER}" "defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)" "1" )
endforeach()
endif()

file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
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")
NancyLi1013 marked this conversation as resolved.
Show resolved Hide resolved


14 changes: 12 additions & 2 deletions ports/zstd/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"name": "zstd",
"version": "1.4.9",
"version-semver": "1.5.0",
"description": "Zstandard - Fast real-time compression algorithm",
"homepage": "https://facebook.github.io/zstd/"
"homepage": "https://facebook.github.io/zstd/",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6957,7 +6957,7 @@
"port-version": 0
},
"zstd": {
"baseline": "1.4.9",
"baseline": "1.5.0",
"port-version": 0
},
"zstr": {
Expand Down
5 changes: 5 additions & 0 deletions versions/z-/zstd.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e33d437d0f064c21104f44984bf3b1775e32a927",
"version-semver": "1.5.0",
"port-version": 0
},
{
"git-tree": "3a0ffa2a8fe8246a3937d9f6a77d577e351dd445",
"version": "1.4.9",
Expand Down