Skip to content

Commit

Permalink
flutter: Allow impure reference to the arch binary on macOS
Browse files Browse the repository at this point in the history
The `arch` binary is not available in `darwin.adv_cmds`, it is provided via. `darwin.system_cmds` instead, but support for this is still experimental.
  • Loading branch information
madsmtm committed Mar 18, 2024
1 parent 3da824d commit 04ef11c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
@@ -1,14 +1,12 @@
{ darwin }:
{
buildInputs ? [ ],
...
{}:
{ buildInputs ? [ ]
, ...
}:
{
postPatch = ''
if [ "$pname" == "flutter-tools" ]; then
# Remove impure references to `arch` and use arm64 instead of arm64e.
# Use arm64 instead of arm64e.
substituteInPlace lib/src/ios/xcodeproj.dart \
--replace-fail /usr/bin/arch '${darwin.adv_cmds}/bin/arch' \
--replace-fail arm64e arm64
fi
'';
Expand Down
4 changes: 1 addition & 3 deletions pkgs/development/compilers/flutter/flutter-tools.nix
Expand Up @@ -9,7 +9,6 @@
, flutterSrc
, patches ? [ ]
, pubspecLock
, darwin
}:

buildDartApplication.override { inherit dart; } rec {
Expand All @@ -27,10 +26,9 @@ buildDartApplication.override { inherit dart; } rec {
postPatch = ''
popd
''
# Remove impure references to `arch` and use arm64 instead of arm64e.
# Use arm64 instead of arm64e.
+ lib.optionalString stdenv.isDarwin ''
substituteInPlace lib/src/ios/xcodeproj.dart \
--replace-fail /usr/bin/arch '${darwin.adv_cmds}/bin/arch' \
--replace-fail arm64e arm64
'';

Expand Down

0 comments on commit 04ef11c

Please sign in to comment.