summaryrefslogtreecommitdiff
path: root/app-misc/jq
diff options
context:
space:
mode:
Diffstat (limited to 'app-misc/jq')
-rw-r--r--app-misc/jq/Manifest8
-rw-r--r--app-misc/jq/files/jq-1.5-dynamic-link.patch13
-rw-r--r--app-misc/jq/files/jq-1.5-heap_buffer_overflow_in_tokenadd.patch34
-rw-r--r--app-misc/jq/files/jq-1.5-remove-automagic-dep-on-oniguruma.patch58
-rw-r--r--app-misc/jq/jq-1.5-r3.ebuild60
-rw-r--r--app-misc/jq/metadata.xml14
6 files changed, 187 insertions, 0 deletions
diff --git a/app-misc/jq/Manifest b/app-misc/jq/Manifest
new file mode 100644
index 000000000000..fe9fc2f99737
--- /dev/null
+++ b/app-misc/jq/Manifest
@@ -0,0 +1,8 @@
+AUX jq-1.5-dynamic-link.patch 292 SHA256 c4000f13ea2e0fe85e4d89470af17b7528cb87b2ca921fb990815bf6abcfad6d SHA512 1573ab7bdb9bd28db1ef7cbf834aada998b9651ffc1a9c67941faf23490ac3b145b6af6f1e41212b2c8c990d738b24bc7912a591db386f922c0b829a59e465ee WHIRLPOOL 29f3e6011c4f27d9339a0692685285ecee057aff58ba289146f6e36a31289c3146b1bc760948a1e55bdd5f6283338f2abbd3f5cbdab6e67479c5986c49e0f11a
+AUX jq-1.5-heap_buffer_overflow_in_tokenadd.patch 1241 SHA256 5069a8e81ece30279e8d525b4a590f5757dfb3d05f8c0a9bf212f37e75905fcc SHA512 7c0e7268a8715f9354322b81e82971fd6e6810206024fb59f55fdf319c1053fdd17ab4d2a78c8edc9ed1638339671419f4ea92cbb0f8ffbb34e5b521efb35718 WHIRLPOOL 16d961d05c95d17c3d87543fc60b6166b968356b25568a8b1d2a5b2cb43bfed37435342ff7a3b530527222835da88ba6c4ccfbc60e542c22eb93431db0473ebd
+AUX jq-1.5-remove-automagic-dep-on-oniguruma.patch 1879 SHA256 d5b55b63332899e9eff705fbb32fb1d790e2c637ff3be2659c47ecf8b17bc6c2 SHA512 3c7efccf85beda5f80c66432f6950b2d885c4587e6ed3cdc66447f60440dc0287da834cc5744ddd7af8ad36677254ebae6969bc498d36e457dfac69ca0da3f6d WHIRLPOOL 903ce507584d94ac49eaaa33c414e9fdca1a7f9ebbf185038ccb232b78ac6c04d7782458b97db0e983037ff4ab63e3e1cdd8d164191b7b22c020930d25baf913
+DIST jq-1.5.tar.gz 739309 SHA256 c4d2bfec6436341113419debf479d833692cc5cdab7eb0326b5a4d4fbe9f493c SHA512 4a0bb069ae875f47731d7d84ae6b82240703dc7a694cfb0aee4c7e9639defe7ba9af575d17dc32bda4426b80c186cc8dcd4505f3a6bcbe16b39e9b13097da238 WHIRLPOOL ca45763fb43ba0bc4a97f1a6d34e3c5af0f25f2548d04646f76ac18e95792445eaa42869ce4a7a736b7d6bc09440225e277df79abacf23ef3c8f1b41170e2907
+EBUILD jq-1.5-r3.ebuild 1385 SHA256 3a5ca8e446084c8de607fdd8f253ae9597d86e8f00469b8382e269cf64335836 SHA512 da253fc8d393a3106437b5cba2a4c618076f9c8d23b834d8aab2079de876a53e8a2f2b5ebcd6d79ff48b53c54276a81aa314ccbbbc22e02d720a800a40e20ef7 WHIRLPOOL 97101a7938fa2cc562805d890c1e561d4af6d188a6facd3cb49b4a6967395eafdf82c3fc06806d9281f6ef26fd5cf55ea353213256cb51d39f15c24125decefb
+MISC ChangeLog 4611 SHA256 f882e1fdddc525ad029cd8c7787b81e5acaaf956bf93372738f0af2107258ec0 SHA512 fa4a3f42f00c9817fbbd524939f885ce8451dea401f5f1ce0c76f4f56839a24e3da98b3f0354ce75c769a78b8b5614702a511c6d66a96017242fd95cc57c4dec WHIRLPOOL 38eac5aa24f837b5177d390a6951120efcda5aa867bcebeb74bc3f1a23fd549865becb6894a33ceefadc507aff0051a17933e04317076bd33b11c156e1b78808
+MISC ChangeLog-2015 2176 SHA256 2e4f02d2f3bd0d54f9eb8e19deebb0bc43a8a7bd523dd65a0391817de5d9afeb SHA512 b407b35544a94c67504a90635083d816147c27791c8ee745e8252dcb0da67950fdf248eb791a25b3275a259ad70ef7a475a8b24d14711cdfb6e943da34493769 WHIRLPOOL ffef34e807b2ad4af67959abd78088316d73db4f520ceb062b0c2cd5c3149bbc31acbf251ab0dfbef2d74305702ad2d995bb92cb12a13c4e0820162c0e298e08
+MISC metadata.xml 423 SHA256 232f45bd4ec254cf1f624857fbfdf4dbdf3685ca92cc1bafbf9b5529ba06a7a7 SHA512 1787b1ce5d050aaa440996ceaf2367e39192af71e7d9a0d973e8dc8a87854f910aefd020c869867e3da5da33d27cc261047a1ded58b18052b21bf6737ef3081c WHIRLPOOL 8f9f7633b0757d0200ef6f4785d0011bf199adf42d0bdaba56bc08473c7daff87f84e42ceba6b8f23f0969d121f11ceaff483f088f41c28300c2cf7339cc6113
diff --git a/app-misc/jq/files/jq-1.5-dynamic-link.patch b/app-misc/jq/files/jq-1.5-dynamic-link.patch
new file mode 100644
index 000000000000..dbc2f11acb7f
--- /dev/null
+++ b/app-misc/jq/files/jq-1.5-dynamic-link.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile.am b/Makefile.am
+index c3a771f..274c01e 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -84,7 +84,7 @@ main.c: version.h
+
+ bin_PROGRAMS = jq
+ jq_SOURCES = main.c version.h
+-jq_LDFLAGS = -static-libtool-libs
++jq_LDFLAGS =
+ jq_LDADD = libjq.la -lm
+
+ if ENABLE_ALL_STATIC
diff --git a/app-misc/jq/files/jq-1.5-heap_buffer_overflow_in_tokenadd.patch b/app-misc/jq/files/jq-1.5-heap_buffer_overflow_in_tokenadd.patch
new file mode 100644
index 000000000000..edb07d8388b5
--- /dev/null
+++ b/app-misc/jq/files/jq-1.5-heap_buffer_overflow_in_tokenadd.patch
@@ -0,0 +1,34 @@
+From 8eb1367ca44e772963e704a700ef72ae2e12babd Mon Sep 17 00:00:00 2001
+From: Nicolas Williams <nico@cryptonector.com>
+Date: Sat, 24 Oct 2015 17:24:57 -0500
+Subject: [PATCH] Heap buffer overflow in tokenadd() (fix #105)
+
+This was an off-by one: the NUL terminator byte was not allocated on
+resize. This was triggered by JSON-encoded numbers longer than 256
+bytes.
+---
+ src/jv_parse.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/jv_parse.c b/src/jv_parse.c
+index 3102ed4..84245b8 100644
+--- a/jv_parse.c
++++ b/jv_parse.c
+@@ -383,7 +383,7 @@ static pfunc stream_token(struct jv_parser* p, char ch) {
+
+ static void tokenadd(struct jv_parser* p, char c) {
+ assert(p->tokenpos <= p->tokenlen);
+- if (p->tokenpos == p->tokenlen) {
++ if (p->tokenpos >= (p->tokenlen - 1)) {
+ p->tokenlen = p->tokenlen*2 + 256;
+ p->tokenbuf = jv_mem_realloc(p->tokenbuf, p->tokenlen);
+ }
+@@ -485,7 +485,7 @@ static pfunc check_literal(struct jv_parser* p) {
+ TRY(value(p, v));
+ } else {
+ // FIXME: better parser
+- p->tokenbuf[p->tokenpos] = 0; // FIXME: invalid
++ p->tokenbuf[p->tokenpos] = 0;
+ char* end = 0;
+ double d = jvp_strtod(&p->dtoa, p->tokenbuf, &end);
+ if (end == 0 || *end != 0)
diff --git a/app-misc/jq/files/jq-1.5-remove-automagic-dep-on-oniguruma.patch b/app-misc/jq/files/jq-1.5-remove-automagic-dep-on-oniguruma.patch
new file mode 100644
index 000000000000..95ba0e058056
--- /dev/null
+++ b/app-misc/jq/files/jq-1.5-remove-automagic-dep-on-oniguruma.patch
@@ -0,0 +1,58 @@
+commit 18b4b18b41f5ed396d73449ce8d6ec408d95d6b2
+Author: David Tolnay <dtolnay@gmail.com>
+Date: Sat Nov 21 10:05:37 2015 -0800
+
+ Support --without-oniguruma
+
+diff --git a/configure.ac b/configure.ac
+index 9e2c8cf..7f6be34 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -52,27 +52,26 @@ fi
+ AC_ARG_WITH([oniguruma],
+ [AS_HELP_STRING([--with-oniguruma=prefix],
+ [try this for a non-standard install prefix of the oniguruma library])],
+- [ONIGURUMAPATHSET=1],
+- [ONIGURUMAPATHSET=0])
+-
+-if test $ONIGURUMAPATHSET = 1; then
+- CFLAGS="$CFLAGS -I${with_oniguruma}/include"
+- LDFLAGS="$LDFLAGS -L${with_oniguruma}/lib"
+-fi
+-
+-# check for ONIGURUMA library
+-HAVE_ONIGURUMA=0
+-AC_CHECK_HEADER("oniguruma.h",
+- AC_CHECK_LIB([onig],[onig_version],[LIBS="$LIBS -lonig"; HAVE_ONIGURUMA=1;]))
+-
+-# handle check results
+-if test $HAVE_ONIGURUMA != 1; then
+- AC_MSG_NOTICE([Oniguruma was not found.])
+- AC_MSG_NOTICE([ Try setting the location using '--with-oniguruma=PREFIX' ])
+-else
+- AC_DEFINE([HAVE_ONIGURUMA],1,[Define to 1 if Oniguruma is installed])
+-fi
+-
++ [],
++ [with_oniguruma=yes])
++
++AS_IF([test "x$with_oniguruma" != xno], [
++ AS_IF([test "x$with_oniguruma" != xyes], [
++ CFLAGS="$CFLAGS -I${with_oniguruma}/include"
++ LDFLAGS="$LDFLAGS -L${with_oniguruma}/lib"
++ ])
++ # check for ONIGURUMA library
++ have_oniguruma=0
++ AC_CHECK_HEADER("oniguruma.h",
++ AC_CHECK_LIB([onig],[onig_version],[LIBS="$LIBS -lonig"; have_oniguruma=1;]))
++ # handle check results
++ AS_IF([test $have_oniguruma = 1], [
++ AC_DEFINE([HAVE_ONIGURUMA], 1, [Define to 1 if Oniguruma is installed])
++ ], [
++ AC_MSG_NOTICE([Oniguruma was not found.])
++ AC_MSG_NOTICE([Try setting the location using '--with-oniguruma=PREFIX'])
++ ])
++])
+
+ dnl Check for valgrind
+ AC_CHECK_PROGS(valgrind_cmd, valgrind)
diff --git a/app-misc/jq/jq-1.5-r3.ebuild b/app-misc/jq/jq-1.5-r3.ebuild
new file mode 100644
index 000000000000..f2b7f8001e52
--- /dev/null
+++ b/app-misc/jq/jq-1.5-r3.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools ltprune
+
+DESCRIPTION="A lightweight and flexible command-line JSON processor"
+HOMEPAGE="https://stedolan.github.com/jq/"
+SRC_URI="https://github.com/stedolan/jq/releases/download/${P}/${P}.tar.gz"
+
+LICENSE="MIT CC-BY-3.0"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~ia64 ~ppc ~ppc64 x86 ~amd64-linux ~x64-macos"
+IUSE="oniguruma static-libs"
+
+DEPEND="
+ >=sys-devel/bison-3.0
+ sys-devel/flex
+ oniguruma? ( dev-libs/oniguruma:=[static-libs?] )
+"
+RDEPEND="
+ !static-libs? (
+ oniguruma? ( dev-libs/oniguruma[static-libs?] )
+ )
+"
+
+src_prepare() {
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5-dynamic-link.patch
+ "${FILESDIR}"/${PN}-1.5-remove-automagic-dep-on-oniguruma.patch
+ "${FILESDIR}"/${PN}-1.5-heap_buffer_overflow_in_tokenadd.patch
+ )
+
+ use oniguruma || { sed -i 's:tests/onigtest::' Makefile.am || die; }
+ sed -i '/^dist_doc_DATA/d' Makefile.am || die
+ sed -i -r "s:(m4_define\(\[jq_version\],) .+\):\1 \[${PV}\]):" \
+ configure.ac || die
+
+ default
+ eautoreconf
+}
+
+src_configure() {
+ local econfargs=(
+ # don't try to rebuild docs
+ --disable-docs
+ --disable-valgrind
+ $(use_enable static-libs static)
+ $(use_with oniguruma)
+ )
+ econf "${econfargs[@]}"
+}
+
+src_install() {
+ local DOCS=( AUTHORS README )
+ default
+
+ use static-libs || prune_libtool_files
+}
diff --git a/app-misc/jq/metadata.xml b/app-misc/jq/metadata.xml
new file mode 100644
index 000000000000..d9b5cb1343c4
--- /dev/null
+++ b/app-misc/jq/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>radhermit@gentoo.org</email>
+ <name>Tim Harder</name>
+ </maintainer>
+ <use>
+ <flag name="oniguruma">Use dev-libs/oniguruma for regular expression support</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">stedolan/jq</remote-id>
+ </upstream>
+</pkgmetadata>