summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-misc')
-rw-r--r--app-misc/jq/Manifest1
-rw-r--r--app-misc/jq/files/jq-1.7-warnings-r1.patch37
-rw-r--r--app-misc/jq/jq-1.7_pre20230210.ebuild88
3 files changed, 126 insertions, 0 deletions
diff --git a/app-misc/jq/Manifest b/app-misc/jq/Manifest
index 160ab21536e4..489984f6a2eb 100644
--- a/app-misc/jq/Manifest
+++ b/app-misc/jq/Manifest
@@ -1,2 +1,3 @@
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_pre20230210.gh.tar.gz 1197799 BLAKE2B f4e90f78aa5afec88a4fc60f7a6f05f892647fcd9b59e67ea4727bb452eceead05b8cbe18b814d05665c5fadf8aaddc0cc9a06f2cb102c82503f857d0b70a485 SHA512 e7533c1dd53dad398c50b4cf37cef5d60f95eeee040d1c1ab776778fa14a093167500e1d99d71b22edc5f476079bad503c9c17f54fffefee0c5eb41b86bab406
diff --git a/app-misc/jq/files/jq-1.7-warnings-r1.patch b/app-misc/jq/files/jq-1.7-warnings-r1.patch
new file mode 100644
index 000000000000..4d0182493056
--- /dev/null
+++ b/app-misc/jq/files/jq-1.7-warnings-r1.patch
@@ -0,0 +1,37 @@
+diff --git a/src/builtin.c b/src/builtin.c
+index 1c6b08c..407df2a 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 cfccd40..d39911e 100644
+--- a/src/jv_dtoa_tsd.c
++++ b/src/jv_dtoa_tsd.c
+@@ -31,7 +31,7 @@ void jv_tsd_dtoa_ctx_fini() {
+ static
+ #endif
+ void jv_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();
+ }
diff --git a/app-misc/jq/jq-1.7_pre20230210.ebuild b/app-misc/jq/jq-1.7_pre20230210.ebuild
new file mode 100644
index 000000000000..3a2508ecac79
--- /dev/null
+++ b/app-misc/jq/jq-1.7_pre20230210.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+COMMIT_HASH="cff5336ec71b6fee396a95bb0e4bea365e0cd1e8"
+
+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}.gh.tar.gz"
+S="${WORKDIR}/${PN}-${COMMIT_HASH}"
+
+LICENSE="MIT CC-BY-3.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~loong ~ppc ~ppc64 ~riscv ~x86 ~amd64-linux ~x64-macos"
+IUSE="+oniguruma static-libs test"
+
+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?] )
+ )
+"
+PATCHES=(
+ "${FILESDIR}"/jq-1.6-r3-never-bundle-oniguruma.patch
+ "${FILESDIR}"/jq-1.7-runpath.patch
+ "${FILESDIR}"/jq-1.7-warnings-r1.patch
+ "${FILESDIR}"/jq-1.7-visible-null.patch
+ # https://bugs.gentoo.org/776385
+ "${FILESDIR}"/jq-1.7_pre20201109-no-git-bdep.patch
+ "${FILESDIR}"/jq-1.7_pre20201109-fix-configure-test.patch
+)
+
+RESTRICT="!test? ( test )"
+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
+
+ # 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 -e '/modules\/oniguruma/d' -i 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 ! LD_LIBRARY_PATH="${S}/.libs" nonfatal emake check; then
+ if [[ -r "${S}/test-suite.log" ]]; then
+ eerror "Tests failed, outputting testsuite log"
+ cat "${S}/test-suite.log"
+ fi
+ die "Tests failed"
+ fi
+}
+
+src_install() {
+ local DOCS=( AUTHORS NEWS README.md )
+ default
+
+ use static-libs || { find "${D}" -name '*.la' -delete || die; }
+}