summaryrefslogtreecommitdiff
path: root/deploy-osx.sh
diff options
context:
space:
mode:
Diffstat (limited to 'deploy-osx.sh')
-rwxr-xr-xdeploy-osx.sh20
1 files changed, 17 insertions, 3 deletions
diff --git a/deploy-osx.sh b/deploy-osx.sh
index 98043c0..dd9efcd 100755
--- a/deploy-osx.sh
+++ b/deploy-osx.sh
@@ -4,10 +4,24 @@
# 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
-install_name_tool -id "@executable_path/../Frameworks/libpoppler.83.dylib" libpoppler.83.dylib
-install_name_tool -change /usr/local/Cellar/poppler/0.72.0/lib/libpoppler.83.dylib "@executable_path/../Frameworks/libpoppler.83.dylib" libpoppler-qt5.1.dylib
+
+POPPLER_QT=`ls libpoppler-qt*`
+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"
+
+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 ../../..
# create DMG