Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified)) by mollari.NetBSD.org (Postfix) with ESMTPS id 7217E1A9217 for ; Thu, 1 Oct 2020 07:25:08 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id E29B684DED; Thu, 1 Oct 2020 07:25:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 662EC84DE4 for ; Thu, 1 Oct 2020 07:25:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id 7T5YpeQPQzIt for ; Thu, 1 Oct 2020 07:25:06 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 9162384D6E for ; Thu, 1 Oct 2020 07:25:06 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 8A173FB28; Thu, 1 Oct 2020 07:25:06 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1601537106258490" MIME-Version: 1.0 Date: Thu, 1 Oct 2020 07:25:06 +0000 From: "Michael Forney" Subject: CVS commit: pkgsrc/archivers/zstd To: pkgsrc-changes@NetBSD.org Reply-To: mcf@netbsd.org X-Mailer: log_accum Message-Id: <20201001072506.8A173FB28@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1601537106258490 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: mcf Date: Thu Oct 1 07:25:06 UTC 2020 Modified Files: pkgsrc/archivers/zstd: Makefile distinfo pkgsrc/archivers/zstd/patches: patch-lib_Makefile Log Message: zstd: fix library detection with GNU make 4.3 GNU make 4.3 no longer uses \ to escape # found inside function invocations, so the \ gets passed through to the printf commands, causing library detection to fail. lib/Makefile is patched on pkgsrc by copying detection logic from programs/Makefile, which has since been updated[0] to support make 4.3 using the compatibility trick suggested in the GNU make changelog. In particular, since we modify programs/Makefile to link the zstd binary with the libzstd shared library, failure to detect pthread in lib/Makefile results in a zstd built with ZSTD_MULTITHREAD to be linked against a libzstd built without it. This causes "Unsupported parameter" errors when it is used (except with --single-thread). So, apply the fix for programs/Makefile to lib/Makefile as well. [0] https://github.com/facebook/zstd/commit/06a57cf57e3c4e887cadcf688e3081154f3f6db4 To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 pkgsrc/archivers/zstd/Makefile cvs rdiff -u -r1.24 -r1.25 pkgsrc/archivers/zstd/distinfo cvs rdiff -u -r1.9 -r1.10 pkgsrc/archivers/zstd/patches/patch-lib_Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1601537106258490 Content-Disposition: inline Content-Length: 6394 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/archivers/zstd/Makefile diff -u pkgsrc/archivers/zstd/Makefile:1.30 pkgsrc/archivers/zstd/Makefile:1.31 --- pkgsrc/archivers/zstd/Makefile:1.30 Tue Jun 16 14:58:08 2020 +++ pkgsrc/archivers/zstd/Makefile Thu Oct 1 07:25:06 2020 @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.30 2020/06/16 14:58:08 wiz Exp $ +# $NetBSD: Makefile,v 1.31 2020/10/01 07:25:06 mcf Exp $ DISTNAME= zstd-1.4.5 +PKGREVISION= 1 CATEGORIES= archivers MASTER_SITES= ${MASTER_SITE_GITHUB:=facebook/} GITHUB_TAG= v${PKGVERSION_NOREV} Index: pkgsrc/archivers/zstd/distinfo diff -u pkgsrc/archivers/zstd/distinfo:1.24 pkgsrc/archivers/zstd/distinfo:1.25 --- pkgsrc/archivers/zstd/distinfo:1.24 Sun Jun 14 13:51:55 2020 +++ pkgsrc/archivers/zstd/distinfo Thu Oct 1 07:25:06 2020 @@ -1,10 +1,10 @@ -$NetBSD: distinfo,v 1.24 2020/06/14 13:51:55 adam Exp $ +$NetBSD: distinfo,v 1.25 2020/10/01 07:25:06 mcf Exp $ SHA1 (zstd-1.4.5.tar.gz) = 9c344c2660c990b6d6a9cced73db3a0dfe2b0092 RMD160 (zstd-1.4.5.tar.gz) = b7b9df3d4293eab050f84d2fc7f0a29c89905e87 SHA512 (zstd-1.4.5.tar.gz) = b03c497c3e0590c3d384cb856e3024f144b2bfac0d805d80e68deafa612c68237f12a2d657416d476a28059e80936c79f099fc42331464b417593895ea214387 Size (zstd-1.4.5.tar.gz) = 1987927 bytes SHA1 (patch-Makefile) = daf9d1946513ee24a4c4c187ec80878e9a578744 -SHA1 (patch-lib_Makefile) = 5005ffd50388520f69bd95012f696274e29fd3a9 +SHA1 (patch-lib_Makefile) = 07196103e013532ac60e1ce6dfc9f61de3367287 SHA1 (patch-programs_Makefile) = 2500df468c2994f1b33165c5d2774817bdc8addc SHA1 (patch-zlibWrapper_examples_minigzip.c) = 4ed0cb648bdd6efa61b3f66ba6eb1ea74b7767ec Index: pkgsrc/archivers/zstd/patches/patch-lib_Makefile diff -u pkgsrc/archivers/zstd/patches/patch-lib_Makefile:1.9 pkgsrc/archivers/zstd/patches/patch-lib_Makefile:1.10 --- pkgsrc/archivers/zstd/patches/patch-lib_Makefile:1.9 Sun Jun 14 13:51:55 2020 +++ pkgsrc/archivers/zstd/patches/patch-lib_Makefile Thu Oct 1 07:25:06 2020 @@ -1,4 +1,4 @@ -$NetBSD: patch-lib_Makefile,v 1.9 2020/06/14 13:51:55 adam Exp $ +$NetBSD: patch-lib_Makefile,v 1.10 2020/10/01 07:25:06 mcf Exp $ Detect and use third-party libraries (taken from programs/Makefile). -fvisibility=hidden makes error when linking. @@ -7,14 +7,17 @@ Fix pkgconfig installation path. --- lib/Makefile.orig 2020-05-22 05:04:00.000000000 +0000 +++ lib/Makefile -@@ -165,6 +165,40 @@ CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZST +@@ -165,6 +165,43 @@ CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZST ZSTD_OBJ := $(patsubst %.c,%.o,$(ZSTD_FILES)) +VOID = /dev/null + ++# Make 4.3 doesn't support '\#' anymore (https://lwn.net/Articles/810071/) ++NUM_SYMBOL := \# ++ +# thread detection -+HAVE_PTHREAD := $(shell printf '\#include \nint main(void) { return 0; }' | $(CC) $(FLAGS) -o have_pthread$(EXT) -x c - -pthread 2> $(VOID) && rm have_pthread$(EXT) && echo 1 || echo 0) ++HAVE_PTHREAD := $(shell printf '$(NUM_SYMBOL)include \nint main(void) { return 0; }' | $(CC) $(FLAGS) -o have_pthread$(EXT) -x c - -pthread 2> $(VOID) && rm have_pthread$(EXT) && echo 1 || echo 0) +HAVE_THREAD := $(shell [ "$(HAVE_PTHREAD)" -eq "1" -o -n "$(filter Windows%,$(OS))" ] && echo 1 || echo 0) +ifeq ($(HAVE_THREAD), 1) +THREAD_MSG := ==> building with threading support @@ -23,7 +26,7 @@ Fix pkgconfig installation path. +endif + +# zlib detection -+HAVE_ZLIB := $(shell printf '\#include \nint main(void) { return 0; }' | $(CC) $(FLAGS) -o have_zlib$(EXT) -x c - -lz 2> $(VOID) && rm have_zlib$(EXT) && echo 1 || echo 0) ++HAVE_ZLIB := $(shell printf '$(NUM_SYMBOL)include \nint main(void) { return 0; }' | $(CC) $(FLAGS) -o have_zlib$(EXT) -x c - -lz 2> $(VOID) && rm have_zlib$(EXT) && echo 1 || echo 0) +ifeq ($(HAVE_ZLIB), 1) +ZLIB_MSG := ==> building zstd with .gz compression support +ZLIBCPP = -DZSTD_GZCOMPRESS -DZSTD_GZDECOMPRESS @@ -31,14 +34,14 @@ Fix pkgconfig installation path. +endif + +# lzma detection -+HAVE_LZMA := $(shell printf '\#include \nint main(void) { return 0; }' | $(CC) $(FLAGS) -o have_lzma$(EXT) -x c - -llzma 2> $(VOID) && rm have_lzma$(EXT) && echo 1 || echo 0) ++HAVE_LZMA := $(shell printf '$(NUM_SYMBOL)include \nint main(void) { return 0; }' | $(CC) $(FLAGS) -o have_lzma$(EXT) -x c - -llzma 2> $(VOID) && rm have_lzma$(EXT) && echo 1 || echo 0) +ifeq ($(HAVE_LZMA), 1) +LZMACPP = -DZSTD_LZMACOMPRESS -DZSTD_LZMADECOMPRESS +LZMALD = -llzma +endif + +# lz4 detection -+HAVE_LZ4 := $(shell printf '\#include \n\#include \nint main(void) { return 0; }' | $(CC) $(FLAGS) -o have_lz4$(EXT) -x c - -llz4 2> $(VOID) && rm have_lz4$(EXT) && echo 1 || echo 0) ++HAVE_LZ4 := $(shell printf '$(NUM_SYMBOL)include \n$(NUM_SYMBOL)include \nint main(void) { return 0; }' | $(CC) $(FLAGS) -o have_lz4$(EXT) -x c - -llz4 2> $(VOID) && rm have_lz4$(EXT) && echo 1 || echo 0) +ifeq ($(HAVE_LZ4), 1) +LZ4CPP = -DZSTD_LZ4COMPRESS -DZSTD_LZ4DECOMPRESS +LZ4LD = -llz4 @@ -48,7 +51,7 @@ Fix pkgconfig installation path. # macOS linker doesn't support -soname, and use different extension # see : https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html ifeq ($(shell uname), Darwin) -@@ -204,7 +238,8 @@ $(LIBZSTD): $(ZSTD_FILES) +@@ -204,7 +241,8 @@ $(LIBZSTD): $(ZSTD_FILES) else LIBZSTD = libzstd.$(SHARED_EXT_VER) @@ -58,7 +61,7 @@ Fix pkgconfig installation path. $(LIBZSTD): $(ZSTD_FILES) @echo compiling dynamic library $(LIBVER) $(Q)$(CC) $(FLAGS) $^ $(LDFLAGS) $(SONAME_FLAGS) -o $@ -@@ -251,7 +286,6 @@ clean: +@@ -251,7 +289,6 @@ clean: #----------------------------------------------------------------------------- # make install is validated only for below listed environments #----------------------------------------------------------------------------- @@ -66,7 +69,7 @@ Fix pkgconfig installation path. all: libzstd.pc -@@ -287,11 +321,7 @@ $(error configured includedir ($(INCLUDE +@@ -287,11 +324,7 @@ $(error configured includedir ($(INCLUDE endif endif @@ -78,7 +81,7 @@ Fix pkgconfig installation path. ifneq (,$(filter $(shell uname),SunOS)) INSTALL ?= ginstall -@@ -351,4 +381,3 @@ uninstall: +@@ -351,4 +384,3 @@ uninstall: $(Q)$(RM) $(DESTDIR)$(INCLUDEDIR)/zdict.h @echo zstd libraries successfully uninstalled --_----------=_1601537106258490--