pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/jq jq: Avoid SIGSEGVs when using date builtins



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9316ae41dda2
branches:  trunk
changeset: 384228:9316ae41dda2
user:      leot <leot%pkgsrc.org@localhost>
date:      Sun Aug 19 18:08:05 2018 +0000

description:
jq: Avoid SIGSEGVs when using date builtins

Apply patch written by <soda> and shared with upstream as part of
<https://github.com/stedolan/jq/pull/1458> in order to fix crashes of jq when
using date builtin functions.

Also add a SUBST class intended to avoid invoking git as part of pre-configure
phase when invoking autoreconf.

While here take the MAINTAINERship and reformat a bit the Makefile
(NFCI).

Thanks a lot to <soda>, Takehiko NOZAKI and <nonaka> for investigating
the issue, writing the patches, sharing them with upstream and as
part of PR pkg/52460!

Bump PKGREVISION

diffstat:

 devel/jq/Makefile                       |  26 ++++++++++++++++----------
 devel/jq/distinfo                       |   7 ++++++-
 devel/jq/patches/patch-builtin.c        |  22 ++++++++++++++++++++++
 devel/jq/patches/patch-compile.c        |  22 ++++++++++++++++++++++
 devel/jq/patches/patch-configure.ac     |  23 +++++++++++++++++++++++
 devel/jq/patches/patch-inject__errors.c |  21 +++++++++++++++++++++
 devel/jq/patches/patch-util.c           |  24 ++++++++++++++++++++++++
 7 files changed, 134 insertions(+), 11 deletions(-)

diffs (197 lines):

diff -r 4d9b86b410d4 -r 9316ae41dda2 devel/jq/Makefile
--- a/devel/jq/Makefile Sun Aug 19 18:04:30 2018 +0000
+++ b/devel/jq/Makefile Sun Aug 19 18:08:05 2018 +0000
@@ -1,26 +1,32 @@
-# $NetBSD: Makefile,v 1.15 2018/05/30 16:03:48 ginsbach Exp $
+# $NetBSD: Makefile,v 1.16 2018/08/19 18:08:05 leot Exp $
 
 DISTNAME=      jq-1.5
-PKGREVISION=   4
+PKGREVISION=   5
 CATEGORIES=    devel
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=stedolan/}
+GITHUB_TAG=    ${DISTNAME}
 
-MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+MAINTAINER=    leot%NetBSD.org@localhost
 HOMEPAGE=      https://github.com/stedolan/jq/
 COMMENT=       Command-line JSON processor
 LICENSE=       mit
 
-GITHUB_TAG=    ${DISTNAME}
-
 USE_LANGUAGES= c99
 USE_LIBTOOL=   yes
-USE_TOOLS+=    bison flex gmake
+USE_TOOLS+=    autoreconf autoconf automake bison flex gmake
 GNU_CONFIGURE= yes
 
