Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jq: 1.6 -> 1.7 #246515

Merged
merged 4 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2311.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,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.
Expand Down
10 changes: 8 additions & 2 deletions pkgs/development/python-modules/jq/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
, buildPythonPackage
, cython
, fetchFromGitHub
, fetchpatch
, jq
, pytestCheckHook
, pythonOlder
}:

buildPythonPackage rec {
pname = "jq";
version = "1.4.1";
version = "1.5.0";
format = "setuptools";

disabled = pythonOlder "3.7";
Expand All @@ -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 = [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/yq/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

buildPythonPackage rec {
pname = "yq";
version = "3.2.2";
version = "3.2.3";

src = fetchPypi {
inherit pname version;
hash = "sha256-jbt6DJN92/w90XXmR49AlgwUDT6LHxoDFd52OE1mZQo=";
hash = "sha256-Kcj+HTa09kFj9NATFMauIXU5hw9hAhbe5gJd+16vr7E=";
};

patches = [
Expand Down
25 changes: 14 additions & 11 deletions pkgs/development/tools/jq/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchurl
, removeReferencesTo
, autoreconfHook
, bison
, onigurumaSupport ? true
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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";

Expand All @@ -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";
};
}

This file was deleted.

2 changes: 1 addition & 1 deletion pkgs/games/dwarf-fortress/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"