NetBSD Problem Report #56225

From www@netbsd.org  Tue Jun  1 07:24:59 2021
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_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 C1E8D1A92AF
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  1 Jun 2021 07:24:59 +0000 (UTC)
Message-Id: <20210601072457.BFAAA1A92CA@mollari.NetBSD.org>
Date: Tue,  1 Jun 2021 07:24:57 +0000 (UTC)
From: pekdon@gmail.com
Reply-To: pekdon@gmail.com
To: gnats-bugs@NetBSD.org
Subject: zstd compile issues on Solaris 10
X-Send-Pr-Version: www-1.0

>Number:         56225
>Category:       pkg
>Synopsis:       zstd compile issues on Solaris 10
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 01 07:25:00 +0000 2021
>Last-Modified:  Tue Nov 30 16:50:01 +0000 2021
>Originator:     Claes Nstn
>Release:        trunk 2021-06-01
>Organization:
>Environment:
SunOS u40 5.10 Generic_147148-26 i86pc i386 i86pc

>Description:
zstd fails to compile and install on Solaris 10 due to two reasons:

* Use of nanosleep without -lrt
* test in /bin/sh does not support -e, used in the install targets
>How-To-Repeat:
Build zstd on Solaris 10
>Fix:
diff --git a/archivers/zstd/Makefile b/archivers/zstd/Makefile
index 6ed5adc2e99..6dc8cc205d2 100644
--- a/archivers/zstd/Makefile
+++ b/archivers/zstd/Makefile
@@ -34,7 +34,7 @@ MAKE_ENV+=            BUILD_DIR=obj
 MAKE_ENV+=             HASH=${FALSE}

 USE_LANGUAGES=         c c++
-USE_TOOLS+=            ggrep gmake pkg-config
+USE_TOOLS+=            ggrep gmake pkg-config gtest
 PKGCONFIG_OVERRIDE+=   lib/libzstd.pc.in
 MAKE_FLAGS=            MANDIR=${PREFIX}/${PKGMANDIR}
 MAKE_FLAGS+=           mandir=${PREFIX}/${PKGMANDIR}
diff --git a/archivers/zstd/distinfo b/archivers/zstd/distinfo
index e2e118ca756..945ffa20935 100644
--- a/archivers/zstd/distinfo
+++ b/archivers/zstd/distinfo
@@ -4,8 +4,10 @@ SHA1 (zstd-1.5.0.tar.gz) = 3299248fcd44d7f21ba2f1f198c1173eeb3c4f32
 RMD160 (zstd-1.5.0.tar.gz) = c636d4cb4113bd56e3deade6778e08c73a06937e
 SHA512 (zstd-1.5.0.tar.gz) = 25b657529a698eec891f92ff4a085d1fd95d2ff938ce52c8a4ff6163eb0b668ec642dd09e0db190652638cd92371006afa01d8e437437762c4097ad301675c33
 Size (zstd-1.5.0.tar.gz) = 1867111 bytes
-SHA1 (patch-Makefile) = b7e72910488e946971cde5ad2fac6a6134dbd70b
-SHA1 (patch-lib_Makefile) = 2475241f1f75d353bf6deeccb4f391cd6626aed2
-SHA1 (patch-tests_Makefile) = b83de10222859d656468463071dbce70adcc22b1
+SHA1 (patch-Makefile) = c87768f8b15c537bfe09687d878e0a598c2afe13
+SHA1 (patch-lib_Makefile) = 0978707192cb08e0862735c3aff667b7c08b701b
+SHA1 (patch-programs_Makefile) = 54e94c53e70740a12216a33e95ef47b6749ee038
+SHA1 (patch-tests_Makefile) = 96f91d5d24fcfba0101416189b16b00fd8dacb66
 SHA1 (patch-tests_playTests.sh) = 349f8e400f46b5914add4aee955a040045f62779
+SHA1 (patch-zlibWrapper_Makefile) = cf310df7b78c3c182bd8c0a536bef9b837e4bf0b
 SHA1 (patch-zlibWrapper_examples_minigzip.c) = 4ed0cb648bdd6efa61b3f66ba6eb1ea74b7767ec
