diff options
author | FlafyDev <flafyarazi@gmail.com> | 2024-01-15 01:34:37 +0200 |
---|---|---|
committer | FlafyDev <flafyarazi@gmail.com> | 2024-01-15 01:35:45 +0200 |
commit | b73ceb1ca70cc108305ca7af3dda7ce3bc7b4358 (patch) | |
tree | 32a1038c6bf6678b4f6d4fec97a1ff8d80d27a85 /pkgs/development/compilers/flutter | |
parent | da6757fd9d0deff3fe5ead896834c3e3e70d8d66 (diff) | |
download | nixlib-b73ceb1ca70cc108305ca7af3dda7ce3bc7b4358.tar nixlib-b73ceb1ca70cc108305ca7af3dda7ce3bc7b4358.tar.gz nixlib-b73ceb1ca70cc108305ca7af3dda7ce3bc7b4358.tar.bz2 nixlib-b73ceb1ca70cc108305ca7af3dda7ce3bc7b4358.tar.lz nixlib-b73ceb1ca70cc108305ca7af3dda7ce3bc7b4358.tar.xz nixlib-b73ceb1ca70cc108305ca7af3dda7ce3bc7b4358.tar.zst nixlib-b73ceb1ca70cc108305ca7af3dda7ce3bc7b4358.zip |
flutter: Make it possible to override `operatingSystem` internally
Makes it possible to get artifact hashes for other system platforms. Useful for an update script.
Diffstat (limited to 'pkgs/development/compilers/flutter')
-rw-r--r-- | pkgs/development/compilers/flutter/artifacts/fetch-artifacts.nix | 6 | ||||
-rw-r--r-- | pkgs/development/compilers/flutter/patches/override-operating-system.patch | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/pkgs/development/compilers/flutter/artifacts/fetch-artifacts.nix b/pkgs/development/compilers/flutter/artifacts/fetch-artifacts.nix index 3d76183e7113..98efe5f72846 100644 --- a/pkgs/development/compilers/flutter/artifacts/fetch-artifacts.nix +++ b/pkgs/development/compilers/flutter/artifacts/fetch-artifacts.nix @@ -40,6 +40,12 @@ runCommand "flutter-artifacts-${flutterPlatform}-${systemPlatform}" nativeBuildInputs = [ xorg.lndir flutter' unzip ]; NIX_FLUTTER_TOOLS_VM_OPTIONS = "--root-certs-file=${cacert}/etc/ssl/certs/ca-bundle.crt"; + NIX_FLUTTER_OPERATING_SYSTEM = { + "x86_64-linux" = "linux"; + "aarch64-linux" = "linux"; + "x86_64-darwin" = "macos"; + "aarch64-darwin" = "macos"; + }.${systemPlatform}; outputHash = hash; outputHashMode = "recursive"; diff --git a/pkgs/development/compilers/flutter/patches/override-operating-system.patch b/pkgs/development/compilers/flutter/patches/override-operating-system.patch new file mode 100644 index 000000000000..07d57175bd9a --- /dev/null +++ b/pkgs/development/compilers/flutter/patches/override-operating-system.patch @@ -0,0 +1,13 @@ +diff --git a/packages/flutter_tools/lib/src/base/platform.dart b/packages/flutter_tools/lib/src/base/platform.dart +index 45da89ad4c..2d79dbaece 100644 +--- a/packages/flutter_tools/lib/src/base/platform.dart ++++ b/packages/flutter_tools/lib/src/base/platform.dart +@@ -132,7 +132,7 @@ class LocalPlatform extends Platform { + String get pathSeparator => io.Platform.pathSeparator; + + @override +- String get operatingSystem => io.Platform.operatingSystem; ++ String get operatingSystem => io.Platform.environment['NIX_FLUTTER_OPERATING_SYSTEM'] ?? io.Platform.operatingSystem; + + @override + String get operatingSystemVersion => io.Platform.operatingSystemVersion; |