mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
flutter: optimize evaluation of appBuildDeps
This commit is contained in:
parent
aa852f2301
commit
a254123065
1 changed files with 12 additions and 4 deletions
|
@ -103,11 +103,19 @@ let
|
||||||
let
|
let
|
||||||
# https://discourse.nixos.org/t/handling-transitive-c-dependencies/5942/3
|
# https://discourse.nixos.org/t/handling-transitive-c-dependencies/5942/3
|
||||||
deps =
|
deps =
|
||||||
pkg:
|
pkg: lib.filter lib.isDerivation ((pkg.buildInputs or [ ]) ++ (pkg.propagatedBuildInputs or [ ]));
|
||||||
builtins.filter lib.isDerivation ((pkg.buildInputs or [ ]) ++ (pkg.propagatedBuildInputs or [ ]));
|
withKey = pkg: {
|
||||||
collect = pkg: lib.unique ([ pkg ] ++ deps pkg ++ builtins.concatMap collect (deps pkg));
|
key = pkg.outPath;
|
||||||
|
val = pkg;
|
||||||
|
};
|
||||||
|
collect = pkg: lib.map withKey ([ pkg ] ++ deps pkg);
|
||||||
in
|
in
|
||||||
builtins.concatMap collect appRuntimeDeps;
|
lib.map (e: e.val) (
|
||||||
|
lib.genericClosure {
|
||||||
|
startSet = lib.map withKey appRuntimeDeps;
|
||||||
|
operator = item: collect item.val;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
# Some header files and libraries are not properly located by the Flutter SDK.
|
# Some header files and libraries are not properly located by the Flutter SDK.
|
||||||
# They must be manually included.
|
# They must be manually included.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue