darling-file/xcodescripts/magic.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
649 B
Bash
Raw Normal View History

2016-02-29 10:01:23 +00:00
set -ex
2020-08-02 02:14:52 +00:00
2016-02-29 10:01:23 +00:00
# Note using builder version of file until it's easy to be self-hosting <rdar://problem/7140945>
FILE="$DSTROOT"/usr/bin/file
if "$FILE" --version 2>&1 | grep -q "Bad CPU type in executable"; then
2020-08-02 02:14:52 +00:00
sh "$SRCROOT"/xcodescripts/build_magichost.sh "${BUILT_PRODUCTS_DIR}"
FILE="$BUILT_PRODUCTS_DIR"/magic_host-dst/magic_host
2016-02-29 10:01:23 +00:00
fi
cd "$TEMP_DIR" && "$FILE" -C -m "$SRCROOT"/file/magic/Magdir
install -d -m 0755 "$DSTROOT"/usr/share/file
install -m 0644 "$TEMP_DIR"/Magdir.mgc "$DSTROOT"/usr/share/file/magic.mgc
install -d -m 0755 "$DSTROOT"/usr/share/file/magic
install -m 0644 "$SRCROOT"/file/magic/Magdir/* "$DSTROOT"/usr/share/file/magic