about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/flutter/wrapper.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/flutter/wrapper.nix')
-rw-r--r--nixpkgs/pkgs/development/compilers/flutter/wrapper.nix18
1 files changed, 10 insertions, 8 deletions
diff --git a/nixpkgs/pkgs/development/compilers/flutter/wrapper.nix b/nixpkgs/pkgs/development/compilers/flutter/wrapper.nix
index 38c2eb289310..4a7aedf97d38 100644
--- a/nixpkgs/pkgs/development/compilers/flutter/wrapper.nix
+++ b/nixpkgs/pkgs/development/compilers/flutter/wrapper.nix
@@ -3,14 +3,14 @@
 , darwin
 , callPackage
 , flutter
-, supportedTargetPlatforms ? [
+, supportedTargetFlutterPlatforms ? [
     "universal"
     "web"
   ]
   ++ lib.optional stdenv.hostPlatform.isLinux "linux"
   ++ lib.optional (stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isDarwin) "android"
   ++ lib.optionals stdenv.hostPlatform.isDarwin [ "macos" "ios" ]
-, artifactHashes ? (import ./artifacts/hashes.nix).${flutter.version}
+, artifactHashes ? flutter.artifactHashes
 , extraPkgConfigPackages ? [ ]
 , extraLibraries ? [ ]
 , extraIncludes ? [ ]
@@ -44,25 +44,26 @@
 }:
 
 let
-  supportsLinuxDesktopTarget = builtins.elem "linux" supportedTargetPlatforms;
+  supportsLinuxDesktopTarget = builtins.elem "linux" supportedTargetFlutterPlatforms;
 
-  platformArtifacts = lib.genAttrs supportedTargetPlatforms (platform:
+  flutterPlatformArtifacts = lib.genAttrs supportedTargetFlutterPlatforms (flutterPlatform:
     (callPackage ./artifacts/prepare-artifacts.nix {
       src = callPackage ./artifacts/fetch-artifacts.nix {
-        inherit platform;
+        inherit flutterPlatform;
+        systemPlatform = stdenv.hostPlatform.system;
         flutter = callPackage ./wrapper.nix { inherit flutter; };
-        hash = artifactHashes.${platform}.${stdenv.hostPlatform.system} or "";
+        hash = artifactHashes.${flutterPlatform}.${stdenv.hostPlatform.system} or "";
       };
     }));
 
   cacheDir = symlinkJoin rec {
     name = "flutter-cache-dir";
-    paths = builtins.attrValues platformArtifacts;
+    paths = builtins.attrValues flutterPlatformArtifacts;
     postBuild = ''
       mkdir -p "$out/bin/cache"
       ln -s '${flutter}/bin/cache/dart-sdk' "$out/bin/cache"
     '';
-    passthru.platform = platformArtifacts;
+    passthru.flutterPlatform = flutterPlatformArtifacts;
   };
 
   # By default, Flutter stores downloaded files (such as the Pub cache) in the SDK directory.
@@ -127,6 +128,7 @@ in
   passthru = flutter.passthru // {
     inherit (flutter) version;
     unwrapped = flutter;
+    updateScript = ./update/update.py;
     inherit cacheDir;
   };