From ecd63ea23fdc7ca1a315f47e0f33c7182b6f43f0 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 3 Mar 2025 14:19:50 +0100 Subject: [PATCH 1/2] nickel: cleanup --- pkgs/by-name/ni/nickel/package.nix | 38 ++++++++++++++++++------------ 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/pkgs/by-name/ni/nickel/package.nix b/pkgs/by-name/ni/nickel/package.nix index a59749ea4386..ec3934409d3e 100644 --- a/pkgs/by-name/ni/nickel/package.nix +++ b/pkgs/by-name/ni/nickel/package.nix @@ -3,17 +3,18 @@ rustPlatform, fetchFromGitHub, python3, + versionCheckHook, nix-update-script, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "nickel"; version = "1.10.0"; src = fetchFromGitHub { owner = "tweag"; repo = "nickel"; - tag = version; + tag = finalAttrs.version; hash = "sha256-CnEGC4SnLRfAPl3WTv83xertH2ulG5onseZpq3vxfwc="; }; @@ -41,16 +42,10 @@ rustPlatform.buildRustPackage rec { # dependency with that name, but that dependency uses the "dep:" syntax in # the features table, so it does not have an implicit feature with that name. preBuild = '' - sed -i 's/dep:comrak/comrak/' core/Cargo.toml + substituteInPlace core/Cargo.toml \ + --replace-fail "dep:comrak" "comrak" ''; - postInstall = '' - mkdir -p $nls/bin - mv $out/bin/nls $nls/bin/nls - ''; - - passthru.updateScript = nix-update-script { }; - checkFlags = [ # https://github.com/tweag/nickel/blob/1.10.0/git/tests/main.rs#L60 # fails because src is not a git repo @@ -58,7 +53,20 @@ rustPlatform.buildRustPackage rec { "--skip=fetch_targets" ]; - meta = with lib; { + postInstall = '' + mkdir -p $nls/bin + mv $out/bin/nls $nls/bin/nls + ''; + + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = [ "--version" ]; + doInstallCheck = true; + + passthru.updateScript = nix-update-script { }; + + meta = { homepage = "https://nickel-lang.org/"; description = "Better configuration for less"; longDescription = '' @@ -69,12 +77,12 @@ rustPlatform.buildRustPackage rec { that are then fed to another system. It is designed to have a simple, well-understood core: it is in essence JSON with functions. ''; - changelog = "https://github.com/tweag/nickel/blob/${version}/RELEASES.md"; - license = licenses.mit; - maintainers = with maintainers; [ + changelog = "https://github.com/tweag/nickel/blob/${finalAttrs.version}/RELEASES.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ felschr matthiasbeyer ]; mainProgram = "nickel"; }; -} +}) From 1f8374d28a28da92fff4060c845e6d9d9f01bfe5 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 3 Mar 2025 16:43:05 +0100 Subject: [PATCH 2/2] nickel: mark as broken on aarch64-linux --- pkgs/by-name/ni/nickel/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/ni/nickel/package.nix b/pkgs/by-name/ni/nickel/package.nix index ec3934409d3e..4ea0423a3df8 100644 --- a/pkgs/by-name/ni/nickel/package.nix +++ b/pkgs/by-name/ni/nickel/package.nix @@ -84,5 +84,10 @@ rustPlatform.buildRustPackage (finalAttrs: { matthiasbeyer ]; mainProgram = "nickel"; + badPlatforms = [ + # collect2: error: ld returned 1 exit status + # undefined reference to `PyExc_TypeError' + "aarch64-linux" + ]; }; })