zstd, cleanup old (vulnarable) recipes, bump version (#10294)

This commit is contained in:
Schrijvers Luc
2024-04-06 18:58:15 +02:00
committed by GitHub
parent 8469d20be2
commit 225b8043aa
10 changed files with 10 additions and 688 deletions

View File

@@ -1,160 +0,0 @@
From 2fe47af9772d8a751f0efe4aa75a83f418f5a3ab Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Wed, 28 Mar 2018 16:51:49 +0000
Subject: Drop gcc options unknown to gcc2.
diff --git a/lib/Makefile b/lib/Makefile
index 7c6dff0..f562ae6 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -35,10 +35,10 @@ CPPFLAGS+= -DXXH_NAMESPACE=ZSTD_
ifeq ($(TARGET_SYSTEM),Windows_NT) # MinGW assumed
CPPFLAGS += -D__USE_MINGW_ANSI_STDIO # compatibility with %zu formatting
endif
-DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
+DEBUGFLAGS= -Wall -Wcast-qual -Wcast-align -Wshadow \
-Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
-Wstrict-prototypes -Wundef -Wpointer-arith \
- -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
+ -Wvla -Wformat=2 -Wwrite-strings \
-Wredundant-decls -Wmissing-prototypes -Wc++-compat
CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
FLAGS = $(CPPFLAGS) $(CFLAGS)
@@ -204,7 +204,7 @@ $(LIBZSTD): $(ZSTD_FILES)
else
LIBZSTD = libzstd.$(SHARED_EXT_VER)
-$(LIBZSTD): LDFLAGS += -shared -fPIC -fvisibility=hidden
+$(LIBZSTD): LDFLAGS += -shared -fPIC
$(LIBZSTD): $(ZSTD_FILES)
@echo compiling dynamic library $(LIBVER)
$(Q)$(CC) $(FLAGS) $^ $(LDFLAGS) $(SONAME_FLAGS) -o $@
diff --git a/programs/Makefile b/programs/Makefile
index 418ad4e..f413fe0 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -48,10 +48,10 @@ ifeq ($(OS),Windows_NT) # MinGW assumed
CPPFLAGS += -D__USE_MINGW_ANSI_STDIO # compatibility with %zu formatting
endif
CFLAGS ?= -O3
-DEBUGFLAGS+=-Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
+DEBUGFLAGS+=-Wall -Wcast-qual -Wcast-align -Wshadow \
-Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
-Wstrict-prototypes -Wundef -Wpointer-arith \
- -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
+ -Wvla -Wformat=2 -Wwrite-strings \
-Wredundant-decls -Wmissing-prototypes -Wc++-compat
CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
--
2.24.0
From 5a875715d5e58fc257f8661fb3751280c0854157 Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Mon, 29 Oct 2018 19:39:46 +0000
Subject: Remove "-Werror" from MOREFLAGS to fix "make test" with gcc2.
diff --git a/Makefile b/Makefile
index 2c1d346..ff1cf6d 100644
--- a/Makefile
+++ b/Makefile
@@ -75,7 +75,7 @@ zlibwrapper: lib
## test: run long-duration tests
.PHONY: test
DEBUGLEVEL ?= 1
-test: MOREFLAGS += -g -DDEBUGLEVEL=$(DEBUGLEVEL) -Werror
+test: MOREFLAGS += -g -DDEBUGLEVEL=$(DEBUGLEVEL)
test:
MOREFLAGS="$(MOREFLAGS)" $(MAKE) -j -C $(PRGDIR) allVariants
$(MAKE) -C $(TESTDIR) $@
--
2.24.0
From 26ade9ffb085e6d158febfe1cc45441957954df5 Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Tue, 30 Oct 2018 11:07:16 +0000
Subject: Drop gcc options unknown to gcc2 in tests/Makefile.
diff --git a/tests/Makefile b/tests/Makefile
index d347a94..b388642 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -32,10 +32,10 @@ ifeq ($(OS),Windows_NT) # MinGW assumed
CPPFLAGS += -D__USE_MINGW_ANSI_STDIO # compatibility with %zu formatting
endif
CFLAGS ?= -O3
-CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
+CFLAGS += -Wall -Wcast-qual -Wcast-align -Wshadow \
-Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
-Wstrict-prototypes -Wundef \
- -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
+ -Wvla -Wformat=2 -Wwrite-strings \
-Wredundant-decls -Wmissing-prototypes
CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
--
2.24.0
From c4d44669d6801adf7a1e255b81819346725ffe4a Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 22 May 2020 16:40:27 +0200
Subject: Haiku: older GCCs don't support some pragmas and builtins.
diff --git a/lib/common/compiler.h b/lib/common/compiler.h
index 95e9483..8d6110d 100644
--- a/lib/common/compiler.h
+++ b/lib/common/compiler.h
@@ -139,7 +139,7 @@
/* vectorization
* older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax */
-#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__)
+#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 3)
# if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5)
# define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize")))
# else
@@ -154,7 +154,7 @@
* If you can remove a LIKELY/UNLIKELY annotation without speed changes in gcc
* and clang, please do.
*/
-#if defined(__GNUC__)
+#if defined(__GNUC__) && (__GNUC__ >= 3)
#define LIKELY(x) (__builtin_expect((x), 1))
#define UNLIKELY(x) (__builtin_expect((x), 0))
#else
--
2.24.0
From 628a21607747ef5c8eb8a30a3b7f7aeb94388ca1 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 22 May 2020 16:48:49 +0200
Subject: remove gcc options unsupported by gcc2
diff --git a/lib/Makefile b/lib/Makefile
index f562ae6..0f0a1d8 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -36,10 +36,9 @@ ifeq ($(TARGET_SYSTEM),Windows_NT) # MinGW assumed
CPPFLAGS += -D__USE_MINGW_ANSI_STDIO # compatibility with %zu formatting
endif
DEBUGFLAGS= -Wall -Wcast-qual -Wcast-align -Wshadow \
- -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
-Wstrict-prototypes -Wundef -Wpointer-arith \
- -Wvla -Wformat=2 -Wwrite-strings \
- -Wredundant-decls -Wmissing-prototypes -Wc++-compat
+ -Wformat=2 -Wwrite-strings \
+ -Wredundant-decls -Wmissing-prototypes
CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
FLAGS = $(CPPFLAGS) $(CFLAGS)
--
2.24.0

View File

@@ -1,45 +0,0 @@
From 40bd1141556a05add7b4559a9b5ac85dbae1711f Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Wed, 19 Sep 2018 12:17:54 +0200
Subject: remove -pthread from LD_COMMAND (for gcc7)
diff --git a/contrib/pzstd/Makefile b/contrib/pzstd/Makefile
index 14b9322..e4c01d2 100644
--- a/contrib/pzstd/Makefile
+++ b/contrib/pzstd/Makefile
@@ -50,7 +50,7 @@ GTEST_LIB = -L googletest/build/googlemock/gtest
LIBS =
# Compilation commands
-LD_COMMAND = $(CXX) $^ $(ALL_LDFLAGS) $(LIBS) -pthread -o $@
+LD_COMMAND = $(CXX) $^ $(ALL_LDFLAGS) $(LIBS) -o $@
CC_COMMAND = $(CC) $(DEPFLAGS) $(ALL_CFLAGS) -c $< -o $@
CXX_COMMAND = $(CXX) $(DEPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@
--
2.19.0
From 2fb9bdab563edd3c17631abafb1d8a54971e7b19 Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Tue, 30 Oct 2018 11:15:51 +0000
Subject: Remove -pthread in tests/Makefile.
diff --git a/tests/Makefile b/tests/Makefile
index e9ead89..536d02f 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -65,7 +65,7 @@ MULTITHREAD_LD =
else
EXT =
MULTITHREAD_CPP = -DZSTD_MULTITHREAD
-MULTITHREAD_LD = -pthread
+MULTITHREAD_LD =
endif
MULTITHREAD = $(MULTITHREAD_CPP) $(MULTITHREAD_LD)
--
2.19.1

View File

@@ -1,31 +0,0 @@
From e64e22a7a976256c67f37c8a851d7b57c63d0894 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 29 Sep 2021 17:14:40 -0400
Subject: Various GCC2 fixes.
diff --git a/lib/common/compiler.h b/lib/common/compiler.h
index 516930c..abd7dcb 100644
--- a/lib/common/compiler.h
+++ b/lib/common/compiler.h
@@ -142,7 +142,7 @@
/* vectorization
* older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax,
* and some compilers, like Intel ICC and MCST LCC, do not support it at all. */
-#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) && !defined(__LCC__)
+#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 3) && !defined(__LCC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5)
# define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize")))
# else
@@ -157,7 +157,7 @@
* If you can remove a LIKELY/UNLIKELY annotation without speed changes in gcc
* and clang, please do.
*/
-#if defined(__GNUC__)
+#if defined(__GNUC__) && (__GNUC__ >= 3)
#define LIKELY(x) (__builtin_expect((x), 1))
#define UNLIKELY(x) (__builtin_expect((x), 0))
#else
--
2.30.2

View File

@@ -1,22 +0,0 @@
From 5257fb075ae7afac0edadbdca0ddf25ad15237ec Mon Sep 17 00:00:00 2001
From: Augustin Cavalier <waddlesplash@gmail.com>
Date: Wed, 29 Sep 2021 17:58:52 -0400
Subject: Disable weak symbols; they do not seem to behave correctly.
diff --git a/lib/common/zstd_trace.h b/lib/common/zstd_trace.h
index f9121f7..96d48fc 100644
--- a/lib/common/zstd_trace.h
+++ b/lib/common/zstd_trace.h
@@ -29,7 +29,7 @@ extern "C" {
defined(__GNUC__) && defined(__ELF__) && \
(defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86)) && \
!defined(__APPLE__) && !defined(_WIN32) && !defined(__MINGW32__) && \
- !defined(__CYGWIN__) && !defined(_AIX)
+ !defined(__CYGWIN__) && !defined(_AIX) && !defined(__HAIKU__)
# define ZSTD_HAVE_WEAK_SYMBOLS 1
#else
# define ZSTD_HAVE_WEAK_SYMBOLS 0
--
2.30.2

View File

@@ -1,14 +1,14 @@
From 8117537ace9e497a4ae63c0f71ab13298e9a92e2 Mon Sep 17 00:00:00 2001
From ab071d1670fec16a356236d063f93bcf68f43b80 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 29 Sep 2021 17:14:40 -0400
Subject: Various GCC2 fixes.
diff --git a/lib/common/compiler.h b/lib/common/compiler.h
index 73f8d01..a419389 100644
index 31880ec..1255f9d 100644
--- a/lib/common/compiler.h
+++ b/lib/common/compiler.h
@@ -142,7 +142,7 @@
@@ -166,7 +166,7 @@
/* vectorization
* older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax,
* and some compilers, like Intel ICC and MCST LCC, do not support it at all. */
@@ -17,7 +17,7 @@ index 73f8d01..a419389 100644
# if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5)
# define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize")))
# else
@@ -157,7 +157,7 @@
@@ -181,7 +181,7 @@
* If you can remove a LIKELY/UNLIKELY annotation without speed changes in gcc
* and clang, please do.
*/
@@ -27,5 +27,5 @@ index 73f8d01..a419389 100644
#define UNLIKELY(x) (__builtin_expect((x), 0))
#else
--
2.37.3
2.43.2

View File

@@ -1,11 +1,11 @@
From 343d422acde80402cbd7730c74005e29a8f7fade Mon Sep 17 00:00:00 2001
From 279175fd5180199b83b6052fa80b53620cd5f9b5 Mon Sep 17 00:00:00 2001
From: Begasus <begasus@gmail.com>
Date: Fri, 26 May 2023 13:32:39 +0200
Subject: Include stdio.h for FILE
diff --git a/programs/util.h b/programs/util.h
index 8234646..0404999 100644
index 571d394..48a746e 100644
--- a/programs/util.h
+++ b/programs/util.h
@@ -21,6 +21,7 @@ extern "C" {
@@ -17,5 +17,5 @@ index 8234646..0404999 100644
#include <sys/stat.h> /* stat, chmod */
#include "../lib/common/mem.h" /* U64 */
--
2.37.3
2.43.2

View File

@@ -1,115 +0,0 @@
SUMMARY="Zstandard, a fast real-time compression algorithm"
DESCRIPTION="Zstd, short for Zstandard, is a fast lossless compression \
algorithm, targeting real-time compression scenarios at zlib-level and better \
compression ratios. The zstd compression library provides in-memory \
compression and decompression functions. It offers a very wide range of \
compression / speed trade-off, while being backed by a very fast decoder. It \
also offers a special mode for small data, called dictionary compression, and \
can create dictionaries from any sample set."
HOMEPAGE="https://facebook.github.io/zstd/"
COPYRIGHT="2016-2017 Facebook, Inc."
LICENSE="BSD (2-clause)"
REVISION="3"
SOURCE_URI="https://github.com/facebook/zstd/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="980b8febb0118e22f6ed70d23b5b3e600995dbf7489c1f6d6122c1411cdda8d8"
SOURCE_FILENAME="zstd-$portVersion.tar.gz"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="!x86_gcc2 x86"
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
zstd$secondaryArchSuffix = $portVersion
lib:libzstd$secondaryArchSuffix = $portVersion compat >= 1
"
REQUIRES="
haiku$secondaryArchSuffix
"
SUMMARY_bin="Command line tools to compress/decompress .zst files"
PROVIDES_bin="
zstd${secondaryArchSuffix}_bin = $portVersion
cmd:gzstd$commandSuffix = $portVersion
cmd:pzstd$commandSuffix = $portVersion
cmd:unzstd$commandSuffix = $portVersion
cmd:zstd$commandSuffix = $portVersion
cmd:zstdcat$commandSuffix = $portVersion
cmd:zstdgrep$commandSuffix = $portVersion
cmd:zstdless$commandSuffix = $portVersion
"
REQUIRES_bin="
haiku$secondaryArchSuffix
zstd$secondaryArchSuffix == $portVersion base
cmd:grep
cmd:less
"
PROVIDES_devel="
zstd${secondaryArchSuffix}_devel = $portVersion
devel:libzstd$secondaryArchSuffix = $portVersion compat >= 1
"
REQUIRES_devel="
zstd$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:sed
"
PATCH()
{
# Fixes to make "make install" work on Haiku.
sed -i -e '/^ifneq (,$(filter $(shell uname),/ s/))$/ Haiku&/' \
Makefile \
lib/Makefile \
programs/Makefile
# Insert missing shebang and use double quotes around $@
sed -i -e 's/ $@ / "$@" /;1i #!/bin/sh' programs/zstdless
}
BUILD()
{
make PREFIX=$prefix INCLUDEDIR=$includeDir LIBDIR=$libDir
make -C contrib/pzstd
make -C contrib/gen_html
contrib/gen_html/gen_html $portVersion lib/zstd.h zstd_manual.html
}
INSTALL()
{
make install PREFIX=$prefix LIBDIR=$libDir INCLUDEDIR=$includeDir \
BINDIR=$commandBinDir MANDIR=$manDir/man1
make -C contrib/pzstd install PREFIX=$prefix BINDIR=$commandBinDir
prepareInstalledDevelLib libzstd
fixPkgconfig
packageEntries bin \
$commandBinDir \
$manDir/man1
packageEntries devel \
$developDir
rmdir $manDir
install -d $docDir
install -t $docDir -m 444 LICENSE PATENTS zstd_manual.html
}
TEST()
{
make test
}

View File

@@ -1,148 +0,0 @@
SUMMARY="Zstandard, a fast real-time compression algorithm"
SUMMARY_bin="Command line tools to compress/decompress .zst files"
DESCRIPTION="Zstd, short for Zstandard, is a fast lossless compression \
algorithm, targeting real-time compression scenarios at zlib-level and better \
compression ratios. The zstd compression library provides in-memory \
compression and decompression functions. It offers a very wide range of \
compression / speed trade-off, while being backed by a very fast decoder. It \
also offers a special mode for small data, called dictionary compression, and \
can create dictionaries from any sample set."
HOMEPAGE="https://facebook.github.io/zstd/"
COPYRIGHT="2016-2018 Facebook, Inc."
LICENSE="BSD (2-clause)
GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/facebook/zstd/archive/v$portVersion.tar.gz"
SOURCE_FILENAME="zstd-$portVersion.tar.gz"
CHECKSUM_SHA256="734d1f565c42f691f8420c8d06783ad818060fc390dee43ae0a89f86d0a4f8c2"
PATCHES="zstd-$portVersion.patchset"
if [ "$effectiveTargetArchitecture" = x86_gcc2 ]; then
PATCHES="$PATCHES
zstd-$portVersion-gcc2.patchset
"
fi
ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ -n "$secondaryArchSuffix" ]; then
# Comment out this block if you wish to co-install zstd_bin & e.g. zstd_x86_bin.
commandSuffix=
commandBinDir=$prefix/bin
fi
libVersion="$portVersion"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
zstd$secondaryArchSuffix = $portVersion
lib:libzstd$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
"
PROVIDES_bin="
zstd${secondaryArchSuffix}_bin = $portVersion
cmd:unzstd$commandSuffix = $portVersion
cmd:zstd$commandSuffix = $portVersion
cmd:zstdcat$commandSuffix = $portVersion
cmd:zstdgrep$commandSuffix = $portVersion
cmd:zstdless$commandSuffix = $portVersion
cmd:zstdmt$commandSuffix = $portVersion
"
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
PROVIDES_bin="$PROVIDES_bin
cmd:pzstd$commandSuffix = $portVersion
"
fi
REQUIRES_bin="
haiku$secondaryArchSuffix
zstd$secondaryArchSuffix == $portVersion base
cmd:grep
cmd:less
lib:liblz4$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
REQUIRES_bin="$REQUIRES_bin
lib:liblzma$secondaryArchSuffix
"
fi
if [ -n "$secondaryArchSuffix" -a "$commandBinDir" = "$prefix"/bin ]; then
CONFLICTS_bin="
zstd_bin
"
fi
PROVIDES_devel="
zstd${secondaryArchSuffix}_devel = $portVersion
devel:libzstd$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
zstd$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:liblz4$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
BUILD_REQUIRES="$BUILD_REQUIRES
devel:liblzma$secondaryArchSuffix
"
fi
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:sed
"
TEST_REQUIRES="
cmd:python3
"
BUILD()
{
make PREFIX=$prefix INCLUDEDIR=$includeDir LIBDIR=$libDir $jobArgs
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
make -C contrib/pzstd
fi
}
INSTALL()
{
mkdir -p $libDir
make install PREFIX=$prefix LIBDIR=$libDir INCLUDEDIR=$includeDir \
BINDIR=$commandBinDir mandir=$manDir
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
make -C contrib/pzstd install PREFIX="$prefix" BINDIR="$commandBinDir"
fi
prepareInstalledDevelLib libzstd
fixPkgconfig
packageEntries bin \
$commandBinDir \
$manDir/man1
packageEntries devel \
$developDir
rmdir $manDir
install -d $docDir
install -t $docDir -m 444 LICENSE
}
TEST()
{
make test
make -C tests all
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
make -C contrib/pzstd test
fi
}

View File

@@ -1,157 +0,0 @@
SUMMARY="Zstandard, a fast real-time compression algorithm"
SUMMARY_bin="Command line tools to compress/decompress .zst files"
DESCRIPTION="Zstd, short for Zstandard, is a fast lossless compression \
algorithm, targeting real-time compression scenarios at zlib-level and better \
compression ratios. The zstd compression library provides in-memory \
compression and decompression functions. It offers a very wide range of \
compression / speed trade-off, while being backed by a very fast decoder. It \
also offers a special mode for small data, called dictionary compression, and \
can create dictionaries from any sample set."
HOMEPAGE="https://facebook.github.io/zstd/"
COPYRIGHT="2016-2018 Facebook, Inc."
LICENSE="BSD (2-clause)
GNU GPL v2"
REVISION="3"
SOURCE_URI="https://github.com/facebook/zstd/archive/v$portVersion.tar.gz"
SOURCE_FILENAME="zstd-$portVersion.tar.gz"
CHECKSUM_SHA256="f7de13462f7a82c29ab865820149e778cbfe01087b3a55b5332707abf9db4a6e"
PATCHES="zstd-$portVersion.patchset"
if [ "$effectiveTargetArchitecture" = x86_gcc2 ]; then
PATCHES="$PATCHES
zstd-$portVersion-gcc2.patchset
"
fi
ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ -n "$secondaryArchSuffix" ]; then
# Comment out this block if you wish to co-install zstd_bin & e.g. zstd_x86_bin.
commandSuffix=
commandBinDir=$prefix/bin
fi
libVersion="$portVersion"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
zstd$secondaryArchSuffix = $portVersion
lib:libzstd$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
"
PROVIDES_bin="
zstd${secondaryArchSuffix}_bin = $portVersion
cmd:unzstd$commandSuffix = $portVersion
cmd:zstd$commandSuffix = $portVersion
cmd:zstdcat$commandSuffix = $portVersion
cmd:zstdgrep$commandSuffix = $portVersion
cmd:zstdless$commandSuffix = $portVersion
cmd:zstdmt$commandSuffix = $portVersion
"
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
PROVIDES_bin="$PROVIDES_bin
cmd:pzstd$commandSuffix = $portVersion
"
fi
REQUIRES_bin="
haiku$secondaryArchSuffix
zstd$secondaryArchSuffix == $portVersion base
cmd:grep
cmd:less
lib:liblz4$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
REQUIRES_bin="$REQUIRES_bin
lib:liblzma$secondaryArchSuffix
"
fi
if [ -n "$secondaryArchSuffix" -a "$commandBinDir" = "$prefix"/bin ]; then
CONFLICTS_bin="
zstd_bin
"
fi
PROVIDES_devel="
zstd${secondaryArchSuffix}_devel = $portVersion
devel:libzstd$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
zstd$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:liblz4$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
BUILD_REQUIRES="$BUILD_REQUIRES
devel:liblzma$secondaryArchSuffix
"
fi
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:cmake
cmd:make
cmd:sed
cmd:find
"
TEST_REQUIRES="
cmd:python3
"
PATCH()
{
# avoid error on tests without static libs, we use LD_LIBRARY_PATH
sed '/build static library to build tests/d' -i build/cmake/CMakeLists.txt
sed 's/libzstd_static/libzstd_shared/g' -i build/cmake/tests/CMakeLists.txt
}
BUILD()
{
cd build/cmake
cmake . -DCMAKE_BUILD_TYPE=Release \
$cmakeDirArgs \
-DZSTD_BUILD_STATIC=OFF \
-DZSTD_BUILD_TESTS=ON \
-DZSTD_PROGRAMS_LINK_SHARED=ON
make
}
INSTALL()
{
cd build/cmake
make install
prepareInstalledDevelLib libzstd
fixPkgconfig
fixCMake
sed "s|$libDir|$developLibDir|g" \
-i $developLibDir/cmake/zstd/zstdTargets-release.cmake
packageEntries bin \
$commandBinDir \
$manDir/man1
packageEntries devel \
$developDir
rmdir $manDir
install -d $docDir
install -t $docDir -m 444 ../../LICENSE
}
TEST()
{
cd build/cmake
make test
}

View File

@@ -8,13 +8,13 @@ compression / speed trade-off, while being backed by a very fast decoder. It \
also offers a special mode for small data, called dictionary compression, and \
can create dictionaries from any sample set."
HOMEPAGE="https://facebook.github.io/zstd/"
COPYRIGHT="2016-2023 Facebook, Inc.
COPYRIGHT="2016-2024 Facebook, Inc.
Meta Platforms, Inc. and affiliates"
LICENSE="BSD (2-clause)
GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/facebook/zstd/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="98e9c3d949d1b924e28e01eccb7deed865eefebf25c2f21c702e5cd5b63b85e1"
CHECKSUM_SHA256="30f35f71c1203369dc979ecde0400ffea93c27391bfd2ac5a9715d2173d92ff7"
SOURCE_FILENAME="zstd-v$portVersion.tar.gz"
PATCHES="zstd-$portVersion.patchset"
if [ "$effectiveTargetArchitecture" = x86_gcc2 ]; then