zstd: bump to 1.3.7. (#3299)

* Add "GNU GPL v2" to LICENSE, as the project is dual licensed.
* Amend TEST.
* Amend patchsets to allow TEST to build.
This commit is contained in:
fbrosson
2018-10-30 13:14:04 +00:00
parent ffab607beb
commit 0883e7f023
5 changed files with 158 additions and 142 deletions

View File

@@ -1,39 +0,0 @@
From 829c9878f057c1b1687d443a25e9ffa363162156 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 a376d30..9b4745c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -108,7 +108,7 @@ libzstd.a: $(ZSTD_OBJ)
libzstd.a-mt: CPPFLAGS += -DZSTD_MULTITHREAD
libzstd.a-mt: libzstd.a
-$(LIBZSTD): LDFLAGS += -shared -fPIC -fvisibility=hidden
+$(LIBZSTD): LDFLAGS += -shared -fPIC
$(LIBZSTD): $(ZSTD_FILES)
@echo compiling dynamic library $(LIBVER)
ifneq (,$(filter Windows%,$(OS)))
diff --git a/programs/Makefile b/programs/Makefile
index 579a349..e48057c 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -39,10 +39,9 @@ CPPFLAGS+= -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
-I$(ZSTDDIR)/dictBuilder \
-DXXH_NAMESPACE=ZSTD_
CFLAGS ?= -O3
-DEBUGFLAGS+=-Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
- -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
+DEBUGFLAGS+=-Wall -Wcast-qual -Wcast-align -Wshadow \
-Wstrict-prototypes -Wundef -Wpointer-arith -Wformat-security \
- -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
+ -Wformat=2 -Wwrite-strings \
-Wredundant-decls
CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
--
2.16.3

View File

@@ -1,101 +0,0 @@
From 9a5924ddf324ed11d83cf328363eb5646ae39299 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sun, 6 Aug 2017 22:27:54 +0200
Subject: Haiku patch
diff --git a/Makefile b/Makefile
index 59af7a0..8efb3b1 100644
--- a/Makefile
+++ b/Makefile
@@ -110,7 +110,7 @@ clean:
#------------------------------------------------------------------------------
# make install is validated only for Linux, macOS, Hurd and some BSD targets
#------------------------------------------------------------------------------
-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT))
+ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT Haiku))
HOST_OS = POSIX
CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON
diff --git a/lib/Makefile b/lib/Makefile
index 9cedd53..a376d30 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -154,7 +154,7 @@ clean:
#-----------------------------------------------------------------------------
# make install is validated only for Linux, macOS, BSD, Hurd and Solaris targets
#-----------------------------------------------------------------------------
-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS))
+ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku))
DESTDIR ?=
# directory variables : GNU conventions prefer lowercase
diff --git a/programs/Makefile b/programs/Makefile
index 4202764..579a349 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -245,7 +245,7 @@ preview-man: clean-man man
#-----------------------------------------------------------------------------
# make install is validated only for Linux, macOS, BSD, Hurd and Solaris targets
#-----------------------------------------------------------------------------
-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS))
+ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku))
.PHONY: list
list:
diff --git a/programs/platform.h b/programs/platform.h
index a550eb1..55aa4e3 100644
--- a/programs/platform.h
+++ b/programs/platform.h
@@ -70,9 +70,10 @@ extern "C" {
* PLATFORM_POSIX_VERSION >= 1 is equal to found _POSIX_VERSION
***************************************************************/
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)) /* UNIX-like OS */ \
- || defined(__midipix__) || defined(__VMS))
+ || defined(__midipix__) || defined(__VMS) || defined(__HAIKU__))
# if (defined(__APPLE__) && defined(__MACH__)) || defined(__SVR4) || defined(_AIX) || defined(__hpux) /* POSIX.1-2001 (SUSv3) conformant */ \
- || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) /* BSD distros */
+ || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) /* BSD distros */ \
+ || defined(__HAIKU__)
# define PLATFORM_POSIX_VERSION 200112L
# else
# if defined(__linux__) || defined(__linux)
diff --git a/programs/util.h b/programs/util.h
index 4392a5b..26299cf 100644
--- a/programs/util.h
+++ b/programs/util.h
@@ -64,7 +64,7 @@ extern "C" {
#elif PLATFORM_POSIX_VERSION >= 0 /* Unix-like operating system */
# include <unistd.h>
# include <sys/resource.h> /* setpriority */
-# if defined(PRIO_PROCESS)
+# if defined(PRIO_PROCESS) && !defined(__HAIKU__)
# define SET_REALTIME_PRIORITY setpriority(PRIO_PROCESS, 0, -20)
# else
# define SET_REALTIME_PRIORITY /* disabled */
--
2.16.3
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

View File

@@ -0,0 +1,102 @@
From 829c9878f057c1b1687d443a25e9ffa363162156 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 9711f75..5762ab9 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -23,10 +23,9 @@ 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 \
- -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
+DEBUGFLAGS= -Wall -Wcast-qual -Wcast-align -Wshadow \
-Wstrict-prototypes -Wundef -Wpointer-arith -Wformat-security \
- -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
+ -Wformat=2 -Wwrite-strings \
-Wredundant-decls -Wmissing-prototypes
CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
FLAGS = $(CPPFLAGS) $(CFLAGS)
@@ -122,7 +121,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)
@$(CC) $(FLAGS) $^ $(LDFLAGS) $(SONAME_FLAGS) -o $@
diff --git a/programs/Makefile b/programs/Makefile
index 32dbc67..69089dc 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -44,10 +44,9 @@ 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 \
- -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
+DEBUGFLAGS+=-Wall -Wcast-qual -Wcast-align -Wshadow \
-Wstrict-prototypes -Wundef -Wpointer-arith -Wformat-security \
- -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
+ -Wformat=2 -Wwrite-strings \
-Wredundant-decls -Wmissing-prototypes
CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
--
2.16.3
From 02dfa8b0cfcb5cfc363745a018cf7f155dd6cbb7 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 c63db80..a4c03d1 100644
--- a/Makefile
+++ b/Makefile
@@ -64,7 +64,7 @@ zlibwrapper: lib
## test: run long-duration tests
.PHONY: test
-test: MOREFLAGS += -g -DDEBUGLEVEL=1 -Werror
+test: MOREFLAGS += -g -DDEBUGLEVEL=1
test:
MOREFLAGS="$(MOREFLAGS)" $(MAKE) -j -C $(PRGDIR) allVariants
$(MAKE) -C $(TESTDIR) $@
--
2.19.1
From 542f558e6ed9ced51e8c2c82d5b3a989aaa0c504 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 2a96829..e9ead89 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -31,10 +31,9 @@ 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 \
- -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
+CFLAGS += -Wall -Wcast-qual -Wcast-align -Wshadow \
-Wstrict-prototypes -Wundef -Wformat-security \
- -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
+ -Wformat=2 -Wwrite-strings \
-Wredundant-decls -Wmissing-prototypes
CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
--
2.19.1

View File

@@ -0,0 +1,45 @@
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

@@ -9,11 +9,12 @@ 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)"
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="d6e1559e4cdb7c4226767d4ddc990bff5f9aab77085ff0d0490c828b025e2eea"
CHECKSUM_SHA256="5dd1e90eb16c25425880c8a91327f63de22891ffed082fcc17e5ae84fce0d5fb"
PATCHES="zstd-$portVersion.patchset"
if [ "$effectiveTargetArchitecture" = x86_gcc2 ]; then
PATCHES="$PATCHES
@@ -100,6 +101,10 @@ BUILD_PREREQUIRES="
cmd:sed
"
TEST_REQUIRES="
cmd:python3
"
BUILD()
{
make PREFIX=$prefix INCLUDEDIR=$includeDir LIBDIR=$libDir $jobArgs
@@ -136,4 +141,8 @@ INSTALL()
TEST()
{
make test
make -C tests all
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
make -C contrib/pzstd test
fi
}