2012-06-14 07:56:54 -06:00
|
|
|
#!/bin/sh
|
|
|
|
PWD=`dirname "${0}"`
|
2015-01-11 11:53:51 -07:00
|
|
|
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
|
2014-05-11 12:42:40 -06:00
|
|
|
|
2019-11-01 20:42:08 -06:00
|
|
|
# attempt to remove quarantine flag: https://github.com/DFHack/dfhack/issues/1465
|
|
|
|
if ! test -f hack/quarantine-removed; then
|
2020-07-13 11:04:09 -06:00
|
|
|
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'
|
2019-11-01 20:42:08 -06:00
|
|
|
echo "quarantine flag removed on $(date); remove this file to re-run" > hack/quarantine-removed
|
|
|
|
fi
|
|
|
|
|
2020-03-26 20:58:43 -06:00
|
|
|
if [ ! -t 0 ]; then
|
|
|
|
stty() {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
fi
|
|
|
|
|
2014-05-11 12:42:40 -06:00
|
|
|
old_tty_settings=$(stty -g)
|
2014-12-17 15:12:10 -07:00
|
|
|
DYLD_INSERT_LIBRARIES=./hack/libdfhack.dylib ./dwarfort.exe "$@"
|
2014-05-11 12:42:40 -06:00
|
|
|
stty "$old_tty_settings"
|
2016-05-14 17:39:10 -06:00
|
|
|
tput sgr0
|
2014-05-11 12:42:40 -06:00
|
|
|
echo ""
|