2018-10-17 21:43:02 +00:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
PREFIX=/usr/local
|
|
|
|
INSTALL_TEMPORARY_FOLDER=/tmp/mas-cli.dst
|
2018-10-17 23:18:55 +00:00
|
|
|
FRAMEWORK_NAME=MasKit.framework
|
|
|
|
BINARY_NAME=mas
|
2018-10-17 21:43:02 +00:00
|
|
|
|
2018-10-17 22:48:35 +00:00
|
|
|
# Override default prefix path with optional 1st arg
|
2018-10-17 22:18:30 +00:00
|
|
|
if test -n "$1"; then
|
|
|
|
PREFIX="$1"
|
|
|
|
fi
|
|
|
|
|
2018-10-17 21:43:02 +00:00
|
|
|
echo "==> 📲 Installing mas to $PREFIX"
|
|
|
|
|
|
|
|
xcodebuild install
|
|
|
|
|
2018-10-17 22:48:35 +00:00
|
|
|
ditto -v \
|
|
|
|
"$INSTALL_TEMPORARY_FOLDER/Frameworks" \
|
|
|
|
"$PREFIX/Frameworks"
|
2018-10-17 21:43:02 +00:00
|
|
|
|
2018-10-17 22:48:35 +00:00
|
|
|
ditto -v \
|
|
|
|
"$INSTALL_TEMPORARY_FOLDER/bin" \
|
|
|
|
"$PREFIX/bin"
|
2018-10-17 23:18:55 +00:00
|
|
|
|
|
|
|
echo "==> 🔗 Update dylib load paths"
|
|
|
|
|
|
|
|
install_name_tool \
|
|
|
|
-rpath \
|
|
|
|
"/usr/local/Frameworks" \
|
|
|
|
"@executable_path/../Frameworks" \
|
|
|
|
"$PREFIX/bin/$BINARY_NAME"
|
|
|
|
|
|
|
|
install_name_tool \
|
|
|
|
-rpath \
|
|
|
|
"/usr/local/Frameworks/$FRAMEWORK_NAME/Versions/Current/Frameworks" \
|
|
|
|
"@executable_path/../Frameworks/$FRAMEWORK_NAME/Versions/Current/Frameworks" \
|
|
|
|
"$PREFIX/bin/$BINARY_NAME"
|