app-misc/jq: Sync with Gentoo

It's from Gentoo commit 79d039542c3c53925c72db7a58db0cf06f33faae.
This commit is contained in:
Krzesimir Nowak 2023-12-07 16:31:40 +01:00
parent 6dee947212
commit 742e9973d5
9 changed files with 16 additions and 235 deletions

View File

@ -1,2 +1 @@
DIST jq-1.6.tar.gz 1750584 BLAKE2B c9be1314e9d027247de63492ee362e996ef85faf45a47ee421cad95ebde9188bff8d3fc7db64e717ab922e1052f3b1c1500f5589fc5b2199ab66effb000e442d SHA512 5da71f53c325257f1f546a2520fe47828b495c953270df25ea0e37741463fdda72f0ba4d5b05b25114ec30f27a559344c2b024bacabf610759f4e3e9efadb480
DIST jq-1.7_pre20201109.tar.gz 1181867 BLAKE2B 9db187ab927b635c43fbc6191aeffa00451b12253ae023bbabe6fba5fdf8fb393f8450ee2011ef58cb93e2f27994d454fac967984a721439aaac93259c02f7f1 SHA512 f2997d70edb36d0a23b71a7d933a763cedd7c74ffa3129c2a6cb7189aaff1c5095cdc51062b7cd119324ec2c83ebae6ff0b7da3941315303b7a31146b9eb285a
DIST jq-1.7.gh.tar.gz 1267139 BLAKE2B b6a54f9beaabd7915d7a8f14cda9621573f1796af53fe1645561a7a199787a7e9b2b2df038208f23e63f339dec567851b70696ffb8194986250527333d36d44e SHA512 01676319fe98d5ab1e278430b2c58ec594191cc9485a20312d658c0e199ac7ea5f5e934817ce98da0864ec7e0a018aae9b87525260e8ab6a7bde918db483bd84

View File

@ -1,17 +0,0 @@
diff --git a/configure.ac b/configure.ac
index 280694c..7227c9d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -280,4 +280,11 @@ AC_SUBST([BUNDLER], ["$bundle_cmd"])
AC_CONFIG_MACRO_DIR([config/m4])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
-
+AC_ARG_ENABLE([rpathhack],
+ [AC_HELP_STRING([--enable-rpathhack], [patch libtool to remove RPATH])],
+ [
+AC_MSG_RESULT([patching libtool to fix rpath])
+sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
+sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+ ],
+ [])

View File

