2023-04-27 06:52:51 +00:00
|
|
|
{ callPackage, fetchzip, dart, lib, stdenv }:
|
2019-12-24 17:01:45 +00:00
|
|
|
let
|
2023-04-27 06:52:51 +00:00
|
|
|
mkCustomFlutter = args: callPackage ./flutter.nix args;
|
2023-04-12 14:09:42 +00:00
|
|
|
wrapFlutter = flutter: callPackage ./wrapper.nix { inherit flutter; };
|
2019-12-24 17:01:45 +00:00
|
|
|
getPatches = dir:
|
|
|
|
let files = builtins.attrNames (builtins.readDir dir);
|
|
|
|
in map (f: dir + ("/" + f)) files;
|
2023-07-05 08:25:32 +00:00
|
|
|
mkFlutter = { version, engineVersion, dartVersion, flutterHash, dartHash, patches }:
|
2023-05-11 16:17:28 +00:00
|
|
|
let
|
|
|
|
args = {
|
|
|
|
inherit version engineVersion patches;
|
2023-04-27 06:52:51 +00:00
|
|
|
|
2023-05-11 16:17:28 +00:00
|
|
|
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;
|
|
|
|
};
|
2023-07-05 08:25:32 +00:00
|
|
|
"${dartVersion}-x86_64-darwin" = fetchzip {
|
|
|
|
url = "https://storage.googleapis.com/dart-archive/channels/stable/release/${dartVersion}/sdk/dartsdk-macos-x64-release.zip";
|
|
|
|
sha256 = dartHash.x86_64-darwin;
|
|
|
|
};
|
|
|
|
"${dartVersion}-aarch64-darwin" = fetchzip {
|
|
|
|
url = "https://storage.googleapis.com/dart-archive/channels/stable/release/${dartVersion}/sdk/dartsdk-macos-arm64-release.zip";
|
|
|
|
sha256 = dartHash.aarch64-darwin;
|
|
|
|
};
|
2023-04-27 06:52:51 +00:00
|
|
|
};
|
2022-10-02 16:19:50 +00:00
|
|
|
};
|
2023-07-05 08:25:32 +00:00
|
|
|
src = {
|
|
|
|
x86_64-linux = fetchzip {
|
|
|
|
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${version}-stable.tar.xz";
|
|
|
|
sha256 = flutterHash.x86_64-linux;
|
|
|
|
};
|
|
|
|
aarch64-linux = fetchzip {
|
|
|
|
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${version}-stable.tar.xz";
|
|
|
|
sha256 = flutterHash.aarch64-linux;
|
|
|
|
};
|
|
|
|
x86_64-darwin = fetchzip {
|
|
|
|
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_${version}-stable.zip";
|
|
|
|
sha256 = flutterHash.x86_64-darwin;
|
|
|
|
};
|
|
|
|
aarch64-darwin = fetchzip {
|
|
|
|
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_arm64_${version}-stable.zip";
|
|
|
|
sha256 = flutterHash.aarch64-darwin;
|
|
|
|
};
|
|
|
|
}.${stdenv.hostPlatform.system};
|
2021-09-25 02:09:00 +00:00
|
|
|
};
|
2023-05-11 16:17:28 +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.
|
2023-05-14 22:16:47 +00:00
|
|
|
flutter = (wrapFlutter (mkCustomFlutter args)).override {
|
|
|
|
supportsAndroid = false;
|
|
|
|
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-05-11 16:17:28 +00:00
|
|
|
};
|
2023-04-27 06:52:51 +00:00
|
|
|
};
|
2023-05-11 16:17:28 +00:00
|
|
|
});
|
2023-04-27 06:52:51 +00:00
|
|
|
|
2022-11-13 04:25:35 +00:00
|
|
|
flutter3Patches = getPatches ./patches/flutter3;
|
2022-05-15 17:36:01 +00:00
|
|
|
in
|
|
|
|
{
|
2023-04-27 06:52:51 +00:00
|
|
|
inherit wrapFlutter;
|
|
|
|
stable = mkFlutter {
|
2023-06-14 17:11:59 +00:00
|
|
|
version = "3.10.5";
|
|
|
|
engineVersion = "45f6e009110df4f34ec2cf99f63cf73b71b7a420";
|
|
|
|
dartVersion = "3.0.5";
|
2022-10-09 07:03:12 +00:00
|
|
|
dartHash = {
|
2023-06-14 17:11:59 +00:00
|
|
|
x86_64-linux = "sha256-UVVwPFk0qsKNR4JZMOGSGh1T482MN/8Xp4MZ3SA3C28=";
|
|
|
|
aarch64-linux = "sha256-phzaFfrv7qbZOOhPq92q39R6mr5vFeBqEmYDU7e7lZQ=";
|
2023-07-05 08:25:32 +00:00
|
|
|
x86_64-darwin = "sha256-4gJ659bNzs2lfI1LRwFACgu/ttkj+3xIrqLijju+CaI=";
|
|
|
|
aarch64-darwin = "sha256-RJt+muq5IrcAhVLYEgdbVygcY1oB7tnVCN+iqktC+6c=";
|
|
|
|
};
|
|
|
|
flutterHash = rec {
|
|
|
|
x86_64-linux = "sha256-lLppUQzu+fl81TMYSPD+HA83BqeIg7bXpURyo49NPwI=";
|
|
|
|
aarch64-linux = x86_64-linux;
|
|
|
|
x86_64-darwin = "sha256-1ZC5aCoGVBCeTSsu/ZEl1v53lLnzulx8Ya6YXvo4yIY=";
|
|
|
|
aarch64-darwin = "sha256-TCMempLjO47IbP5MAZVHlXXvNaURGo+EbaL0K8e27wU=";
|
2022-10-09 07:03:12 +00:00
|
|
|
};
|
2022-11-13 04:25:35 +00:00
|
|
|
patches = flutter3Patches;
|
2022-10-02 17:04:28 +00:00
|
|
|
};
|
|
|
|
|
2023-05-11 17:01:13 +00:00
|
|
|
v37 = mkFlutter {
|
|
|
|
version = "3.7.12";
|
|
|
|
engineVersion = "1a65d409c7a1438a34d21b60bf30a6fd5db59314";
|
|
|
|
dartVersion = "2.19.6";
|
|
|
|
dartHash = {
|
|
|
|
x86_64-linux = "sha256-4ezRuwhQHVCxZg5WbzU/tBUDvZVpfCo6coDE4K0UzXo=";
|
|
|
|
aarch64-linux = "sha256-pYmClIqOo0sRPOkrcF4xQbo0mHlrr1TkhT1fnNyYNck=";
|
2023-07-05 08:25:32 +00:00
|
|
|
x86_64-darwin = "sha256-tuIQhIOX2ub0u99CW/l7nCya9YVNokCZNgbVFqO4ils=";
|
|
|
|
aarch64-darwin = "sha256-Oe8/0ygDN3xf5/2I3N/OBzF0bps7Mg0K2zJKj+E9Nak=";
|
|
|
|
};
|
|
|
|
flutterHash = rec {
|
|
|
|
x86_64-linux = "sha256-5ExDBQXIpoZ5NwS66seY3m9/V8xDiyq/RdzldAyHdEE=";
|
|
|
|
aarch64-linux = x86_64-linux;
|
|
|
|
x86_64-darwin = "sha256-cJF8KB9fNb3hTZShDAPsMmr1neRdIMLvIl/m2tpzwQs=";
|
|
|
|
aarch64-darwin = "sha256-yetEE65UP2Wh9ocx7nClQjYLHO6lIbZPay1+I2tDSM4=";
|
2023-05-11 17:01:13 +00:00
|
|
|
};
|
|
|
|
patches = flutter3Patches;
|
|
|
|
};
|
2019-12-24 17:01:45 +00:00
|
|
|
}
|