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
|
for arg in "$@"; do
|
||||||
case "$arg" in
|
# Check if we are acting on a Flutter binary within a framework
|
||||||
*/*.framework/*)
|
if [[ "$arg" == *"Flutter.framework/Flutter" || "$arg" == *"FlutterMacOS.framework/FlutterMacOS" ]]; then
|
||||||
fw_dir="${arg%.framework/*}.framework"
|
# Identify the framework directory
|
||||||
echo "LIPO SHIM: chmod $fw_dir" >&2
|
FW_DIR=$(echo "$arg" | sed 's|/Flutter$||; s|/FlutterMacOS$||')
|
||||||
chmod -R u+w "$fw_dir" 2>/dev/null
|
|
||||||
;;
|
if [ -d "$FW_DIR" ]; then
|
||||||
*.lipo)
|
# Make the framework and its contents writable
|
||||||
echo "LIPO SHIM: chmod $(dirname "$arg")" >&2
|
chmod -R +w "$FW_DIR" 2>/dev/null
|
||||||
chmod u+w "$(dirname "$arg")" 2>/dev/null
|
fi
|
||||||
;;
|
fi
|
||||||
esac
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Pass through to the real lipo tool
|
||||||
exec /usr/bin/lipo "$@"
|
exec /usr/bin/lipo "$@"
|
||||||
Loading…
Reference in a new issue