summary refs log tree commit diff
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2023-09-16 19:15:18 +0200
committerGitHub <noreply@github.com>2023-09-16 19:15:18 +0200
commit57b9e41dcc45bf142129898a44ea5e0e9e23b402 (patch)
tree249db306ecc79ed153f18be8af18b8f571b1f95b
parent1713d1a232f4c7a5219d38c64837adbe9f16a6a9 (diff)
parent09e3d7d7e41731e44024d019443b3ee7c5c2bf70 (diff)
downloadnixpkgs-57b9e41dcc45bf142129898a44ea5e0e9e23b402.tar
nixpkgs-57b9e41dcc45bf142129898a44ea5e0e9e23b402.tar.gz
nixpkgs-57b9e41dcc45bf142129898a44ea5e0e9e23b402.tar.bz2
nixpkgs-57b9e41dcc45bf142129898a44ea5e0e9e23b402.tar.lz
nixpkgs-57b9e41dcc45bf142129898a44ea5e0e9e23b402.tar.xz
nixpkgs-57b9e41dcc45bf142129898a44ea5e0e9e23b402.tar.zst
nixpkgs-57b9e41dcc45bf142129898a44ea5e0e9e23b402.zip
Merge pull request #246515 from ncfavier/jq
jq: 1.6 -> 1.7
-rw-r--r--nixos/doc/manual/release-notes/rl-2311.section.md2
-rw-r--r--pkgs/development/python-modules/jq/default.nix10
-rw-r--r--pkgs/development/tools/jq/default.nix25
-rw-r--r--pkgs/development/tools/jq/fix-tests-when-building-without-regex-supports.patch38
-rwxr-xr-xpkgs/games/dwarf-fortress/update.sh2
5 files changed, 25 insertions, 52 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md
index cf7c7032193..b50ed3e0bb2 100644
--- a/nixos/doc/manual/release-notes/rl-2311.section.md
+++ b/nixos/doc/manual/release-notes/rl-2311.section.md
@@ -230,6 +230,8 @@
 
 - New options were added to `services.searx` for better SearXNG support, including options for the built-in rate limiter and bot protection and automatically configuring a local redis server.
 
+- `jq` was updated to 1.7, its [first release in 5 years](https://github.com/jqlang/jq/releases/tag/jq-1.7).
+
 - A new option was added to the virtualisation module that enables specifying explicitly named network interfaces in QEMU VMs. The existing `virtualisation.vlans` is still supported for cases where the name of the network interface is irrelevant.
 
 - DocBook option documentation is no longer supported, all module documentation now uses markdown.
diff --git a/pkgs/development/python-modules/jq/default.nix b/pkgs/development/python-modules/jq/default.nix
index 335b6e92781..d7dc37b0685 100644
--- a/pkgs/development/python-modules/jq/default.nix
+++ b/pkgs/development/python-modules/jq/default.nix
@@ -2,6 +2,7 @@
 , buildPythonPackage
 , cython
 , fetchFromGitHub
+, fetchpatch
 , jq
 , pytestCheckHook
 , pythonOlder
@@ -9,7 +10,7 @@
 
 buildPythonPackage rec {
   pname = "jq";
-  version = "1.4.1";
+  version = "1.5.0";
   format = "setuptools";
 
   disabled = pythonOlder "3.7";
@@ -18,12 +19,17 @@ buildPythonPackage rec {
     owner = "mwilliamson";
     repo = "jq.py";
     rev = "refs/tags/${version}";
-    hash = "sha256-prH3yUFh3swXGsxnoax09aYAXaiu8o2M21ZbOp9HDJY=";
+    hash = "sha256-mITk5y2AdUc9kZ/WrsnHxS1GRRmO4FDbPRgTtV2gIXI=";
   };
 
   patches = [
     # Removes vendoring
     ./jq-py-setup.patch
+    (fetchpatch {
+      url = "https://github.com/mwilliamson/jq.py/commit/805705dde4beb9db9a1743663d415198fb02eb1a.patch";
+      includes = [ "tests/*" ];
+      hash = "sha256-AgdpwmtOTeJ4nSbM6IknKaIVqqtWkpxTTtblXjlbWeA=";
+    })
   ];
 
   nativeBuildInputs = [
diff --git a/pkgs/development/tools/jq/default.nix b/pkgs/development/tools/jq/default.nix
index 3c6d85e8ddc..4a57c0f5a0c 100644
--- a/pkgs/development/tools/jq/default.nix
+++ b/pkgs/development/tools/jq/default.nix
@@ -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 they’re 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";
   };
 }
diff --git a/pkgs/development/tools/jq/fix-tests-when-building-without-regex-supports.patch b/pkgs/development/tools/jq/fix-tests-when-building-without-regex-supports.patch
deleted file mode 100644
index ac7614ed80b..00000000000
--- a/pkgs/development/tools/jq/fix-tests-when-building-without-regex-supports.patch
+++ /dev/null
@@ -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])
diff --git a/pkgs/games/dwarf-fortress/update.sh b/pkgs/games/dwarf-fortress/update.sh
index 0ef9a40c7a5..5b99dff8aa7 100755
--- a/pkgs/games/dwarf-fortress/update.sh
+++ b/pkgs/games/dwarf-fortress/update.sh
@@ -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"