The diff below updates lz4 to 1.11.0, which integrates multithreaded
compression directly into liblz4 while retaining binary compatibility
with previous versions. Release notes:
https://github.com/lz4/lz4/releases/tag/v1.11.0

All tests pass with `make test`, and I've done some light runtime
testing on amd64.

As far as I can tell, the port has 38 consumers. Would this warrant a
bulk build? If so, could someone help with that? I don't have a suitable
setup. Testing on other architectures would also be appreciated.

Tests, comments, and OKs are welcome.


diff --git Makefile Makefile
index 0c1ac428bcf..4757465ee83 100644
--- Makefile
+++ Makefile
@@ -2,7 +2,7 @@ COMMENT=        fast BSD-licensed data compression
 
 GH_ACCOUNT=    lz4
 GH_PROJECT=    lz4
-GH_TAGNAME=    v1.10.0
+GH_TAGNAME=    v1.11.0
 
 SHARED_LIBS=   lz4                       3.3
 
@@ -17,6 +17,8 @@ PERMIT_PACKAGE=       Yes
 
 WANTLIB=       c pthread
 
+TEST_DEPENDS=  sysutils/coreutils
+
 MAKE_FLAGS=    CC="${CC}" \
                CFLAGS="${CFLAGS} -DLZ4_FORCE_MEMORY_ACCESS=1" \
                MANDIR="${PREFIX}/man" \
@@ -34,4 +36,7 @@ DEBUG_PACKAGES=       ${BUILD_PACKAGES}
 ALL_TARGET=    default
 TEST_TARGET=   check
 
+pre-test:
+       ln -fs ${LOCALBASE}/bin/ghead ${WRKDIR}/bin/head
+
 .include <bsd.port.mk>
diff --git distinfo distinfo
index 92d34ed4b7a..3f44b254f4d 100644
--- distinfo
+++ distinfo
@@ -1,2 +1,2 @@
-SHA256 (lz4-1.10.0.tar.gz) = U3USkEdEs14jKRIFXM+Oxm12hjn/Or5XiNkNeS7F9Is=
-SIZE (lz4-1.10.0.tar.gz) = 387114
+SHA256 (lz4-1.11.0.tar.gz) = JH5fpk2l97de49077UhAdjlsnr6CVNnM9pPrYoAMXiY=
+SIZE (lz4-1.11.0.tar.gz) = 545646
diff --git patches/patch-lib_Makefile patches/patch-lib_Makefile
index 840e04395bc..de2e017a643 100644
--- patches/patch-lib_Makefile
+++ patches/patch-lib_Makefile
@@ -1,7 +1,7 @@
 Index: lib/Makefile
 --- lib/Makefile.orig
 +++ lib/Makefile
-@@ -212,8 +212,6 @@ install: lib liblz4.pc
+@@ -315,8 +315,6 @@ install:
        $(INSTALL_PROGRAM) $(LIBLZ4_EXP) $(DESTDIR)$(libdir)
      else
        $(INSTALL_PROGRAM) liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(libdir)
diff --git patches/patch-tests_Makefile patches/patch-tests_Makefile
new file mode 100644
index 00000000000..f3290d3eb45
--- /dev/null
+++ patches/patch-tests_Makefile
@@ -0,0 +1,14 @@
+Use $(MAKE) to avoid invoking BSD make with GNU make flags.
+
+Index: tests/Makefile
+--- tests/Makefile.orig
++++ tests/Makefile
+@@ -208,7 +208,7 @@ list:
+       $(GREP) '^[^#[:space:]].*:' Makefile | sed 's/:.*//' | sort | uniq
+ 
+ ifneq ($(TARGETSEARCH),NO)
+-ALL_TARGETS := $(shell make list TARGETSEARCH=NO)
++ALL_TARGETS := $(shell $(MAKE) list TARGETSEARCH=NO)
+ endif
+ TEST_TARGETS := $(filter test%,$(ALL_TARGETS))
+ .PHONY: $(TEST_TARGETS) # all targets starting by `test` are now .PHONY
diff --git patches/patch-tests_cli_test-lz4-multithread_sh 
patches/patch-tests_cli_test-lz4-multithread_sh
new file mode 100644
index 00000000000..fc66667debb
--- /dev/null
+++ patches/patch-tests_cli_test-lz4-multithread_sh
@@ -0,0 +1,15 @@
+Fix an OpenBSD test failure caused by assuming that rewriting an mmap(2) input
+must produce exit status 54.
+
+Index: tests/cli/test-lz4-multithread.sh
+--- tests/cli/test-lz4-multithread.sh.orig
++++ tests/cli/test-lz4-multithread.sh
+@@ -165,7 +165,7 @@ compressModified() {
+ # content already read is rewritten : memory-mapped input, read again, would 
be inconsistent (error 54) ;
+ # except on macOS, where a private mapping keeps the content as opened : then 
the output is valid
+ compressModified "" rewriteStart
+-if [ $MMAP = 1 ] && [ "$(uname)" != Darwin ]; then
++if [ $MMAP = 1 ] && [ "$(uname)" != Darwin ] && [ "$(uname)" != OpenBSD ]; 
then
+     test $rc = 54
+     grep -q "output removed" $FPREFIX.err
+     test ! -e $FPREFIX.fifo

Reply via email to