From 623ac19416c470a71b28da15b1b37403b2d28501 Mon Sep 17 00:00:00 2001 From: hacker1024 Date: Mon, 23 Oct 2023 15:40:16 +1100 Subject: [PATCH] fetchDartDeps: Generalise dependency derivation logic --- .../dart/fetch-dart-deps/default.nix | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/dart/fetch-dart-deps/default.nix b/pkgs/build-support/dart/fetch-dart-deps/default.nix index 27b5e1f1b20d..4f32365f857f 100644 --- a/pkgs/build-support/dart/fetch-dart-deps/default.nix +++ b/pkgs/build-support/dart/fetch-dart-deps/default.nix @@ -154,11 +154,10 @@ let outputHash = if vendorHash != "" then vendorHash else lib.fakeSha256; } // (removeAttrs drvArgs [ "name" "pname" ])); - depsListDrv = stdenvNoCC.mkDerivation ({ - name = "${name}-dart-deps-list.json"; - nativeBuildInputs = [ hook dart jq ]; + mkDepsDrv = args: stdenvNoCC.mkDerivation (args // { + nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [ hook dart ]; - configurePhase = '' + configurePhase = args.configurePhase or '' runHook preConfigure ${sdkSetupScript} @@ -170,6 +169,12 @@ let runHook postConfigure ''; + } // (removeAttrs buildDrvInheritArgs [ "name" "pname" ])); + + depsListDrv = mkDepsDrv { + name = "${name}-dart-deps-list.json"; + + nativeBuildInputs = [ jq ]; buildPhase = '' runHook preBuild @@ -178,7 +183,7 @@ let ''; dontInstall = true; - } // (removeAttrs buildDrvInheritArgs [ "name" "pname" ])); + }; # As of Dart 3.0.0, Pub checks the revision of cached Git-sourced packages. # Git must be wrapped to return a positive result, as the real .git directory is wiped