From dc1bb8caba2863b75aab0f48db2a16a9e2429a37 Mon Sep 17 00:00:00 2001 From: FlafyDev Date: Wed, 20 Dec 2023 20:52:10 +0200 Subject: [PATCH] flutter: Add version json file Needed for flutter doctor and flutter --version Co-authored-by: Sergii Maksymov --- pkgs/development/compilers/flutter/flutter.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/flutter/flutter.nix b/pkgs/development/compilers/flutter/flutter.nix index 1e68a3b02a9ee..c78589997b434 100644 --- a/pkgs/development/compilers/flutter/flutter.nix +++ b/pkgs/development/compilers/flutter/flutter.nix @@ -11,6 +11,7 @@ , darwin , git , which +, jq }: let @@ -27,7 +28,7 @@ let inherit src patches version; buildInputs = [ git ]; - nativeBuildInputs = [ makeWrapper ] + nativeBuildInputs = [ makeWrapper jq ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ]; preConfigure = '' @@ -67,6 +68,19 @@ let ln -s '${tools.pubcache}/package_config.json' packages/flutter_tools/.dart_tool/package_config.json echo -n "${version}" > version + cat < bin/cache/flutter.version.json + { + "devToolsVersion": "$(cat "${dart}/bin/resources/devtools/version.json" | jq -r .version)", + "flutterVersion": "${version}", + "frameworkVersion": "${version}", + "channel": "stable", + "repositoryUrl": "https://github.com/flutter/flutter.git", + "frameworkRevision": "nixpkgs000000000000000000000000000000000", + "frameworkCommitDate": "1970-01-01 00:00:00", + "engineRevision": "${engineVersion}", + "dartSdkVersion": "${dart.version}" + } + EOF ''; installPhase = ''