diff --git a/archivers/zstd/patches/patch-Makefile b/archivers/zstd/patches/patch-Makefile
index d1101dae32b..e13f350c41c 100644
--- a/archivers/zstd/patches/patch-Makefile
+++ b/archivers/zstd/patches/patch-Makefile
@@ -4,7 +4,16 @@ Enable the "install" target on all OS.

 --- Makefile.orig      2021-05-14 14:59:34.000000000 +0000
 +++ Makefile
-@@ -148,7 +148,6 @@ clean:
+@@ -21,6 +21,8 @@ FUZZDIR  = $(TESTDIR)/fuzz
+ # Define nul output
+ VOID = /dev/null
+ 
++TEST ?= /usr/bin/env test
++
+ # When cross-compiling from linux to windows, you might
+ # need to specify this as "Windows." Fedora build fails
+ # without it.
+@@ -148,7 +150,6 @@ clean:
  #------------------------------------------------------------------------------
  # make install is validated only for Linux, macOS, Hurd and some BSD targets
  #------------------------------------------------------------------------------
@@ -12,9 +21,12 @@ Enable the "install" target on all OS.

  HOST_OS = POSIX

-@@ -354,7 +353,6 @@ clang38install:
+@@ -352,9 +353,8 @@ clang38install:
+ 
+ # Ubuntu 14.04 ships a too-old lz4
  lz4install:
-       [ -e lz4 ] || git clone https://github.com/lz4/lz4 && sudo $(MAKE) -C lz4 install
+-      [ -e lz4 ] || git clone https://github.com/lz4/lz4 && sudo $(MAKE) -C lz4 install
++      $(TEST) -e lz4 || git clone https://github.com/lz4/lz4 && sudo $(MAKE) -C lz4 install

 -endif

diff --git a/archivers/zstd/patches/patch-lib_Makefile b/archivers/zstd/patches/patch-lib_Makefile
index 9f177a8b072..0f102fdd46e 100644
--- a/archivers/zstd/patches/patch-lib_Makefile
+++ b/archivers/zstd/patches/patch-lib_Makefile
@@ -7,7 +7,15 @@ Fix pkgconfig installation path.

 --- lib/Makefile.orig  2021-05-14 14:59:34.000000000 +0000
 +++ lib/Makefile
