mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 12:53:54 +00:00
flutter: Apply multiple Darwin aarch64 fixes
Taken from: https://github.com/NixOS/nixpkgs/pull/286750#issuecomment-1935147584
This commit is contained in:
parent
db38aeee72
commit
ab168d1f13
@ -0,0 +1,15 @@
|
||||
{ darwin }:
|
||||
{
|
||||
buildInputs ? [ ],
|
||||
...
|
||||
}:
|
||||
{
|
||||
postPatch = ''
|
||||
if [ "$pname" == "flutter-tools" ]; then
|
||||
# Remove impure references to `arch` and 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
|
||||
'';
|
||||
}
|
@ -1,4 +1,6 @@
|
||||
{ systemPlatform
|
||||
{ lib
|
||||
, stdenv
|
||||
, systemPlatform
|
||||
, buildDartApplication
|
||||
, git
|
||||
, which
|
||||
@ -7,6 +9,7 @@
|
||||
, flutterSrc
|
||||
, patches ? [ ]
|
||||
, pubspecLock
|
||||
, darwin
|
||||
}:
|
||||
|
||||
buildDartApplication.override { inherit dart; } rec {
|
||||
@ -21,7 +24,15 @@ buildDartApplication.override { inherit dart; } rec {
|
||||
inherit patches;
|
||||
# The given patches are made for the entire SDK source tree.
|
||||
prePatch = ''pushd "$NIX_BUILD_TOP/source"'';
|
||||
postPatch = ''popd'';
|
||||
postPatch = ''
|
||||
popd
|
||||
''
|
||||
# Remove impure references to `arch` and 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
|
||||
'';
|
||||
|
||||
# When the JIT snapshot is being built, the application needs to run.
|
||||
# It attempts to generate configuration files, and relies on a few external
|
||||
|
Loading…
Reference in New Issue
Block a user