···1-{ hostPlatform
2, buildDartApplication
3, git
4, which
···35 '';
3637 dartEntryPoints."flutter_tools.snapshot" = "bin/flutter_tools.dart";
38- dartCompileFlags = [ "--define=NIX_FLUTTER_HOST_PLATFORM=${hostPlatform.system}" ];
3940 # The Dart wrapper launchers are useless for the Flutter tool - it is designed
41 # to be launched from a snapshot by the SDK.
···1+{ systemPlatform
2, buildDartApplication
3, git
4, which
···35 '';
3637 dartEntryPoints."flutter_tools.snapshot" = "bin/flutter_tools.dart";
38+ dartCompileFlags = [ "--define=NIX_FLUTTER_HOST_PLATFORM=${systemPlatform}" ];
3940 # The Dart wrapper launchers are useless for the Flutter tool - it is designed
41 # to be launched from a snapshot by the SDK.
+25-9
pkgs/development/compilers/flutter/flutter.nix
···4, dart
5, src
6, pubspecLock
07, lib
8, stdenv
9, callPackage
···11, darwin
12, git
13, which
14-}:
15-16-let
17- tools = callPackage ./flutter-tools.nix {
18 inherit dart version;
19 flutterSrc = src;
20 inherit patches;
21 inherit pubspecLock;
22- };
0023024 unwrapped =
25 stdenv.mkDerivation {
26 name = "flutter-${version}-unwrapped";
27 inherit src patches version;
2829 buildInputs = [ git ];
30- nativeBuildInputs = [ makeWrapper ]
31 ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ];
3233 preConfigure = ''
···58 # Add a flutter_tools artifact stamp, and build a snapshot.
59 # This is the Flutter CLI application.
60 echo "$(git rev-parse HEAD)" > bin/cache/flutter_tools.stamp
61- ln -s '${tools}/share/flutter_tools.snapshot' bin/cache/flutter_tools.snapshot
6263 # Some of flutter_tools's dependencies contain static assets. The
64 # application attempts to read its own package_config.json to find these
65 # assets at runtime.
66 mkdir -p packages/flutter_tools/.dart_tool
67- ln -s '${tools.pubcache}/package_config.json' packages/flutter_tools/.dart_tool/package_config.json
6869 echo -n "${version}" > version
000000000000070 '';
7172 installPhase = ''
···105 '';
106107 passthru = {
108- inherit dart engineVersion tools;
0109 # The derivation containing the original Flutter SDK files.
110 # When other derivations wrap this one, any unmodified files
111 # found here should be included as-is, for tooling compatibility.
···4, dart
5, src
6, pubspecLock
7+, artifactHashes ? null
8, lib
9, stdenv
10, callPackage
···12, darwin
13, git
14, which
15+, jq
16+, flutterTools ? callPackage ./flutter-tools.nix {
0017 inherit dart version;
18 flutterSrc = src;
19 inherit patches;
20 inherit pubspecLock;
21+ systemPlatform = stdenv.hostPlatform.system;
22+ }
23+}:
2425+let
26 unwrapped =
27 stdenv.mkDerivation {
28 name = "flutter-${version}-unwrapped";
29 inherit src patches version;
3031 buildInputs = [ git ];
32+ nativeBuildInputs = [ makeWrapper jq ]
33 ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ];
3435 preConfigure = ''
···60 # Add a flutter_tools artifact stamp, and build a snapshot.
61 # This is the Flutter CLI application.
62 echo "$(git rev-parse HEAD)" > bin/cache/flutter_tools.stamp
63+ ln -s '${flutterTools}/share/flutter_tools.snapshot' bin/cache/flutter_tools.snapshot
6465 # Some of flutter_tools's dependencies contain static assets. The
66 # application attempts to read its own package_config.json to find these
67 # assets at runtime.
68 mkdir -p packages/flutter_tools/.dart_tool
69+ ln -s '${flutterTools.pubcache}/package_config.json' packages/flutter_tools/.dart_tool/package_config.json
7071 echo -n "${version}" > version
72+ cat <<EOF > bin/cache/flutter.version.json
73+ {
74+ "devToolsVersion": "$(cat "${dart}/bin/resources/devtools/version.json" | jq -r .version)",
75+ "flutterVersion": "${version}",
76+ "frameworkVersion": "${version}",
77+ "channel": "stable",
78+ "repositoryUrl": "https://github.com/flutter/flutter.git",
79+ "frameworkRevision": "nixpkgs000000000000000000000000000000000",
80+ "frameworkCommitDate": "1970-01-01 00:00:00",
81+ "engineRevision": "${engineVersion}",
82+ "dartSdkVersion": "${dart.version}"
83+ }
84+ EOF
85 '';
8687 installPhase = ''
···120 '';
121122 passthru = {
123+ inherit dart engineVersion artifactHashes;
124+ tools = flutterTools;
125 # The derivation containing the original Flutter SDK files.
126 # When other derivations wrap this one, any unmodified files
127 # found here should be included as-is, for tooling compatibility.