dfhack/package/darwin/dfhack

31 lines
1004 B
Plaintext

2012-06-14 07:56:54 -06:00
#!/bin/sh
PWD=`dirname "${0}"`
cd "${PWD}"
2012-06-14 07:56:54 -06:00
#thanks to Iriel for figuring this out
OSREV=`uname -r | cut -d. -f1`
if [ "$OSREV" -ge 11 ] ; then
2022-04-12 12:48:19 -06:00
export DYLD_LIBRARY_PATH="./hack:./libs:./hack/libs"
export DYLD_FRAMEWORK_PATH="./hack:./libs:./hack/libs"
2012-06-14 07:56:54 -06:00
else
2022-04-12 12:48:19 -06:00
export DYLD_FALLBACK_LIBRARY_PATH="./hack:./libs:./hack/libs"
export DYLD_FALLBACK_FRAMEWORK_PATH="./hack:./libs:./hack/libs"
2012-06-14 07:56:54 -06:00
fi
# attempt to remove quarantine flag: https://github.com/DFHack/dfhack/issues/1465
if ! test -f hack/quarantine-removed; then
find hack/ libs/ dwarfort.exe \( -name '*.dylib' -or -name '*.framework' -or -name '*.exe' \) -print0 | xargs -0 xattr -d com.apple.quarantine 2>&1 | grep -iv 'no such xattr'
echo "quarantine flag removed on $(date); remove this file to re-run" > hack/quarantine-removed
fi
if [ ! -t 0 ]; then
stty() {
return
}
fi
old_tty_settings=$(stty -g)
DYLD_INSERT_LIBRARIES=./hack/libdfhack.dylib ./dwarfort.exe "$@"
stty "$old_tty_settings"
2016-05-14 17:39:10 -06:00
tput sgr0
echo ""