diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 065d08b..57b889d 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -336,7 +336,7 @@ ); runOnlyForDeploymentPostprocessing = 0; 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 */ = { isa = PBXShellScriptBuildPhase; @@ -351,7 +351,7 @@ ); runOnlyForDeploymentPostprocessing = 0; 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 */ = { isa = PBXShellScriptBuildPhase; diff --git a/ios/scripts/lipo b/ios/scripts/lipo new file mode 100755 index 0000000..eea1eea --- /dev/null +++ b/ios/scripts/lipo @@ -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 "$@"