Apply the same Nix lipo workaround to iOS

This commit is contained in:
Erwan Leboucher 2026-08-08 22:22:22 +02:00
commit 46474fbae6
Signed by: eleboucher
SSH key fingerprint: SHA256:fjyYE6Mo6r2wpEtyYKFfGpX8fmR9bjL0NxWBHosnOgk
2 changed files with 17 additions and 2 deletions

View file

@ -336,7 +336,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; shellScript = "export PATH=\"$PROJECT_DIR/scripts:$PATH\"\n/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
}; };
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
@ -351,7 +351,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; shellScript = "export PATH=\"$PROJECT_DIR/scripts:$PATH\"\n/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
}; };
EE82EC529EB6C0F1FA480659 /* [CP] Check Pods Manifest.lock */ = { EE82EC529EB6C0F1FA480659 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;

15
ios/scripts/lipo Executable file
View file

@ -0,0 +1,15 @@
#!/bin/sh
# Workaround for NixOS/nixpkgs#405066: frameworks copied from the Nix store
# stay read-only, so lipo can't write its temporary output file when Flutter
# thins them during the build. Make the framework writable before delegating
# to the real lipo.
for arg in "$@"; do
case "$arg" in
*/*.framework/*)
fw_dir="${arg%.framework/*}.framework"
chmod -R +w "$fw_dir" 2>/dev/null
;;
esac
done
exec /usr/bin/lipo "$@"