Last active
August 29, 2015 14:16
-
-
Save mseri/494c17bd1f1918f0e86c to your computer and use it in GitHub Desktop.
Fixes dyld libraries path to be able to install rust in /opt/local
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
#IFS=$'\n\t' | |
E_BADARGS=85 | |
if [ ! -n "$1" ] | |
then | |
echo "Usage: `basename $0` hash" | |
exit $E_BADARGS | |
fi | |
if [ ! ${#1} -eq 8 ] | |
then | |
echo "hash must be 8 characters long" | |
exit $E_BADARGS | |
fi | |
for i in `otool -L /opt/local/bin/rustc | grep x86_64 | awk '{print $1}'` | |
do | |
install_name_tool -change $i /opt/local/lib/`basename $i` /opt/local/bin/rustc | |
done | |
for i in `otool -L /opt/local/bin/rustdoc | grep x86_64 | awk '{print $1}'` | |
do | |
install_name_tool -change $i /opt/local/lib/`basename $i` /opt/local/bin/rustdoc | |
done | |
for rlib in `ls /opt/local/lib/*$1*` | |
do | |
for i in `otool -L $rlib | grep x86_64 | awk '{print $1}'` | |
do | |
install_name_tool -change $i /opt/local/lib/`basename $i` $rlib | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment