jq: 1.6 -> 1.7

https://github.com/jqlang/jq/releases/tag/jq-1.7
This commit is contained in:
Naïm Favier 2023-08-01 10:41:06 +02:00
parent b17d6431b0
commit c95192b996
No known key found for this signature in database
GPG Key ID: 95AFCE8211908325
3 changed files with 15 additions and 50 deletions

View File

@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchurl
, removeReferencesTo
, autoreconfHook
, bison
, onigurumaSupport ? true
@ -9,18 +10,14 @@
stdenv.mkDerivation rec {
pname = "jq";
version = "1.6";
version = "1.7";
# Note: do not use fetchpatch or fetchFromGitHub to keep this package available in __bootPackages
src = fetchurl {
url = "https://github.com/stedolan/jq/releases/download/jq-${version}/jq-${version}.tar.gz";
sha256 = "sha256-XejI4pqqP7nMa0e7JymfJxNU67clFOOsytx9OLW7qnI=";
url = "https://github.com/jqlang/jq/releases/download/jq-${version}/jq-${version}.tar.gz";
hash = "sha256-QCoNaXXZRub05ITRqEMgQUoP+Ots9J0sEdFE1NNE22I=";
};
patches = [
./fix-tests-when-building-without-regex-supports.patch
];
outputs = [ "bin" "doc" "man" "dev" "lib" "out" ];
# Upstream script that writes the version that's eventually compiled
@ -39,7 +36,7 @@ stdenv.mkDerivation rec {
'';
buildInputs = lib.optionals onigurumaSupport [ oniguruma ];
nativeBuildInputs = [ autoreconfHook bison ];
nativeBuildInputs = [ removeReferencesTo autoreconfHook bison ];
# Darwin requires _REENTRANT be defined to use functions like `lgamma_r`.
# Otherwise, configure will detect that theyre in libm, but the build will fail
@ -59,6 +56,12 @@ stdenv.mkDerivation rec {
# jq is linked to libjq:
++ lib.optional (!stdenv.isDarwin) "LDFLAGS=-Wl,-rpath,\\\${libdir}";
# Break the dependency cycle: $dev refers to $bin via propagated-build-outputs, and
# $bin refers to $dev because of https://github.com/jqlang/jq/commit/583e4a27188a2db097dd043dd203b9c106bba100
postFixup = ''
remove-references-to -t "$dev" "$bin/bin/jq"
'';
doInstallCheck = true;
installCheckTarget = "check";
@ -71,11 +74,11 @@ stdenv.mkDerivation rec {
meta = with lib; {
description = "A lightweight and flexible command-line JSON processor";
homepage = "https://stedolan.github.io/jq/";
homepage = "https://jqlang.github.io/jq/";
license = licenses.mit;
maintainers = with maintainers; [ raskin globin artturin ];
maintainers = with maintainers; [ raskin artturin ncfavier ];
platforms = platforms.unix;
downloadPage = "https://stedolan.github.io/jq/download/";
downloadPage = "https://jqlang.github.io/jq/download/";
mainProgram = "jq";
};
}

View File

@ -1,38 +0,0 @@
From f6a69a6e52b68a92b816a28eb20719a3d0cb51ae Mon Sep 17 00:00:00 2001
From: Dmitry Bogatov <git#v1@kaction.cc>
Date: Sat, 27 Mar 2021 00:00:00 +0000
Subject: [PATCH] Disable some tests when building without regex support
---
Makefile.am | 5 ++++-
configure.ac | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index f5c1db594..f3f44bb9e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -130,7 +130,10 @@ endif
### Tests (make check)
-TESTS = tests/optionaltest tests/mantest tests/jqtest tests/onigtest tests/shtest tests/utf8test tests/base64test
+TESTS = tests/optionaltest tests/jqtest tests/shtest tests/utf8test tests/base64test
+if WITH_ONIGURUMA
+TESTS += tests/mantest tests/onigtest
+endif
TESTS_ENVIRONMENT = NO_VALGRIND=$(NO_VALGRIND)
# This is a magic make variable that causes it to treat tests/man.test as a
diff --git a/configure.ac b/configure.ac
index 0441d4a2c..987d94e0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -278,6 +278,7 @@ AC_SUBST(onig_CFLAGS)
AC_SUBST(onig_LDFLAGS)
AM_CONDITIONAL([BUILD_ONIGURUMA], [test "x$build_oniguruma" = xyes])
+AM_CONDITIONAL([WITH_ONIGURUMA], [test "x$with_oniguruma" = xyes])
AC_SUBST([BUNDLER], ["$bundle_cmd"])
AC_CONFIG_MACRO_DIR([config/m4])

View File

@ -38,5 +38,5 @@ done | jq --slurp --raw-input \
# Append $tmp1 to game.json. There should be a better way to handle
# this but all other attempts failed for me.
jq -M --argfile a "$tmp1" '. + $a' < "$(dirname "$0")/game.json" > "$tmp2"
jq -M --slurpfile a "$tmp1" '. + $a[]' < "$(dirname "$0")/game.json" > "$tmp2"
cat "$tmp2" > "$(dirname "$0")/game.json"