diff options
author | hacker1024 <hacker1024@users.sourceforge.net> | 2023-04-23 00:32:24 +1000 |
---|---|---|
committer | hacker1024 <hacker1024@users.sourceforge.net> | 2023-04-23 00:32:24 +1000 |
commit | 89bb0ed91bd5ed327ce0c9bd745921fdf4bad097 (patch) | |
tree | 5dc4d3c5ed3704a073bc2c604222f42033f3011f /pkgs/build-support | |
parent | 9f05297dc8875baeeeb8160b60f120affc259f2c (diff) | |
download | nixpkgs-89bb0ed91bd5ed327ce0c9bd745921fdf4bad097.tar nixpkgs-89bb0ed91bd5ed327ce0c9bd745921fdf4bad097.tar.gz nixpkgs-89bb0ed91bd5ed327ce0c9bd745921fdf4bad097.tar.bz2 nixpkgs-89bb0ed91bd5ed327ce0c9bd745921fdf4bad097.tar.lz nixpkgs-89bb0ed91bd5ed327ce0c9bd745921fdf4bad097.tar.xz nixpkgs-89bb0ed91bd5ed327ce0c9bd745921fdf4bad097.tar.zst nixpkgs-89bb0ed91bd5ed327ce0c9bd745921fdf4bad097.zip |
flutter.buildFlutterApplication: Add an option to generate the dependency list with IFD
This is useful for projects outside of Nixpkgs.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/flutter/default.nix | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/pkgs/build-support/flutter/default.nix b/pkgs/build-support/flutter/default.nix index 622a19c32bd..abb1c8ac359 100644 --- a/pkgs/build-support/flutter/default.nix +++ b/pkgs/build-support/flutter/default.nix @@ -14,6 +14,7 @@ , flutterBuildFlags ? [ ] , runtimeDependencies ? [ ] , customPackageOverrides ? { } +, autoDepsList ? false , depsListFile ? null , vendorHash , pubspecLockFile ? null @@ -48,11 +49,16 @@ let ] ++ nativeBuildInputs; preUnpack = '' - if ! { [ '${lib.boolToString (depsListFile != null)}' = 'true' ] ${lib.optionalString (depsListFile != null) "&& cmp -s <(jq -Sc . '${depsListFile}') <(jq -Sc . '${finalAttrs.passthru.depsListFile}')"}; }; then - echo 1>&2 -e '\nThe dependency list file was either not given or differs from the expected result.' \ - '\nPlease copy the contents of ${finalAttrs.passthru.depsListFile} to a new file to pass to the depsListFile argument.' - exit 1 - fi + ${lib.optionalString (!autoDepsList) '' + if ! { [ '${lib.boolToString (depsListFile != null)}' = 'true' ] ${lib.optionalString (depsListFile != null) "&& cmp -s <(jq -Sc . '${depsListFile}') <(jq -Sc . '${finalAttrs.passthru.depsListFile}')"}; }; then + echo 1>&2 -e '\nThe dependency list file was either not given or differs from the expected result.' \ + '\nPlease choose one of the following solutions:' \ + '\n - Duplicate the following file and pass it to the depsListFile argument.' \ + '\n ${finalAttrs.passthru.depsListFile}' \ + '\n - Set autoDepsList to true (not supported by Hydra or permitted in Nixpkgs)'. + exit 1 + fi + ''} ${preUnpack} ''; @@ -127,7 +133,13 @@ let }); packageOverrideRepository = (callPackage ../../development/compilers/flutter/package-overrides { }) // customPackageOverrides; - productPackages = builtins.filter (package: package.kind != "dev") (if depsListFile == null then [ ] else (builtins.fromJSON (builtins.readFile depsListFile))); + productPackages = builtins.filter (package: package.kind != "dev") + (if autoDepsList + then builtins.fromJSON (builtins.readFile deps.depsListFile) + else + if depsListFile == null + then [ ] + else builtins.fromJSON (builtins.readFile depsListFile)); in builtins.foldl' (prev: package: |