Enclosed a diff for bringing archivers/zstd to 1.3.5, which is
a maintenance release focused on dictionary compression performance.
Changelog can be found at https://github.com/facebook/zstd/releases

A couple of patches have been deleted as these have been accepted
upstream.

Bumped minor of shared lib as symbols have been added. While here change
email address of ${MAINTAINER}.

'make test' runs successfully, and consumers have been build tested.
Tested more intensively with borgbackup (zstd is used as archive
format).

OK?


Index: Makefile
===================================================================
RCS file: /cvs/ports/archivers/zstd/Makefile,v
retrieving revision 1.17
diff -u -p -r1.17 Makefile
--- Makefile    12 May 2018 14:49:01 -0000      1.17
+++ Makefile    29 Jun 2018 13:45:49 -0000
@@ -4,14 +4,14 @@ COMMENT =             zstandard fast real-time comp
 
 GH_ACCOUNT =           facebook
 GH_PROJECT =           zstd
-GH_TAGNAME =           v1.3.4
-SHARED_LIBS =          zstd    1.0     # 1.3.4
+GH_TAGNAME =           v1.3.5
+SHARED_LIBS =          zstd    1.1     # 1.3.5
 
 CATEGORIES =           archivers
 
 HOMEPAGE =             https://facebook.github.io/zstd/
 
-MAINTAINER =           Bjorn Ketelaars <bjorn.ketela...@hydroxide.nl>
+MAINTAINER =           Bjorn Ketelaars <b...@openbsd.org>
 
 # BSD 3 clauses + GPLv2
 PERMIT_PACKAGE_CDROM = Yes
Index: distinfo
===================================================================
RCS file: /cvs/ports/archivers/zstd/distinfo,v
retrieving revision 1.10
diff -u -p -r1.10 distinfo
--- distinfo    4 Apr 2018 16:10:02 -0000       1.10
+++ distinfo    29 Jun 2018 13:45:49 -0000
@@ -1,2 +1,2 @@
-SHA256 (zstd-1.3.4.tar.gz) = kuQbbo3Sa71GJI6KodhvFVG8Ihp5Yneuk2KVTybWBak=
-SIZE (zstd-1.3.4.tar.gz) = 2059958
+SHA256 (zstd-1.3.5.tar.gz) = 1uFVnkzbfEImdn1N3JkL/1+aq3cIX/DQSQyCiwJeLuo=
+SIZE (zstd-1.3.5.tar.gz) = 1706005
Index: patches/patch-Makefile
===================================================================
RCS file: patches/patch-Makefile
diff -N patches/patch-Makefile
--- patches/patch-Makefile      4 Apr 2018 16:10:02 -0000       1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-Makefile,v 1.2 2018/04/04 16:10:02 bket Exp $
-
-Index: Makefile
---- Makefile.orig
-+++ Makefile
-@@ -120,7 +120,7 @@ clean:
- 
#------------------------------------------------------------------------------
- # make install is validated only for Linux, OSX, Hurd and some BSD targets
- 
#------------------------------------------------------------------------------
--ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD 
DragonFly NetBSD MSYS_NT))
-+ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD 
DragonFly NetBSD MSYS_NT))
- 
- 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
Index: patches/patch-examples_Makefile
===================================================================
RCS file: patches/patch-examples_Makefile
diff -N patches/patch-examples_Makefile
--- patches/patch-examples_Makefile     4 Apr 2018 16:10:02 -0000       1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-examples_Makefile,v 1.1 2018/04/04 16:10:02 bket Exp $
-
-Index: examples/Makefile
---- examples/Makefile.orig
-+++ examples/Makefile
-@@ -22,7 +22,7 @@ all: simple_compression simple_decompression \
-       multiple_streaming_compression streaming_memory_usage
- 
- $(LIB) :
--      make -C ../lib libzstd.a
-+      $(MAKE) -C ../lib libzstd.a
- 
- simple_compression : simple_compression.c $(LIB)
-       $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@
Index: patches/patch-lib_Makefile
===================================================================
RCS file: /cvs/ports/archivers/zstd/patches/patch-lib_Makefile,v
retrieving revision 1.1
diff -u -p -r1.1 patch-lib_Makefile
--- patches/patch-lib_Makefile  4 Jan 2018 14:47:20 -0000       1.1
+++ patches/patch-lib_Makefile  29 Jun 2018 13:45:49 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-lib_Makefile,v 1.1 2018/
 Index: lib/Makefile
 --- lib/Makefile.orig
 +++ lib/Makefile
-@@ -51,10 +51,10 @@ ifeq ($(shell uname), Darwin)
+@@ -85,10 +85,10 @@ ifeq ($(shell uname), Darwin)
        SHARED_EXT_VER = $(LIBVER).$(SHARED_EXT)
        SONAME_FLAGS = -install_name $(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR) 
-compatibility_version $(LIBVER_MAJOR) -current_version $(LIBVER)
  else
@@ -16,7 +16,7 @@ Index: lib/Makefile
  endif
  
  LIBZSTD = libzstd.$(SHARED_EXT_VER)
-@@ -69,7 +69,7 @@ all: lib
+@@ -103,7 +103,7 @@ all: lib
  libzstd.a: ARFLAGS = rcs
  libzstd.a: $(ZSTD_OBJ)
        @echo compiling static library
@@ -25,7 +25,7 @@ Index: lib/Makefile
  
  libzstd.a-mt: CPPFLAGS += -DZSTD_MULTITHREAD
  libzstd.a-mt: libzstd.a
