From 0901bc2b615f4f3f14b07306fc980140d4cdfc47 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 10 Dec 2024 11:25:45 +0100 Subject: [PATCH 1/2] jaq: format --- pkgs/by-name/ja/jaq/package.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/ja/jaq/package.nix b/pkgs/by-name/ja/jaq/package.nix index 4bd2f8cb1a3f..94dd551c3d0a 100644 --- a/pkgs/by-name/ja/jaq/package.nix +++ b/pkgs/by-name/ja/jaq/package.nix @@ -1,8 +1,9 @@ -{ lib -, rustPlatform -, fetchFromGitHub -, stdenv -, darwin +{ + lib, + rustPlatform, + fetchFromGitHub, + stdenv, + darwin, }: rustPlatform.buildRustPackage rec { @@ -27,7 +28,10 @@ rustPlatform.buildRustPackage rec { homepage = "https://github.com/01mf02/jaq"; changelog = "https://github.com/01mf02/jaq/releases/tag/${src.rev}"; license = licenses.mit; - maintainers = with maintainers; [ figsoda siraben ]; + maintainers = with maintainers; [ + figsoda + siraben + ]; mainProgram = "jaq"; }; } From 4b45fe7c20bd448d9719969ac1cae21240feddf2 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 10 Dec 2024 11:27:36 +0100 Subject: [PATCH 2/2] jaq: 1.6.0 -> 2.0.1 Diff: https://github.com/01mf02/jaq/compare/None...v2.0.1 Changelog: https://github.com/01mf02/jaq/releases/tag/v2.0.1 --- pkgs/by-name/ja/jaq/package.nix | 36 ++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/ja/jaq/package.nix b/pkgs/by-name/ja/jaq/package.nix index 94dd551c3d0a..f64e9855bd9f 100644 --- a/pkgs/by-name/ja/jaq/package.nix +++ b/pkgs/by-name/ja/jaq/package.nix @@ -1,34 +1,46 @@ { lib, + stdenv, rustPlatform, fetchFromGitHub, - stdenv, - darwin, + versionCheckHook, + nix-update-script, }: rustPlatform.buildRustPackage rec { pname = "jaq"; - version = "1.6.0"; + version = "2.0.1"; src = fetchFromGitHub { owner = "01mf02"; repo = "jaq"; - rev = "v${version}"; - hash = "sha256-VD10BO7bxTmD1A1AZsiEiYBsVhAKlXxdHNMmXqpvpKM="; + tag = "v${version}"; + hash = "sha256-S8ELxUKU8g8+6HpM+DxINEqMDha7SgesDymhCb7T9bg="; }; - cargoHash = "sha256-7MK0iLBpjvWE7UH5Tb3qIm2XnEVsAvBy34Ed4wHagZQ="; + cargoHash = "sha256-i3AxIlRY6r0zrMmZVh1l9fPiR652xjhTcwCyHCHCrL8="; - buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.apple_sdk.frameworks.Security + # This very line fails on `x86_64-darwin`: assertion failed: out.eq(ys) + # https://github.com/01mf02/jaq/blob/v2.0.1/jaq-json/tests/funs.rs#L118 + postPatch = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) '' + substituteInPlace jaq-json/tests/funs.rs \ + --replace-fail 'give(json!(null), "2.1 % 0 | isnan", json!(true));' "" + ''; + + nativeInstallCheckInputs = [ + versionCheckHook ]; + versionCheckProgramArg = [ "--version" ]; + doInstallCheck = true; - meta = with lib; { + passthru.updateScript = nix-update-script { }; + + meta = { description = "Jq clone focused on correctness, speed and simplicity"; homepage = "https://github.com/01mf02/jaq"; - changelog = "https://github.com/01mf02/jaq/releases/tag/${src.rev}"; - license = licenses.mit; - maintainers = with maintainers; [ + changelog = "https://github.com/01mf02/jaq/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ figsoda siraben ];