NetBSD Problem Report #56226

From www@netbsd.org  Tue Jun  1 08:54:15 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 836A31A92CB
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  1 Jun 2021 08:54:15 +0000 (UTC)
Message-Id: <20210601085414.ABE391A92CC@mollari.NetBSD.org>
Date: Tue,  1 Jun 2021 08:54:14 +0000 (UTC)
From: pekdon@gmail.com
Reply-To: pekdon@gmail.com
To: gnats-bugs@NetBSD.org
Subject: lz4 build issues on Solaris 10
X-Send-Pr-Version: www-1.0

>Number:         56226
>Category:       pkg
>Synopsis:       lz4 build issues on Solaris 10
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 01 08:55:00 +0000 2021
>Closed-Date:    Thu Jun 24 17:56:46 +0000 2021
>Last-Modified:  Thu Jun 24 17:56:46 +0000 2021
>Originator:     Claes Nästén
>Release:        trunk 2021-06-01
>Organization:
>Environment:
SunOS u40 5.10 Generic_147148-26 i86pc i386 i86pc

>Description:
lz4 fails to build on Solaris 10 due to missing -lrt as nanosleep is used.
>How-To-Repeat:
Build archivers/lz4 on Solaris 10
>Fix:
diff --git a/archivers/lz4/distinfo b/archivers/lz4/distinfo
index fe92331e66a..8193b280cf7 100644
--- a/archivers/lz4/distinfo
+++ b/archivers/lz4/distinfo
@@ -6,4 +6,4 @@ SHA512 (lz4-1.9.3.tar.gz) = c246b0bda881ee9399fa1be490fa39f43b291bb1d9db72dba8a8
 Size (lz4-1.9.3.tar.gz) = 320958 bytes
 SHA1 (patch-Makefile.inc) = 55d576430ed1a160709a56e104edc14cad88e5a9
 SHA1 (patch-lib_Makefile) = 8eda2146522bd2d5e418916fd99fb201810cb36d
-SHA1 (patch-programs_Makefile) = 671728182325f03164eb898d9d846fd2aa4353f7
+SHA1 (patch-programs_Makefile) = 5caf93bd0235fbcc5a996ec33873e6dd4e2e59a2
diff --git a/archivers/lz4/patches/patch-programs_Makefile b/archivers/lz4/patches/patch-programs_Makefile
index ced37e86bb9..9c896487ff5 100644
--- a/archivers/lz4/patches/patch-programs_Makefile
+++ b/archivers/lz4/patches/patch-programs_Makefile
@@ -2,9 +2,34 @@ $NetBSD: patch-programs_Makefile,v 1.12 2019/04/30 09:17:39 adam Exp $

 Unlock install target. Use pkgsrc install scripts.

---- programs/Makefile.orig     2019-04-23 17:18:40.000000000 +0000
+--- programs/Makefile.orig     2020-11-16 04:59:35.000000000 +0000
 +++ programs/Makefile
-@@ -140,20 +140,20 @@ BINDIR      ?= $(exec_prefix)/bin
+@@ -53,6 +53,15 @@ DEBUGFLAGS= -Wall -Wextra -Wundef -Wcast
+ CFLAGS   += $(DEBUGFLAGS) $(MOREFLAGS)
+ FLAGS     = $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
+ 
++UNAME := $(shell uname)
++UNAME_R := $(shell uname -r)
++
++ifneq (,$(filter $(UNAME),SunOS))
++ifeq (5.10,$(UNAME_R))
++NANOSLEEP_LD = -lrt
++endif
++endif
++
+ LZ4_VERSION=$(LIBVER)
+ MD2ROFF   = ronn
+ MD2ROFF_FLAGS = --roff --warnings --manual="User Commands" --organization="lz4 $(LZ4_VERSION)"
+@@ -83,7 +92,7 @@ lz4: $(OBJFILES) lz4-exe.o
+       $(CC) $(FLAGS) $^ -o $@$(EXT)
+ else
+ lz4: $(OBJFILES)
+-      $(CC) $(FLAGS) $(OBJFILES) -o $@$(EXT) $(LDLIBS)
++      $(CC) $(FLAGS) $(NANOSLEEP_LD) $(OBJFILES) -o $@$(EXT) $(LDLIBS)
+ endif
+ 
+ .PHONY: lz4-release
+@@ -154,20 +163,20 @@ BINDIR      ?= $(exec_prefix)/bin
  bindir      ?= $(BINDIR)
  DATAROOTDIR ?= $(prefix)/share
  datarootdir ?= $(DATAROOTDIR)

>Release-Note:

>Audit-Trail:
From: nia <nia@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/56226: lz4 build issues on Solaris 10
Date: Tue, 1 Jun 2021 14:14:38 +0000

 On Tue, Jun 01, 2021 at 08:55:00AM +0000, pekdon@gmail.com wrote:
 > lz4 fails to build on Solaris 10 due to missing -lrt as nanosleep is used.

 Can you adjust the pkgsrc Makefile instead of patching it?

 The package looks like it honors LDFLAGS so it should be a simple
 case of adding:

 LDFLAGS.SunOS+=	-lrt

From: =?utf-8?q?Claes_N=C3=A4st=C3=A9n?= <pekdon@gmail.com>
To: gnats-bugs <gnats-bugs@netbsd.org>
Cc: 
Subject: Re: pkg/56226: lz4 build issues on Solaris 10
Date: Wed, 02 Jun 2021 08:29:03 +0200

 Excerpts from nia's message of 2021-06-01 14:15:02 +0000:
 > The following reply was made to PR pkg/56226; it has been noted by GNATS.
 > 
 > From: nia <nia@NetBSD.org>
 > To: gnats-bugs@netbsd.org
 > Cc: 
 > Subject: Re: pkg/56226: lz4 build issues on Solaris 10
 > Date: Tue, 1 Jun 2021 14:14:38 +0000
 > 
 >  On Tue, Jun 01, 2021 at 08:55:00AM +0000, pekdon@gmail.com wrote:
 >  > lz4 fails to build on Solaris 10 due to missing -lrt as nanosleep is used.
 >  
 >  Can you adjust the pkgsrc Makefile instead of patching it?
 > 

 You are absolutely right and thanks for pointing that out.

 >  
 >  The package looks like it honors LDFLAGS so it should be a simple
 >  case of adding:
 >  
 >  LDFLAGS.SunOS+=    -lrt
 >  

 Compiled just fine with that on my Sparc Solaris 10 machine.

From: "Nia Alarie" <nia@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56226 CVS commit: pkgsrc/archivers/lz4
Date: Wed, 2 Jun 2021 20:01:42 +0000

 Module Name:	pkgsrc
 Committed By:	nia
 Date:		Wed Jun  2 20:01:42 UTC 2021

 Modified Files:
 	pkgsrc/archivers/lz4: Makefile

 Log Message:
 lz4: fix build on Solaris 10, PR pkg/56226


 To generate a diff of this commit:
 cvs rdiff -u -r1.20 -r1.21 pkgsrc/archivers/lz4/Makefile

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

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Thu, 24 Jun 2021 17:56:46 +0000
State-Changed-Why:
confirmed fixed, thanks


>Unformatted:

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.