Source-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/sysutils/nnn sysutils/nnn: Fix build on NetBSD 9/arm64



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6667de9cb0a3
branches:  trunk
changeset: 434843:6667de9cb0a3
user:      sjmulder <sjmulder%pkgsrc.org@localhost>
date:      Tue Jun 23 23:32:30 2020 +0000

description:
sysutils/nnn: Fix build on NetBSD 9/arm64

GCC doesn't expand alloca() to __builtin_alloca() in standards mode
(-std=...) so explicitly define it as such to fix breakage on platforms
that don't seem to supply it otherwise, like NetBSD 9 on arm64.

Bump PKGREVISION.

diffstat:

 sysutils/nnn/Makefile                |   4 +-
 sysutils/nnn/distinfo                |   4 +-
 sysutils/nnn/patches/patch-src_nnn.c |  44 ++++++++++++++++++++++++++++++-----
 3 files changed, 41 insertions(+), 11 deletions(-)

diffs (80 lines):

diff -r dbfa757f0b03 -r 6667de9cb0a3 sysutils/nnn/Makefile
--- a/sysutils/nnn/Makefile     Tue Jun 23 20:47:17 2020 +0000
+++ b/sysutils/nnn/Makefile     Tue Jun 23 23:32:30 2020 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.19 2020/06/02 11:07:41 sjmulder Exp $
+# $NetBSD: Makefile,v 1.20 2020/06/23 23:32:30 sjmulder Exp $
 
 DISTNAME=      nnn-3.2
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    sysutils
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=jarun/}
 GITHUB_TAG=    v${PKGVERSION_NOREV}
diff -r dbfa757f0b03 -r 6667de9cb0a3 sysutils/nnn/distinfo
--- a/sysutils/nnn/distinfo     Tue Jun 23 20:47:17 2020 +0000
+++ b/sysutils/nnn/distinfo     Tue Jun 23 23:32:30 2020 +0000
@@ -1,7 +1,7 @@
-$NetBSD: distinfo,v 1.14 2020/06/02 11:07:41 sjmulder Exp $
+$NetBSD: distinfo,v 1.15 2020/06/23 23:32:30 sjmulder Exp $
 
 SHA1 (nnn-3.2.tar.gz) = 074b20d4a9da51a673e9a43e6ccc1bd8d0b9b425
 RMD160 (nnn-3.2.tar.gz) = 3a0bc30d30da0cb468390f8a583489f0725f1a6e
 SHA512 (nnn-3.2.tar.gz) = 9cdc8d0d74162ddd4b90f69a4f558a25845732497ebdb129159fda658a799a949fe237013bf69a2d6a649433254ba2ed4c65f8f10cddd119f713c1d5518ea378
 Size (nnn-3.2.tar.gz) = 143122 bytes
-SHA1 (patch-src_nnn.c) = aee0cbbbbe7a9aa85d17ee8acc6c415422dc06e1
+SHA1 (patch-src_nnn.c) = a1ee2addb56d4e5fdab18dfe1dae492af0afe7fc
diff -r dbfa757f0b03 -r 6667de9cb0a3 sysutils/nnn/patches/patch-src_nnn.c
--- a/sysutils/nnn/patches/patch-src_nnn.c      Tue Jun 23 20:47:17 2020 +0000
+++ b/sysutils/nnn/patches/patch-src_nnn.c      Tue Jun 23 23:32:30 2020 +0000
@@ -1,13 +1,43 @@
-$NetBSD: patch-src_nnn.c,v 1.1 2020/06/02 11:07:42 sjmulder Exp $
+$NetBSD: patch-src_nnn.c,v 1.2 2020/06/23 23:32:30 sjmulder Exp $
+
+ - Always use builtin alloca() on GCC to fix NetBSD/arm64 build.
 
-Wrap FILE_MIME_OPTS use in check, since it's not defined (at the top of
-nnn.c) for Illumos which doesn't have such an option.
+   https://github.com/jarun/nnn/pull/666
+
+ - Wrap FILE_MIME_OPTS use in check, since it's not defined (at the top
+   of nnn.c) for Illumos which doesn't have such an option.
+
+   https://github.com/jarun/nnn/pull/622
 
-https://github.com/jarun/nnn/pull/622
-
---- src/nnn.c.orig     2020-05-26 00:08:38.000000000 +0000
+--- src/nnn.c.orig     2020-06-23 22:41:07.232929706 +0000
 +++ src/nnn.c
-@@ -3689,9 +3689,11 @@ static bool show_stats(const char *fpath
+@@ -90,9 +90,6 @@
+ #include <signal.h>
+ #include <stdarg.h>
+ #include <stdlib.h>
+-#ifdef __sun
+-#include <alloca.h>
+-#endif
+ #include <string.h>
+ #include <strings.h>
+ #include <time.h>
+@@ -103,6 +100,15 @@
+ #include <ftw.h>
+ #include <wchar.h>
+ 
++#if !defined(alloca) && defined(__GNUC__)
++/*
++ * GCC doesn't expand alloca() to __builtin_alloca() in standards mode
++ * (-std=...) and not all standard libraries do or supply it, e.g.
++ * NetBSD/arm64 so explicitly use the builtin.
++ */
++#define alloca(size) __builtin_alloca(size)
++#endif
++
+ #include "nnn.h"
+ #include "dbg.h"
+ 
+@@ -3689,9 +3695,11 @@ static bool show_stats(const char *fpath
                        }
                        fprintf(fp, " %s\n  ", begin);
  



Home | Main Index | Thread Index | Old Index