-@@ -204,6 +204,43 @@ endif
+@@ -34,6 +34,7 @@ LIBVER_PATCH := $(shell echo $(LIBVER_PA
+ LIBVER := $(shell echo $(LIBVER_SCRIPT))
+ VERSION?= $(LIBVER)
+ CCVER := $(shell $(CC) --version)
++TEST ?= /usr/bin/env test
+ 
+ # ZSTD_LIB_MINIFY is a helper variable that
+ # configures a bunch of other variables to space-optimized defaults.
+@@ -204,6 +205,43 @@ endif
  endif # BUILD_DIR


@@ -51,7 +59,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 ($(UNAME), Darwin)
-@@ -374,7 +411,6 @@ clean:
+@@ -374,7 +412,6 @@ clean:
  #-----------------------------------------------------------------------------
  # make install is validated only for below listed environments
  #-----------------------------------------------------------------------------
@@ -59,7 +67,7 @@ Fix pkgconfig installation path.

  all: libzstd.pc

-@@ -405,11 +441,7 @@ PCLIBPREFIX := $(if $(findstring $(LIBDI
+@@ -405,11 +442,7 @@ PCLIBPREFIX := $(if $(findstring $(LIBDI
  # to PREFIX, rather than as a resolved value.
  PCEXEC_PREFIX := $(if $(HAS_EXPLICIT_EXEC_PREFIX),$(EXEC_PREFIX),$${prefix})

@@ -71,7 +79,44 @@ Fix pkgconfig installation path.

  ifneq (,$(filter $(UNAME),SunOS))
    INSTALL ?= ginstall
-@@ -479,4 +511,3 @@ uninstall:
+@@ -438,22 +471,22 @@ install: install-pc install-static insta
+ 
+ .PHONY: install-pc
+ install-pc: libzstd.pc
+-      [ -e $(DESTDIR)$(PKGCONFIGDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/
++      $(TEST) -e $(DESTDIR)$(PKGCONFIGDIR) || $(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/
+       $(INSTALL_DATA) libzstd.pc $(DESTDIR)$(PKGCONFIGDIR)/
+ 
+ .PHONY: install-static
+ install-static:
+       # only generate libzstd.a if it's not already present
+-      [ -e libzstd.a ] || $(MAKE) libzstd.a-release
+-      [ -e $(DESTDIR)$(LIBDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/
++      $(TEST) -e libzstd.a || $(MAKE) libzstd.a-release
++      $(TEST) -e $(DESTDIR)$(LIBDIR) || $(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/
+       @echo Installing static library
+       $(INSTALL_DATA) libzstd.a $(DESTDIR)$(LIBDIR)
+ 
+ .PHONY: install-shared
+ install-shared:
+       # only generate libzstd.so if it's not already present
+-      [ -e $(LIBZSTD) ] || $(MAKE) libzstd-release
+-      [ -e $(DESTDIR)$(LIBDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/
++      $(TEST) -e $(LIBZSTD) || $(MAKE) libzstd-release
++      $(TEST) -e $(DESTDIR)$(LIBDIR) || $(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/
+       @echo Installing shared library
+       $(INSTALL_PROGRAM) $(LIBZSTD) $(DESTDIR)$(LIBDIR)
+       ln -sf $(LIBZSTD) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR)
+@@ -461,7 +494,7 @@ install-shared:
+ 
+ .PHONY: install-includes
+ install-includes:
+-      [ -e $(DESTDIR)$(INCLUDEDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR)/
++      $(TEST) -e $(DESTDIR)$(INCLUDEDIR) || $(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR)/
+       @echo Installing includes
+       $(INSTALL_DATA) zstd.h $(DESTDIR)$(INCLUDEDIR)
+       $(INSTALL_DATA) zstd_errors.h $(DESTDIR)$(INCLUDEDIR)
+@@ -479,4 +512,3 @@ uninstall:
        $(RM) $(DESTDIR)$(INCLUDEDIR)/zdict.h
        @echo zstd libraries successfully uninstalled

diff --git a/archivers/zstd/patches/patch-programs_Makefile b/archivers/zstd/patches/patch-programs_Makefile
new file mode 100644
index 00000000000..939173f08e3
--- /dev/null
+++ b/archivers/zstd/patches/patch-programs_Makefile
@@ -0,0 +1,35 @@
+$NetBSD$
+
+--- programs/Makefile.orig     2021-05-14 14:59:34.000000000 +0000
++++ programs/Makefile
+@@ -44,6 +44,8 @@ ifeq ($HAVE_COLORNEVER, 1)
+ endif
+ GREP = grep $(GREP_OPTIONS)
+ 
++TEST = /usr/bin/env test
++
+ ifeq ($(shell $(CC) -v 2>&1 | $(GREP) -c "gcc version "), 1)
+   ALIGN_LOOP = -falign-loops=32
+ else
+@@ -317,7 +319,7 @@ zstd-pgo :
+       ./zstd -b7i2 $(PROFILE_WITH)
+       ./zstd -b5 $(PROFILE_WITH)
+       $(RM) zstd *.o
+-      case $(CC) in *clang*) if ! [ -e default.profdata ]; then llvm-profdata merge -output=default.profdata default*.profraw; fi ;; esac
++      case $(CC) in *clang*) if ! $(TEST) -e default.profdata; then llvm-profdata merge -output=default.profdata default*.profraw; fi ;; esac
+       $(MAKE) zstd MOREFLAGS=-fprofile-use
+ 
+ ## zstd-small: minimal target, supporting only zstd compression and decompression. no bench. no legacy. no other format.
+@@ -475,9 +477,9 @@ INSTALL_MAN     ?= $(INSTALL_DATA)
+ .PHONY: install
+ install:
+       # generate zstd only if not already present
+-      [ -e zstd ] || $(MAKE) zstd-release
+-      [ -e $(DESTDIR)$(BINDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/
+-      [ -e $(DESTDIR)$(MAN1DIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(MAN1DIR)/
++      $(TEST) -e zstd || $(MAKE) zstd-release
++      $(TEST) -e $(DESTDIR)$(BINDIR) || $(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/
++      $(TEST) -e $(DESTDIR)$(MAN1DIR) || $(INSTALL) -d -m 755 $(DESTDIR)$(MAN1DIR)/
+       @echo Installing binaries
+       $(INSTALL_PROGRAM) zstd$(EXT) $(DESTDIR)$(BINDIR)/zstd$(EXT)
+       ln -sf zstd$(EXT) $(DESTDIR)$(BINDIR)/zstdcat$(EXT)
diff --git a/archivers/zstd/patches/patch-tests_Makefile b/archivers/zstd/patches/patch-tests_Makefile
index ede84f63759..c3e0e11a263 100644
--- a/archivers/zstd/patches/patch-tests_Makefile
+++ b/archivers/zstd/patches/patch-tests_Makefile
@@ -2,9 +2,58 @@ $NetBSD: patch-tests_Makefile,v 1.1 2021/02/27 16:40:59 wiz Exp $

 Fix running tests with shared zstd library.

---- tests/Makefile.orig        2020-12-19 00:39:42.000000000 +0000
+--- tests/Makefile.orig        2021-05-14 14:59:34.000000000 +0000
 +++ tests/Makefile
-@@ -327,7 +327,7 @@ test-zstd-nolegacy: zstd-nolegacy
+@@ -60,6 +60,9 @@ ZSTDMT_OBJ2 := $(subst $(ZSTDDIR)/compre
+ ZSTDMT_OBJ3 := $(subst $(ZSTDDIR)/decompress/,zstdmt_d_,$(ZSTDMT_OBJ2))
+ ZSTDMT_OBJECTS := $(ZSTDMT_OBJ3:.c=.o)
+ 
++UNAME := $(shell uname)
++UNAME_R := $(shell uname -r)
++
+ # Define *.exe as extension for Windows systems
+ ifneq (,$(filter Windows%,$(OS)))
+ EXT =.exe
+@@ -72,6 +75,12 @@ MULTITHREAD_LD  = -pthread
+ endif
+ MULTITHREAD = $(MULTITHREAD_CPP) $(MULTITHREAD_LD)
+ 
++ifneq (,$(filter $(UNAME),SunOS))
++ifeq (5.10,$(UNAME_R))
++NANOSLEEP_LD = -lrt
++endif
++endif
++
+ VOID = /dev/null
+ ZSTREAM_TESTTIME ?= -T90s
+ FUZZERTEST ?= -T200s
+@@ -148,7 +157,7 @@ fullbench-dll: $(PRGDIR)/datagen.c $(PRG
+       $(LINK.c) $^ $(LDLIBS) -o $@$(EXT)
+ 
+ fuzzer : CPPFLAGS += $(MULTITHREAD_CPP) -Wno-deprecated-declarations
+-fuzzer : LDFLAGS += $(MULTITHREAD_LD)
++fuzzer : LDFLAGS += $(MULTITHREAD_LD) $(NANOSLEEP_LD)
+ fuzzer : $(ZSTDMT_OBJECTS)
+ fuzzer fuzzer32 : $(ZDICT_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c fuzzer.c
+ 
+@@ -208,7 +217,7 @@ decodecorpus : LDLIBS += -lm
+ decodecorpus : $(filter-out zstdc_zstd_compress.o, $(ZSTD_OBJECTS)) $(ZDICT_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c decodecorpus.c
+ 
+ poolTests : $(PRGDIR)/util.c $(PRGDIR)/timefn.c poolTests.c $(ZSTDDIR)/common/pool.c $(ZSTDDIR)/common/threading.c $(ZSTDDIR)/common/zstd_common.c $(ZSTDDIR)/common/error_private.c
+-      $(LINK.c) $(MULTITHREAD) $^ -o $@$(EXT)
++      $(LINK.c) $(MULTITHREAD) $(NANOSLEEP_LD) $^ -o $@$(EXT)
+ 
+ .PHONY: versionsTest
+ versionsTest: clean
+@@ -243,7 +252,6 @@ clean:
+ #----------------------------------------------------------------------------------
+ # valgrind tests are validated only for some posix platforms
+ #----------------------------------------------------------------------------------
+-UNAME := $(shell uname)
+ ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS))
+ HOST_OS = POSIX
+ 
+@@ -317,7 +325,7 @@ test-zstd-nolegacy: zstd-nolegacy

  test-zstd test-zstd32 test-zstd-nolegacy: datagen
        file $(ZSTD)
diff --git a/archivers/zstd/patches/patch-zlibWrapper_Makefile b/archivers/zstd/patches/patch-zlibWrapper_Makefile
new file mode 100644
index 00000000000..80d31009a90
--- /dev/null
+++ b/archivers/zstd/patches/patch-zlibWrapper_Makefile
@@ -0,0 +1,35 @@
+$NetBSD$
+
+--- zlibWrapper/Makefile.orig  2021-06-01 06:48:51.639135599 +0000
++++ zlibWrapper/Makefile
+@@ -33,6 +33,9 @@ CFLAGS   += $(STDFLAGS) $(DEBUGFLAGS)
+ CPPFLAGS += $(MOREFLAGS)
+ LDLIBS   += $(ZLIB_LIBRARY)
+ 
++UNAME := $(shell uname)
++UNAME_R := $(shell uname -r)
++
+ # Define *.exe as extension for Windows systems
+ ifneq (,$(filter Windows%,$(OS)))
+ EXT =.exe
+@@ -40,6 +43,12 @@ else
+ EXT =
+ endif
+ 
++ifneq (,$(filter $(UNAME),SunOS))
++ifeq (5.10,$(UNAME_R))
++NANOSLEEP_LD = -lrt
++endif
++endif
++
+ default : release
+ 
+ release : STDFLAGS =
+@@ -98,6 +107,7 @@ fitblk_zstd: fitblk.o zstdTurnedOn_zlibw
+       $(LINK.o) $^ $(LDLIBS) $(OUTPUT_OPTION)
+ 
+ zwrapbench: zwrapbench.o zstd_zlibwrapper.o util.o timefn.o datagen.o $(ZSTDLIBRARY)
++      $(LINK.o) $^ $(LDLIBS) $(NANOSLEEP_LD) $(OUTPUT_OPTION)
+ 
+ 
+ zstd_zlibwrapper.o: zstd_zlibwrapper.h

>Audit-Trail:
From: Thomas Klausner <wiz@NetBSD.org>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: pkg/56225: zstd compile issues on Solaris 10
Date: Tue, 1 Jun 2021 11:04:19 +0200

 On Tue, Jun 01, 2021 at 07:25:00AM +0000, pekdon@gmail.com wrote:
 > >Number:         56225
 > >Category:       pkg
 > >Synopsis:       zstd compile issues on Solaris 10

 This looks like bug report quite suitable for upstream. Can you please report it there?

 Thanks,
  Thomas

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/56225: zstd compile issues on Solaris 10
Date: Wed, 2 Jun 2021 22:40:05 +0200

 On Tue, Jun 01, 2021 at 07:25:00AM +0000, pekdon@gmail.com wrote:
 > * test in /bin/sh does not support -e, used in the install targets

 We avoid using /bin/sh on Solaris, so the real question is why it is
 used here.

 Joerg

From: =?utf-8?q?Claes_N=C3=A4st=C3=A9n?= <pekdon@gmail.com>
To: gnats-bugs <gnats-bugs@netbsd.org>
Cc: 
Subject: Re: pkg/56225: zstd compile issues on Solaris 10
Date: Thu, 03 Jun 2021 08:16:49 +0200

 Excerpts from Joerg Sonnenberger's message of 2021-06-02 20:45:02 +0000:
 > The following reply was made to PR pkg/56225; it has been noted by GNATS.
 > 
 > From: Joerg Sonnenberger <joerg@bec.de>
 > To: gnats-bugs@netbsd.org
 > Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
 > Subject: Re: pkg/56225: zstd compile issues on Solaris 10
 > Date: Wed, 2 Jun 2021 22:40:05 +0200
 > 
 >  On Tue, Jun 01, 2021 at 07:25:00AM +0000, pekdon@gmail.com wrote:
 >  > * test in /bin/sh does not support -e, used in the install targets
 >  
 >  We avoid using /bin/sh on Solaris, so the real question is why it is
 >  used here.
 >  

 Assuming it could have something to do with gmake calling /bin/sh
 directly for its commands?

 As in:

 $ strings /usr/pkg/bin/gmake |ggrep '\bsh\b'
 /bin/sh
 .out .a .ln .o .c .cc .C .cpp .p .f .F .m .r .y .l .ym .yl .s .S .mod
 .sym .def .h .info .dvi .tex .texinfo .texi .txinfo .w .ch .web .sh .elc
 .el

 Haven't verified this at a source level but seems like it could be the
 reason at least.

From: "Nia Alarie" <nia@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56225 CVS commit: pkgsrc/archivers/zstd
Date: Thu, 3 Jun 2021 06:43:42 +0000

 Module Name:	pkgsrc
 Committed By:	nia
 Date:		Thu Jun  3 06:43:42 UTC 2021

 Modified Files:
 	pkgsrc/archivers/zstd: Makefile

 Log Message:
 zstd: needs librt on SunOS, PR pkg/56225


 To generate a diff of this commit:
 cvs rdiff -u -r1.41 -r1.42 pkgsrc/archivers/zstd/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Jonathan Perkin <jperkin@joyent.com>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	pekdon@gmail.com
Subject: Re: pkg/56225: zstd compile issues on Solaris 10
Date: Thu, 3 Jun 2021 11:28:24 +0100

 * On 2021-06-03 at 10:54 BST, Claes Nstn wrote:

 > Assuming it could have something to do with gmake calling /bin/sh
 > directly for its commands?
 >
 > As in:
 >
 > $ strings /usr/pkg/bin/gmake |ggrep '\bsh\b'
 > /bin/sh

 Yeh we should probably fix this.  gmake honours SHELL but I don't think 
 we always set that in the build environment, so we should patch out 
 default_shell to be ${SH}.

 -- 
 Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com

From: =?utf-8?q?Claes_N=C3=A4st=C3=A9n?= <pekdon@gmail.com>
To: gnats-bugs <gnats-bugs@netbsd.org>
Cc: 
Subject: Re: pkg/56225: zstd compile issues on Solaris 10
Date: Tue, 30 Nov 2021 17:46:37 +0100

 Excerpts from Jonathan Perkin's message of 2021-06-03 10:30:02 +0000:
 > The following reply was made to PR pkg/56225; it has been noted by GNATS.
 > 
 > From: Jonathan Perkin <jperkin@joyent.com>
 > To: gnats-bugs@netbsd.org
 > Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
 >     pekdon@gmail.com
 > Subject: Re: pkg/56225: zstd compile issues on Solaris 10
 > Date: Thu, 3 Jun 2021 11:28:24 +0100
 > 
 >  * On 2021-06-03 at 10:54 BST, Claes N�st�n wrote:
 >  
 >  > Assuming it could have something to do with gmake calling /bin/sh
 >  > directly for its commands?
 >  >
 >  > As in:
 >  >
 >  > $ strings /usr/pkg/bin/gmake |ggrep '\bsh\b'
 >  > /bin/sh
 >  
 >  Yeh we should probably fix this.  gmake honours SHELL but I don't think 
 >  we always set that in the build environment, so we should patch out 
 >  default_shell to be ${SH}.
 >  

 A simple change as this fixes the install of zstd on Solaris 10 for, have
 noticed some other packages such as QT5 requiring this as well.

 --- Makefile.orig       Tue Nov 23 21:04:01 2021                                
 +++ Makefile    Tue Nov 23 17:22:49 2021                                        
 @@ -21,6 +21,7 @@                                                               
  USE_TOOLS+=            perl:test                                               

  CONFIGURE_ARGS+=       --program-prefix=g                                      
 +CPPFLAGS+=             -DPKGSRC_DEFAULT_SHELL=\"${SH}\"                        

  # workaround for broken strndup                                                
  CONFIGURE_ARGS.MirBSD+=        ac_cv_func_strndup=no                           


 --- src/job.c.orig      2021-11-23 16:20:03.622007892 +0000                     
 +++ src/job.c                                                                   
 @@ -77,7 +77,7 @@ char * vms_strsignal (int status);                            

  #else                                                                          

 -const char *default_shell = "/bin/sh";                                         
 +const char *default_shell = PKGSRC_DEFAULT_SHELL;                              
  int batch_mode_shell = 0;                                                      

  #endif 

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.