+SUBST_CLASSES+=                tag
+SUBST_STAGE.tag=       pre-configure
+SUBST_MESSAGE.tag=     Avoid to run `git describe' to fetch the tag
+SUBST_FILES.tag=       configure.ac scripts/version
+SUBST_SED.tag+=                -e 's/git describe .*|/echo "jq-1.5-1-g940132e-dirty" |/'
+
+TEST_TARGET=   check
+
+pre-configure:
+       cd ${WRKSRC} && autoreconf -fi
+
 .include "options.mk"
 
-CFLAGS.SunOS+= -D_XPG6 -D__EXTENSIONS__
-
-TEST_TARGET=   check
-
 .include "../../mk/bsd.pkg.mk"
diff -r 4d9b86b410d4 -r 9316ae41dda2 devel/jq/distinfo
--- a/devel/jq/distinfo Sun Aug 19 18:04:30 2018 +0000
+++ b/devel/jq/distinfo Sun Aug 19 18:08:05 2018 +0000
@@ -1,9 +1,14 @@
-$NetBSD: distinfo,v 1.9 2018/05/30 16:03:48 ginsbach Exp $
+$NetBSD: distinfo,v 1.10 2018/08/19 18:08:05 leot Exp $
 
 SHA1 (jq-1.5.tar.gz) = 664638b560d9e734178e8cafb21d98817af5b5f3
 RMD160 (jq-1.5.tar.gz) = 33ac77ac93e0539f6d66d29cd717013cdab8cf61
 SHA512 (jq-1.5.tar.gz) = 3f9049321e8430b04dbccf81d7f2ab691b89383e91526eaf585bbeeb67698dea73a36b3aa179f6a95ef97cd73a8a9b6dc53cb1a5b0398b6422c11289b705de7b
 Size (jq-1.5.tar.gz) = 1118086 bytes
 SHA1 (patch-Makefile.in) = 446be0fa3517fb6fc1e2f5761d1f8fb28339c79c
+SHA1 (patch-builtin.c) = ab8572304d39680b19337aec525beaa88e6506da
+SHA1 (patch-compile.c) = a9d2f8eadaddcd6bd3e467740f6826073b40720e
+SHA1 (patch-configure.ac) = 5ac2b2c744f554a716189239446a5c5a13c58bea
+SHA1 (patch-inject__errors.c) = 863086a96be3b81011a141bdf293d3ef5693ef10
 SHA1 (patch-src_jv__parse.c) = efca86e70daf27291a01bf538487b745b7bd600c
 SHA1 (patch-src_jv__print.c) = 4d53dc1a1f0bb1cc827dd1adb62ecef2b7393970
+SHA1 (patch-util.c) = c6b9062312206267b0e83bc7284646f64e133f58
diff -r 4d9b86b410d4 -r 9316ae41dda2 devel/jq/patches/patch-builtin.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/jq/patches/patch-builtin.c  Sun Aug 19 18:08:05 2018 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-builtin.c,v 1.1 2018/08/19 18:08:05 leot Exp $
+
+Defining _GNU_SOURCE, _BSD_SOURCE etc. in C sources is problematic,
+because the result of the configure command may be inconsistent with it.
+to be consistent, such macros have to be defined in the early stage of
+the configure command, and the AC_USE_SYSTEM_EXTENSIONS macro does the job.
+
+Part of pull request 1458, commit id `df9a0963f8fa6fca773b059dce22c598152f3edb':
+
+ <https://github.com/stedolan/jq/pull/1458>
+
+Also shared via PR pkg/52460.
+
+--- builtin.c.orig     2015-08-18 04:25:04.000000000 +0000
++++ builtin.c
+@@ -1,6 +1,3 @@
+-#define _BSD_SOURCE
+-#define _GNU_SOURCE
+-#define _XOPEN_SOURCE
+ #include <sys/time.h>
+ #include <stdlib.h>
+ #include <stddef.h>
diff -r 4d9b86b410d4 -r 9316ae41dda2 devel/jq/patches/patch-compile.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/jq/patches/patch-compile.c  Sun Aug 19 18:08:05 2018 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-compile.c,v 1.1 2018/08/19 18:08:05 leot Exp $
+
+Defining _GNU_SOURCE, _BSD_SOURCE etc. in C sources is problematic,
+because the result of the configure command may be inconsistent with it.
+to be consistent, such macros have to be defined in the early stage of
+the configure command, and the AC_USE_SYSTEM_EXTENSIONS macro does the job.
+
+Part of pull request 1458, commit id `df9a0963f8fa6fca773b059dce22c598152f3edb':
+
+ <https://github.com/stedolan/jq/pull/1458>
+
+Also shared via PR pkg/52460.
+
+--- compile.c.orig     2015-08-18 04:25:04.000000000 +0000
++++ compile.c
+@@ -1,6 +1,3 @@
+-#ifndef _GNU_SOURCE
+-#define _GNU_SOURCE // for strdup
+-#endif
+ #include <assert.h>
+ #include <math.h>
+ #include <string.h>
diff -r 4d9b86b410d4 -r 9316ae41dda2 devel/jq/patches/patch-configure.ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/jq/patches/patch-configure.ac       Sun Aug 19 18:08:05 2018 +0000
@@ -0,0 +1,23 @@
+$NetBSD: patch-configure.ac,v 1.3 2018/08/19 18:08:05 leot Exp $
+
+Defining _GNU_SOURCE, _BSD_SOURCE etc. in C sources is problematic,
+because the result of the configure command may be inconsistent with it.
+to be consistent, such macros have to be defined in the early stage of
+the configure command, and the AC_USE_SYSTEM_EXTENSIONS macro does the job.
+
+Part of pull request 1458, commit id `df9a0963f8fa6fca773b059dce22c598152f3edb':
+
+ <https://github.com/stedolan/jq/pull/1458>
+
+Also shared via PR pkg/52460.
+
+--- configure.ac.orig  2015-08-18 04:25:04.000000000 +0000
++++ configure.ac
+@@ -11,6 +11,7 @@ AC_PREREQ([2.64])
+ AC_CONFIG_AUX_DIR([config])
+ AM_INIT_AUTOMAKE([1.11.2 parallel-tests foreign -Wall])
+ AM_SILENT_RULES([yes])
++AC_USE_SYSTEM_EXTENSIONS
+ AM_PROG_AR
+ AM_MAINTAINER_MODE([enable])
+ AC_PROG_CC
diff -r 4d9b86b410d4 -r 9316ae41dda2 devel/jq/patches/patch-inject__errors.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/jq/patches/patch-inject__errors.c   Sun Aug 19 18:08:05 2018 +0000
@@ -0,0 +1,21 @@
+$NetBSD: patch-inject__errors.c,v 1.1 2018/08/19 18:08:05 leot Exp $
+
+Defining _GNU_SOURCE, _BSD_SOURCE etc. in C sources is problematic,
+because the result of the configure command may be inconsistent with it.
+to be consistent, such macros have to be defined in the early stage of
+the configure command, and the AC_USE_SYSTEM_EXTENSIONS macro does the job.
+
+Part of pull request 1458, commit id `df9a0963f8fa6fca773b059dce22c598152f3edb':
+
+ <https://github.com/stedolan/jq/pull/1458>
+
+Also shared via PR pkg/52460.
+
+--- inject_errors.c.orig       2015-08-18 04:25:04.000000000 +0000
++++ inject_errors.c
+@@ -1,5 +1,3 @@
+-
+-#define _GNU_SOURCE /* for RTLD_NEXT */
+ #include <assert.h>
+ #include <dlfcn.h>
+ #include <errno.h>
diff -r 4d9b86b410d4 -r 9316ae41dda2 devel/jq/patches/patch-util.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/jq/patches/patch-util.c     Sun Aug 19 18:08:05 2018 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-util.c,v 1.1 2018/08/19 18:08:05 leot Exp $
+
+Defining _GNU_SOURCE, _BSD_SOURCE etc. in C sources is problematic,
+because the result of the configure command may be inconsistent with it.
+to be consistent, such macros have to be defined in the early stage of
+the configure command, and the AC_USE_SYSTEM_EXTENSIONS macro does the job.
+
+Part of pull request 1458, commit id `df9a0963f8fa6fca773b059dce22c598152f3edb':
+
+ <https://github.com/stedolan/jq/pull/1458>
+
+Also shared via PR pkg/52460.
+
+--- util.c.orig        2015-08-18 04:25:04.000000000 +0000
++++ util.c
+@@ -1,8 +1,3 @@
+-
+-#ifdef HAVE_MEMMEM
+-#define _GNU_SOURCE
+-#endif
+-
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <assert.h>



Home | Main Index | Thread Index | Old Index