about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/flutter/update/get-pubspec-lock.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/flutter/update/get-pubspec-lock.nix')
-rw-r--r--nixpkgs/pkgs/development/compilers/flutter/update/get-pubspec-lock.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/compilers/flutter/update/get-pubspec-lock.nix b/nixpkgs/pkgs/development/compilers/flutter/update/get-pubspec-lock.nix
new file mode 100644
index 000000000000..ff72046bcecb
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/flutter/update/get-pubspec-lock.nix
@@ -0,0 +1,30 @@
+{ flutterPackages
+, stdenv
+, cacert
+,
+}:
+let
+  flutterCompactVersion = "@flutter_compact_version@";
+  inherit (flutterPackages."v${flutterCompactVersion}") dart;
+in
+stdenv.mkDerivation {
+  name = "pubspec-lock";
+  src = @flutter_src@;
+
+  nativeBuildInputs = [ dart ];
+
+  outputHashAlgo = "sha256";
+  outputHashMode = "recursive";
+  outputHash = "@hash@";
+
+  buildPhase = ''
+    cd ./packages/flutter_tools
+
+    export HOME="$(mktemp -d)"
+    dart --root-certs-file=${cacert}/etc/ssl/certs/ca-bundle.crt pub get -v
+  '';
+
+  installPhase = ''
+    cp -r ./pubspec.lock $out
+  '';
+}