pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/archivers/zstd



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.

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 <pthread.h>\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 <pthread.h>\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 <zlib.h>\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 <zlib.h>\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 <lzma.h>\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 <lzma.h>\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 <lz4frame.h>\n\#include <lz4.h>\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 <lz4frame.h>\n$(NUM_SYMBOL)include <lz4.h>\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
  



Home | Main Index | Thread Index | Old Index