about summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorEric Dallo <ericdallo06@hotmail.com>2021-09-24 23:09:00 -0300
committerEric Dallo <ericdallo06@hotmail.com>2021-09-25 00:28:02 -0300
commit804e2edff596e667d287556cfd3a701bad1648b3 (patch)
tree72b2dcdf1ca4d4eda34c5a659c5508a3d97f9684 /pkgs/development/compilers
parent5cdf7377c1af74b3a609fd8e523707b488250070 (diff)
flutter: 2.2.1 -> 2.5.1
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/flutter/default.nix26
-rw-r--r--pkgs/development/compilers/flutter/flutter.nix20
2 files changed, 38 insertions, 8 deletions
diff --git a/pkgs/development/compilers/flutter/default.nix b/pkgs/development/compilers/flutter/default.nix
index f7dc6f8e87c31..940b379173fb2 100644
--- a/pkgs/development/compilers/flutter/default.nix
+++ b/pkgs/development/compilers/flutter/default.nix
@@ -4,18 +4,32 @@ let
   getPatches = dir:
     let files = builtins.attrNames (builtins.readDir dir);
     in map (f: dir + ("/" + f)) files;
-  version = "2.2.1";
+  version = "2.5.1";
   channel = "stable";
   filename = "flutter_linux_${version}-${channel}.tar.xz";
-in
-{
+
+  # Decouples flutter derivation from dart derivation,
+  # use specific dart version to not need to bump dart derivation when bumping flutter.
+  dartVersion = "2.14.2";
+  dartSourceBase = "https://storage.googleapis.com/dart-archive/channels";
+  dartForFlutter = dart.override {
+    version = dartVersion;
+    sources = {
+      "${dartVersion}-x86_64-linux" = fetchurl {
+        url = "${dartSourceBase}/stable/release/${dartVersion}/sdk/dartsdk-linux-x64-release.zip";
+        sha256 = "1gr2dr683kz0a0k6rcn4jcbxf9fr2xlzi5fcgn1lzrrxvys2lddx";
+      };
+    };
+  };
+in {
   mkFlutter = mkFlutter;
   stable = mkFlutter rec {
-    inherit dart version;
+    inherit version;
+    dart = dartForFlutter;
     pname = "flutter";
     src = fetchurl {
-      url = "https://storage.googleapis.com/flutter_infra/releases/${channel}/linux/${filename}";
-      sha256 = "009pwk2casz10gibgjpz08102wxmkq9iq3994b3c2q342g6526g0";
+      url = "https://storage.googleapis.com/flutter_infra_release/releases/${channel}/linux/${filename}";
+      sha256 = "12ycz7iasrc9p9c6zr95l6llyji3za43gsx8cmr2kjfiv23bcrv2";
     };
     patches = getPatches ./patches;
   };
diff --git a/pkgs/development/compilers/flutter/flutter.nix b/pkgs/development/compilers/flutter/flutter.nix
index 5cab3b929f752..e0ede49b09197 100644
--- a/pkgs/development/compilers/flutter/flutter.nix
+++ b/pkgs/development/compilers/flutter/flutter.nix
@@ -8,12 +8,10 @@
 { bash
 , buildFHSUserEnv
 , cacert
-, coreutils
 , git
 , runCommand
 , stdenv
 , lib
-, fetchurl
 , alsa-lib
 , dbus
 , expat
@@ -33,6 +31,7 @@
 , nspr
 , nss
 , systemd
+, which
 }:
 let
   drvName = "flutter-${version}";
@@ -74,10 +73,27 @@ let
     '';
 
     installPhase = ''
+      runHook preInstall
+
       mkdir -p $out
       cp -r . $out
       mkdir -p $out/bin/cache/
       ln -sf ${dart} $out/bin/cache/dart-sdk
+
+      runHook postInstall
+    '';
+
+    doInstallCheck = true;
+    installCheckInputs = [ which ];
+    installCheckPhase = ''
+      runHook preInstallCheck
+
+      export HOME="$(mktemp -d)"
+      $out/bin/flutter config --android-studio-dir $HOME
+      $out/bin/flutter config --android-sdk $HOME
+      $out/bin/flutter --version | fgrep -q '${version}'
+
+      runHook postInstallCheck
     '';
   };