2023-05-24 13:37:59 +00:00
|
|
|
{ callPackage, fetchzip, dart, lib, stdenv }:
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
2023-05-24 13:37:59 +00:00
|
|
|
mkCustomFlutter = args: callPackage ./flutter.nix args;
|
2023-04-29 16:46:19 +00:00
|
|
|
wrapFlutter = flutter: callPackage ./wrapper.nix { inherit flutter; };
|
2020-04-24 23:36:52 +00:00
|
|
|
getPatches = dir:
|
|
|
|
let files = builtins.attrNames (builtins.readDir dir);
|
|
|
|
in map (f: dir + ("/" + f)) files;
|
2023-05-24 13:37:59 +00:00
|
|
|
mkFlutter = { version, engineVersion, dartVersion, hash, dartHash, patches }:
|
|
|
|
let
|
|
|
|
args = {
|
|
|
|
inherit version engineVersion patches;
|
|
|
|
|
|
|
|
dart = dart.override {
|
|
|
|
version = dartVersion;
|
|
|
|
sources = {
|
|
|
|
"${dartVersion}-x86_64-linux" = fetchzip {
|
|
|
|
url = "https://storage.googleapis.com/dart-archive/channels/stable/release/${dartVersion}/sdk/dartsdk-linux-x64-release.zip";
|
|
|
|
sha256 = dartHash.x86_64-linux;
|
|
|
|
};
|
|
|
|
"${dartVersion}-aarch64-linux" = fetchzip {
|
|
|
|
url = "https://storage.googleapis.com/dart-archive/channels/stable/release/${dartVersion}/sdk/dartsdk-linux-arm64-release.zip";
|
|
|
|
sha256 = dartHash.aarch64-linux;
|
|
|
|
};
|
|
|
|
};
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
2023-05-24 13:37:59 +00:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${version}-stable.tar.xz";
|
|
|
|
sha256 = hash;
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
2021-09-28 08:13:01 +00:00
|
|
|
};
|
2023-05-24 13:37:59 +00:00
|
|
|
in
|
|
|
|
(mkCustomFlutter args).overrideAttrs (prev: next: {
|
|
|
|
passthru = next.passthru // rec {
|
|
|
|
inherit wrapFlutter mkCustomFlutter mkFlutter;
|
|
|
|
buildFlutterApplication = callPackage ../../../build-support/flutter {
|
|
|
|
# Package a minimal version of Flutter that only uses Linux desktop release artifacts.
|
|
|
|
flutter = wrapFlutter
|
|
|
|
(mkCustomFlutter (args // {
|
|
|
|
includedEngineArtifacts = {
|
|
|
|
common = [ "flutter_patched_sdk_product" ];
|
|
|
|
platform.linux = lib.optionals stdenv.hostPlatform.isLinux
|
|
|
|
(lib.genAttrs ((lib.optional stdenv.hostPlatform.isx86_64 "x64") ++ (lib.optional stdenv.hostPlatform.isAarch64 "arm64"))
|
|
|
|
(architecture: [ "release" ]));
|
|
|
|
};
|
|
|
|
}));
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
flutter2Patches = getPatches ./patches/flutter2;
|
|
|
|
flutter3Patches = getPatches ./patches/flutter3;
|
2022-08-21 13:32:41 +00:00
|
|
|
in
|
|
|
|
{
|
2023-05-24 13:37:59 +00:00
|
|
|
inherit wrapFlutter;
|
|
|
|
stable = mkFlutter {
|
|
|
|
version = "3.10.0";
|
|
|
|
engineVersion = "d44b5a94c976fbb65815374f61ab5392a220b084";
|
|
|
|
dartVersion = "3.0.0";
|
|
|
|
hash = "sha256-3cRVPNrph9QUUnAdQhd5TOp2i1zFRxJ+OhqxXrJ+ncU=";
|
|
|
|
dartHash = {
|
|
|
|
x86_64-linux = "sha256-AhvAt2c0URzL+MSIXlwbkuWNuhKbWvUpoyiYf1vXfcc=";
|
|
|
|
aarch64-linux = "sha256-bo4kZtNpj91JaCW8+GD4bQ60oOWQ7daj4C7cAHwLMtw=";
|
|
|
|
};
|
|
|
|
patches = flutter3Patches;
|
|
|
|
};
|
|
|
|
|
|
|
|
v37 = mkFlutter {
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "3.7.12";
|
|
|
|
engineVersion = "1a65d409c7a1438a34d21b60bf30a6fd5db59314";
|
|
|
|
dartVersion = "2.19.6";
|
|
|
|
hash = "sha256-5ExDBQXIpoZ5NwS66seY3m9/V8xDiyq/RdzldAyHdEE=";
|
2022-10-21 18:38:19 +00:00
|
|
|
dartHash = {
|
2023-04-29 16:46:19 +00:00
|
|
|
x86_64-linux = "sha256-4ezRuwhQHVCxZg5WbzU/tBUDvZVpfCo6coDE4K0UzXo=";
|
|
|
|
aarch64-linux = "sha256-pYmClIqOo0sRPOkrcF4xQbo0mHlrr1TkhT1fnNyYNck=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
2023-01-11 07:51:40 +00:00
|
|
|
patches = flutter3Patches;
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
v2 = mkFlutter {
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "2.10.5";
|
2023-04-29 16:46:19 +00:00
|
|
|
engineVersion = "57d3bac3dd5cb5b0e464ab70e7bc8a0d8cf083ab";
|
2022-10-21 18:38:19 +00:00
|
|
|
dartVersion = "2.16.2";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-MxaWvlcCfXN8gsC116UMzqb4LgixHL3YjrGWy7WYgW4=";
|
2022-10-21 18:38:19 +00:00
|
|
|
dartHash = {
|
2023-04-29 16:46:19 +00:00
|
|
|
x86_64-linux = "sha256-vxKxysg6e3Qxtlp4dLxOZaBtgHGtl7XYd73zFZd9yJc=";
|
|
|
|
aarch64-linux = "sha256-ZfpR6fj/a9Bsgrg31Z/uIJaCHIWtcQH3VTTVkDJKkwA=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
2023-01-11 07:51:40 +00:00
|
|
|
patches = flutter2Patches;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|