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`.
This commit is contained in:
Tristan Ross 2024-05-30 14:06:11 -07:00
parent 442b72ad24
commit d2a06d2573
No known key found for this signature in database
GPG Key ID: B09C422035669AF8

View File

@ -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
'';
};