From d2a06d2573b735af095109081ab2e24b496ef689 Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Thu, 30 May 2024 14:06:11 -0700 Subject: [PATCH] flutter: drop moreutils for more bash Since moreutils depends on Perl and that causes #315990, drop moreutils until Perl is fixed to handle cross compiling properly. We now create a temporary file and write the jq result to it and then copy that to `$out`. --- pkgs/build-support/flutter/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/flutter/default.nix b/pkgs/build-support/flutter/default.nix index 2af03d5f98e3..49929fd87754 100644 --- a/pkgs/build-support/flutter/default.nix +++ b/pkgs/build-support/flutter/default.nix @@ -10,7 +10,6 @@ , pkg-config , jq , yq -, moreutils }: # absolutely no mac support for now @@ -73,11 +72,15 @@ let extraPackageConfigSetup = '' # https://github.com/flutter/flutter/blob/3.13.8/packages/flutter_tools/lib/src/dart/pub.dart#L755 if [ "$('${yq}/bin/yq' '.flutter.generate // false' pubspec.yaml)" = "true" ]; then + export TEMP_PACKAGES=$(mktemp) '${jq}/bin/jq' '.packages |= . + [{ name: "flutter_gen", rootUri: "flutter_gen", languageVersion: "2.12", - }]' "$out" | '${moreutils}/bin/sponge' "$out" + }]' "$out" > "$TEMP_PACKAGES" + cp "$TEMP_PACKAGES" "$out" + rm "$TEMP_PACKAGES" + unset TEMP_PACKAGES fi ''; };