diff options
author | hacker1024 <hacker1024@users.sourceforge.net> | 2023-04-22 16:42:22 +1000 |
---|---|---|
committer | hacker1024 <hacker1024@users.sourceforge.net> | 2023-04-23 00:12:45 +1000 |
commit | 9f05297dc8875baeeeb8160b60f120affc259f2c (patch) | |
tree | 7ea6e2706fb0cbf38d32e7f60214ae72ba548291 /pkgs/build-support/dart | |
parent | 37e93f7c3b9c98eef13733f2a558194db2d1b0f6 (diff) |
flutter.buildFlutterApplication: Manually supply the dependency list
This removes the need for IFD.
Diffstat (limited to 'pkgs/build-support/dart')
-rw-r--r-- | pkgs/build-support/dart/fetch-dart-deps/default.nix | 41 | ||||
-rw-r--r-- | pkgs/build-support/dart/list-dart-deps/default.nix | 28 |
2 files changed, 32 insertions, 37 deletions
diff --git a/pkgs/build-support/dart/fetch-dart-deps/default.nix b/pkgs/build-support/dart/fetch-dart-deps/default.nix index a3ab2c2c73a2e..9deb99648c08a 100644 --- a/pkgs/build-support/dart/fetch-dart-deps/default.nix +++ b/pkgs/build-support/dart/fetch-dart-deps/default.nix @@ -4,6 +4,7 @@ , dart , git , cacert +, jq }: { @@ -151,13 +152,35 @@ let outputHashMode = "recursive"; 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 ]; + + configurePhase = '' + runHook preConfigure + dart pub get --offline + runHook postConfigure + ''; + + buildPhase = '' + runHook preBuild + dart pub deps --json | jq .packages > $out + runHook postBuild + ''; + } // buildDrvInheritArgs); + + hook = (makeSetupHook { + # The setup hook should not be part of the fixed-output derivation. + # Updates to the hook script should not change vendor hashes, and it won't + # work at all anyway due to https://github.com/NixOS/nix/issues/6660. + name = "${name}-dart-deps-setup-hook"; + substitutions = { inherit deps; }; + propagatedBuildInputs = [ dart git ]; + passthru = { + files = deps.outPath; + depsListFile = depsListDrv.outPath; + }; + }) ./setup-hook.sh; in -(makeSetupHook { - # The setup hook should not be part of the fixed-output derivation. - # Updates to the hook script should not change vendor hashes, and it won't - # work at all anyway due to https://github.com/NixOS/nix/issues/6660. - name = "${name}-dart-deps-setup-hook"; - substitutions = { inherit deps; }; - propagatedBuildInputs = [ dart git ]; - passthru.files = deps.outPath; -}) ./setup-hook.sh +hook diff --git a/pkgs/build-support/dart/list-dart-deps/default.nix b/pkgs/build-support/dart/list-dart-deps/default.nix deleted file mode 100644 index 5cafd7773d452..0000000000000 --- a/pkgs/build-support/dart/list-dart-deps/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ stdenv -, dart -, jq -}: -deps: - -builtins.fromJSON (builtins.readFile (stdenv.mkDerivation { - name = "${deps.name}-list.json"; - nativeBuildInputs = [ deps dart jq ]; - - unpackPhase = '' - runHook preUnpack - ln -s "${deps.files}"/pubspec/* . - runHook postUnpack - ''; - - configurePhase = '' - runHook preConfigure - dart pub get --offline - runHook postConfigure - ''; - - buildPhase = '' - runHook preBuild - dart pub deps --json | jq .packages > $out - runHook postBuild - ''; -})) |