-@@ -81,7 +81,7 @@ ifneq (,$(filter Windows%,$(OS)))
+@@ -115,7 +115,7 @@ ifneq (,$(filter Windows%,$(OS)))
        @$(CC) $(FLAGS) -DZSTD_DLL_EXPORT=1 -shared $^ -o dll\libzstd.dll
        dlltool -D dll\libzstd.dll -d dll\libzstd.def -l dll\libzstd.lib
  else
@@ -34,21 +34,12 @@ Index: lib/Makefile
        @echo creating versioned links
        @ln -sf $@ libzstd.$(SHARED_EXT_MAJOR)
        @ln -sf $@ libzstd.$(SHARED_EXT)
-@@ -134,7 +134,7 @@ LIBDIR      ?= $(libdir)
- includedir  ?= $(PREFIX)/include
- INCLUDEDIR  ?= $(includedir)
- 
--ifneq (,$(filter $(shell uname),OpenBSD FreeBSD NetBSD DragonFly))
-+ifneq (,$(filter $(shell uname),FreeBSD NetBSD DragonFly))
- PKGCONFIGDIR ?= $(PREFIX)/libdata/pkgconfig
- else
- PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig
-@@ -165,8 +165,6 @@ install: libzstd.a libzstd libzstd.pc
-       @echo Installing libraries
-       @$(INSTALL_DATA) libzstd.a $(DESTDIR)$(LIBDIR)
+@@ -209,8 +209,6 @@ install-shared: libzstd
+       @echo Installing shared library
+       @$(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/
        @$(INSTALL_PROGRAM) $(LIBZSTD) $(DESTDIR)$(LIBDIR)
 -      @ln -sf $(LIBZSTD) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR)
 -      @ln -sf $(LIBZSTD) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT)
+ 
+ install-includes:
        @echo Installing includes
-       @$(INSTALL_DATA) zstd.h $(DESTDIR)$(INCLUDEDIR)
-       @$(INSTALL_DATA) common/zstd_errors.h $(DESTDIR)$(INCLUDEDIR)
Index: patches/patch-lib_dictBuilder_cover_c
===================================================================
RCS file: patches/patch-lib_dictBuilder_cover_c
diff -N patches/patch-lib_dictBuilder_cover_c
--- patches/patch-lib_dictBuilder_cover_c       4 Apr 2018 16:10:02 -0000       
1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-$OpenBSD: patch-lib_dictBuilder_cover_c,v 1.1 2018/04/04 16:10:02 bket Exp $
-
-zstd doesn't play nice with libc's qsort(). Reason is that qsort() is not
-guaranteed to be stable. Proposed fix is to use libc's mergesort() instead.
-
-https://github.com/facebook/zstd/issues/1088
-
-Index: lib/dictBuilder/cover.c
---- lib/dictBuilder/cover.c.orig
-+++ lib/dictBuilder/cover.c
-@@ -583,7 +583,7 @@ static int COVER_ctx_init(COVER_ctx_t *ctx, const void
-     }
-     /* qsort doesn't take an opaque pointer, so pass as a global */
-     g_ctx = ctx;
--    qsort(ctx->suffix, ctx->suffixSize, sizeof(U32),
-+    mergesort(ctx->suffix, ctx->suffixSize, sizeof(U32),
-           (ctx->d <= 8 ? &COVER_strict_cmp8 : &COVER_strict_cmp));
-   }
-   DISPLAYLEVEL(2, "Computing frequencies\n");
Index: patches/patch-tests_playTests_sh
===================================================================
RCS file: /cvs/ports/archivers/zstd/patches/patch-tests_playTests_sh,v
retrieving revision 1.9
diff -u -p -r1.9 patch-tests_playTests_sh
--- patches/patch-tests_playTests_sh    4 Apr 2018 16:10:02 -0000       1.9
+++ patches/patch-tests_playTests_sh    29 Jun 2018 13:45:49 -0000
@@ -1,21 +1,19 @@
-$OpenBSD: patch-tests_playTests_sh,v 1.9 2018/04/04 16:10:02 bket Exp $
+$OpenBSD$
+
+Revert https://github.com/facebook/zstd/pull/1124 as it causes 'make test' to
+fail. This is explained by a test trying to write to /dev/random, which fails
+as a regular user is not allowed to write to this device. /dev/zero has
+different permissions set.
+
 Index: tests/playTests.sh
 --- tests/playTests.sh.orig
 +++ tests/playTests.sh
-@@ -69,6 +69,7 @@ UNAME=$(uname)
- case "$UNAME" in
-   Darwin) MD5SUM="md5 -r" ;;
-   FreeBSD) MD5SUM="gmd5sum" ;;
-+  OpenBSD) MD5SUM="md5" ;;
-   *) MD5SUM="md5sum" ;;
- esac
+@@ -56,7 +56,7 @@ fi
  
-@@ -258,7 +259,7 @@ rm ./*.tmp ./*.zstd
- $ECHO "frame concatenation tests completed"
- 
- 
--if [ "$isWindows" = false ] && [ "$UNAME" != 'SunOS' ] ; then
-+if [ "$isWindows" = false ] && [ "$UNAME" != 'SunOS' ] && [ "$(uname -s)" != 
"OpenBSD" ] ; then
- $ECHO "\n**** flush write error test **** "
- 
- $ECHO "$ECHO foo | $ZSTD > /dev/full"
+ isWindows=false
+ INTOVOID="/dev/null"
+-DEVDEVICE="/dev/random"
++DEVDEVICE="/dev/zero"
+ case "$OS" in
+   Windows*)
+     isWindows=true

Reply via email to