test
This commit is contained in:
parent
25cc5bd447
commit
29a276ff08
1 changed files with 16 additions and 13 deletions
29
scripts/lipo
29
scripts/lipo
|
|
@ -1,19 +1,22 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
# Precision shim for lipo to handle read-only frameworks from Nix store.
|
||||
# See: https://github.com/NixOS/nixpkgs/issues/405066
|
||||
|
||||
echo "LIPO SHIM: $@" >&2
|
||||
# If the upstream issue is fixed and the file is already writable,
|
||||
# this script will still work gracefully.
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
*/*.framework/*)
|
||||
fw_dir="${arg%.framework/*}.framework"
|
||||
echo "LIPO SHIM: chmod $fw_dir" >&2
|
||||
chmod -R u+w "$fw_dir" 2>/dev/null
|
||||
;;
|
||||
*.lipo)
|
||||
echo "LIPO SHIM: chmod $(dirname "$arg")" >&2
|
||||
chmod u+w "$(dirname "$arg")" 2>/dev/null
|
||||
;;
|
||||
esac
|
||||
# Check if we are acting on a Flutter binary within a framework
|
||||
if [[ "$arg" == *"Flutter.framework/Flutter" || "$arg" == *"FlutterMacOS.framework/FlutterMacOS" ]]; then
|
||||
# Identify the framework directory
|
||||
FW_DIR=$(echo "$arg" | sed 's|/Flutter$||; s|/FlutterMacOS$||')
|
||||
|
||||
if [ -d "$FW_DIR" ]; then
|
||||
# Make the framework and its contents writable
|
||||
chmod -R +w "$FW_DIR" 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Pass through to the real lipo tool
|
||||
exec /usr/bin/lipo "$@"
|
||||
Loading…
Reference in a new issue