@ -1,22 +0,0 @@
From a1f1231a73c221155d539a281181ef37f874869d Mon Sep 17 00:00:00 2001
From: William Langford <wlangfor@gmail.com>
Date: Tue, 20 Nov 2018 09:58:25 -0500
Subject: [PATCH] Add missing jv_copy when printing with -ar
---
src/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main.c b/src/main.c
index b154689e..61ae43f9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -168,7 +168,7 @@ static int process(jq_state *jq, jv value, int flags, int dumpopts) {
while (jv_is_valid(result = jq_next(jq))) {
if ((options & RAW_OUTPUT) && jv_get_kind(result) == JV_KIND_STRING) {
if (options & ASCII_OUTPUT) {
- jv_dumpf(result, stdout, JV_PRINT_ASCII);
+ jv_dumpf(jv_copy(result), stdout, JV_PRINT_ASCII);
} else {
fwrite(jv_string_value(result), 1, jv_string_length_bytes(jv_copy(result)), stdout);
}

View File

@ -1,41 +0,0 @@
diff --git a/src/jv_print.c b/src/jv_print.c
index 2e781bb..e621b31 100644
--- a/src/jv_print.c
+++ b/src/jv_print.c
@@ -32,7 +32,7 @@ static const jv_kind color_kinds[] =
static char color_bufs[sizeof(color_kinds)/sizeof(color_kinds[0])][16];
static const char *color_bufps[8];
static const char* def_colors[] =
- {COL("1;30"), COL("0;37"), COL("0;37"), COL("0;37"),
+ {COL("1;90"), COL("0;37"), COL("0;37"), COL("0;37"),
COL("0;32"), COL("1;37"), COL("1;37")};
#define FIELD_COLOR COL("34;1")
diff --git a/tests/shtest b/tests/shtest
index 8ed62b2..2d3f0da 100755
--- a/tests/shtest
+++ b/tests/shtest
@@ -280,12 +280,12 @@ fi
# Check $JQ_COLORS
$JQ -Ccn . > $d/color
-printf '\033[1;30mnull\033[0m\n' > $d/expect
+printf '\033[1;90mnull\033[0m\n' > $d/expect
cmp $d/color $d/expect
JQ_COLORS='4;31' $JQ -Ccn . > $d/color
printf '\033[4;31mnull\033[0m\n' > $d/expect
cmp $d/color $d/expect
-JQ_COLORS='1;30:0;31:0;32:0;33:0;34:1;35:1;36' \
+JQ_COLORS='1;90:0;31:0;32:0;33:0;34:1;35:1;36' \
$JQ -Ccn '[{"a":true,"b":false},123,null]' > $d/color
(
printf '\033[1;35m[\033[1;36m{'
@@ -298,7 +298,7 @@ printf '[0m\033[0;31mfalse\033'
printf '[0m\033[1;36m\033[1;36'
printf 'm}\033[0m\033[1;35m,\033['
printf '0;33m123\033[0m\033[1;'
-printf '35m,\033[1;30mnull\033'
+printf '35m,\033[1;90mnull\033'
printf '[0m\033[1;35m\033[1;35'
printf 'm]\033[0m\n'
) > $d/expect

View File

@ -1,44 +0,0 @@
diff --git a/src/builtin.c b/src/builtin.c
index bf80c7b..12db573 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -1,5 +1,6 @@
#define _BSD_SOURCE
#define _GNU_SOURCE
+#define _DEFAULT_SOURCE
#ifndef __sun__
# define _XOPEN_SOURCE
# define _XOPEN_SOURCE_EXTENDED 1
diff --git a/src/jv_dtoa.c b/src/jv_dtoa.c
index 33feb99..fcbd902 100644
--- a/src/jv_dtoa.c
+++ b/src/jv_dtoa.c
@@ -2327,7 +2327,7 @@ retlow1:
jvp_strtod
(struct dtoa_context* C, const char *s00, char **se)
{
- int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, e, e1, test_scale;
+ int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, e, e1;
int esign, i, j, k, nd, nd0, nf, nz, nz0, nz1, sign;
CONST char *s, *s0, *s1;
double aadj, aadj1;
diff --git a/src/jv_dtoa_tsd.c b/src/jv_dtoa_tsd.c
index 0f95df4..e5209dd 100644
--- a/src/jv_dtoa_tsd.c
+++ b/src/jv_dtoa_tsd.c
@@ -24,7 +24,7 @@ static void tsd_dtoa_ctx_fini() {
}
static void tsd_dtoa_ctx_init() {
- if (pthread_key_create(&dtoa_ctx_key, tsd_dtoa_ctx_dtor) != 0) {
+ if (pthread_key_create(&dtoa_ctx_key, (void (*)(void *))tsd_dtoa_ctx_dtor) != 0) {
fprintf(stderr, "error: cannot create thread specific key");
abort();
}
@@ -43,4 +43,4 @@ inline struct dtoa_context *tsd_dtoa_context_get() {
}
}
return ctx;
-}
\ No newline at end of file
+}

View File

@ -1,13 +0,0 @@
diff --git a/configure.ac b/configure.ac
index 0441d4a..592ceb9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,8 +1,3 @@
-m4_define([jq_version],
- m4_esyscmd_s([(git rev-parse --verify -q jq-1.0 > /dev/null &&
- (git describe --tags --dirty --match 'jq-*'|sed 's/^jq-//')) ||
- echo `git rev-parse --abbrev-ref HEAD`-`git describe --always --dirty`])))
-
AC_INIT([jq], [jq_version], [https://github.com/stedolan/jq/issues],
[jq], [https://stedolan.github.io/jq])

View File

@ -1,78 +0,0 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit autotools
DESCRIPTION="A lightweight and flexible command-line JSON processor"
HOMEPAGE="https://stedolan.github.io/jq/"
SRC_URI="https://github.com/stedolan/jq/releases/download/${P}/${P}.tar.gz"
LICENSE="MIT CC-BY-3.0"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 x86 ~amd64-linux ~x64-macos"
IUSE="oniguruma static-libs"
ONIGURUMA_MINPV='>=dev-libs/oniguruma-6.1.3' # Keep this in sync with bundled modules/oniguruma/
DEPEND="
>=sys-devel/bison-3.0
sys-devel/flex
oniguruma? ( ${ONIGURUMA_MINPV}:=[static-libs?] )
"
RDEPEND="
!static-libs? (
oniguruma? ( ${ONIGURUMA_MINPV}[static-libs?] )
)
"
src_prepare() {
local PATCHES=(
"${FILESDIR}"/jq-1.6-r3-never-bundle-oniguruma.patch
"${FILESDIR}"/jq-1.6-runpath.patch
"${FILESDIR}"/jq-1.6-segfault-fix.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
# jq-1.6-r3-never-bundle-oniguruma makes sure we build with the system oniguruma,
# but the bundled copy of oniguruma still gets eautoreconf'd since it
# exists; save the cycles by nuking it.
sed -i -e '/modules\/oniguruma/d' Makefile.am || die
rm -rf "${S}"/modules/oniguruma || die
default
eautoreconf
}
src_configure() {
local econfargs=(
# don't try to rebuild docs
--disable-docs
--disable-valgrind
--disable-maintainer-mode
--enable-rpathhack
$(use_enable static-libs static)
$(use_with oniguruma oniguruma yes)
)
econf "${econfargs[@]}"
}
src_test() {
if ! emake check; then
if [[ -r test-suite.log ]]; then
eerror "Tests failed, outputting testsuite log"
cat test-suite.log
fi
die "Tests failed"
fi
}
src_install() {
local DOCS=( AUTHORS README.md )
default
use static-libs || { find "${D}" -name '*.la' -delete || die; }
}

View File

@ -1,24 +1,23 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit autotools
COMMIT_HASH="a17dd3248a666d01be75f6b16be37e80e20b0954"
MY_PV="${PV/_/}"
MY_P="${PN}-${MY_PV}"
DESCRIPTION="A lightweight and flexible command-line JSON processor"
HOMEPAGE="https://stedolan.github.io/jq/"
#SRC_URI="https://github.com/stedolan/jq/releases/download/${P}/${P}.tar.gz"
SRC_URI="https://github.com/stedolan/jq/archive/${COMMIT_HASH}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${PN}-${COMMIT_HASH}"
SRC_URI="https://github.com/jqlang/jq/archive/refs/tags/${MY_P}.tar.gz -> ${P}.gh.tar.gz"
S="${WORKDIR}/${PN}-${MY_P}"
LICENSE="MIT CC-BY-3.0"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ~ppc ppc64 ~riscv x86 ~amd64-linux ~x64-macos"
KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ~loong ~ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~x64-macos ~x64-solaris"
IUSE="+oniguruma static-libs test"
ONIGURUMA_MINPV='>=dev-libs/oniguruma-6.1.3' # Keep this in sync with bundled modules/oniguruma/
ONIGURUMA_MINPV='>=dev-libs/oniguruma-6.9.3' # Keep this in sync with bundled modules/oniguruma/
DEPEND="
>=sys-devel/bison-3.0
sys-devel/flex
@ -32,10 +31,6 @@ RDEPEND="
PATCHES=(
"${FILESDIR}"/jq-1.6-r3-never-bundle-oniguruma.patch
"${FILESDIR}"/jq-1.7-runpath.patch
"${FILESDIR}"/jq-1.7-warnings.patch
"${FILESDIR}"/jq-1.7-visible-null.patch
# https://bugs.gentoo.org/776385
"${FILESDIR}"/jq-1.7_pre20201109-no-git-bdep.patch
)
RESTRICT="!test? ( test )"
@ -43,8 +38,7 @@ REQUIRED_USE="test? ( oniguruma )"
src_prepare() {
sed -e '/^dist_doc_DATA/d; s:-Wextra ::' -i Makefile.am || die
sed -r -e "s:(m4_define\(\[jq_version\],) .+\):\1 \[${PV}\]):" \
-i configure.ac || die
printf "#!/bin/sh\\nprintf '%s'\\n\n" "${MY_PV}" > scripts/version || die
# jq-1.6-r3-never-bundle-oniguruma makes sure we build with the system oniguruma,
# but the bundled copy of oniguruma still gets eautoreconf'd since it
@ -53,6 +47,9 @@ src_prepare() {
rm -rf "${S}"/modules/oniguruma || die
default
sed -i "s/\[jq_version\]/[${MY_PV}]/" configure.ac || die
eautoreconf
}
@ -80,7 +77,7 @@ src_test() {
}
src_install() {
local DOCS=( AUTHORS NEWS README.md )
local DOCS=( AUTHORS NEWS.md README.md SECURITY.md )
default
use static-libs || { find "${D}" -name '*.la' -delete || die; }

View File

@ -10,10 +10,10 @@
<name>Patrick McLean</name>
</maintainer>
<use>
<flag name="oniguruma">Use dev-libs/oniguruma for regular expression support</flag>
<flag name="oniguruma">Use <pkg>dev-libs/oniguruma</pkg> for regular expression support</flag>
</use>
<upstream>
<remote-id type="cpe">cpe:/a:jq_project:jq</remote-id>
<remote-id type="github">stedolan/jq</remote-id>
<remote-id type="github">jqlang/jq</remote-id>
</upstream>
</pkgmetadata>