summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleks Kissinger <aleks0@gmail.com>2019-01-12 03:57:39 -0800
committerAleks Kissinger <aleks0@gmail.com>2019-01-12 03:57:39 -0800
commit8fe8ff000d48460583f542b932d8af3e3d3ae008 (patch)
tree7cab94dba19611f8aceb49c41f189a1744eaff3b
parent3be7391da3eefe45b8982ebee4acdc0e3bc8ff02 (diff)
fixed bug in sed commands
-rwxr-xr-xdeploy-osx.sh17
1 files changed, 11 insertions, 6 deletions
diff --git a/deploy-osx.sh b/deploy-osx.sh
index 0be5aa3..dd9efcd 100755
--- a/deploy-osx.sh
+++ b/deploy-osx.sh
@@ -4,18 +4,23 @@
# copy in libraries and set (most) library paths
macdeployqt tikzit.app
-# macdeployqt misses this path for some reason, so fix it
+# macdeployqt doesn't fix the path to libpoppler for some reason, so we do it by hand
cd tikzit.app/Contents/Frameworks
POPPLER_QT=`ls libpoppler-qt*`
-POPPLER_PATH=`otool -L $POPPLER_QT | sed -e 's!.*\(/usr.*\(libpoppler\..*dylib\)\).*!\1!p'`
-POPPLER_LIB=`otool -L $POPPLER_QT | sed -e 's!.*\(/usr.*\(libpoppler\..*dylib\)\).*!\2!p'`
+POPPLER_PATH=`otool -L $POPPLER_QT | sed -n 's!.*\(/usr.*\(libpoppler\..*dylib\)\).*!\1!p'`
+POPPLER_LIB=`otool -L $POPPLER_QT | sed -n 's!.*\(/usr.*\(libpoppler\..*dylib\)\).*!\2!p'`
echo "Found $POPPLER_QT and $POPPLER_LIB"
-echo "Replacing $POPPLER_PATH with relative path..."
-install_name_tool -id "@executable_path/../Frameworks/$POPPLER_LIB" $POPPLER_LIB
-install_name_tool -change $POPPLER_PATH "@executable_path/../Frameworks/$POPPLER_LIB" $POPPLER_QT
+if [ "$POPPLER_PATH" != "" ]; then
+ echo "Replacing $POPPLER_PATH with relative path..."
+ install_name_tool -id "@executable_path/../Frameworks/$POPPLER_LIB" $POPPLER_LIB
+ install_name_tool -change $POPPLER_PATH "@executable_path/../Frameworks/$POPPLER_LIB" $POPPLER_QT
+else
+ echo "Poppler already has relative path, so nothing to do."
+fi
+
cd ../../..