Skip to content
Snippets Groups Projects
Verified Commit 28c1f440 authored by Mohcine Chraibi's avatar Mohcine Chraibi
Browse files

WIP: update deploy scripts

parent 1b90e21c
No related tags found
No related merge requests found
Pipeline #18896 failed
......@@ -31,7 +31,7 @@ echo "INFO: make .."
make -j4
echo "INFO: running <dylibbundler -od -b -x ../bin/${CMD}.app/Contents/MacOS/${CMD} -d ../bin/${CMD}.app/Contents/libs/>"
# echo "INFO: running <dylibbundler -od -b -x ../bin/${CMD}.app/Contents/MacOS/${CMD} -d ../bin/${CMD}.app/Contents/libs/>"
dylibbundler -od -b -x ../bin/${CMD}.app/Contents/MacOS/${CMD} -d ../bin/${CMD}.app/Contents/libs/
......@@ -51,8 +51,15 @@ if [[ -n $isPythonDependencyGlobal ]];then
Frameworks=`echo ${Python} | awk -F Frameworks '{ print "Frameworks"$2 }'`
echo "WARNING: ${RED} change <$Python> to <@executable_path/../$Frameworks> ${CMD} ${NC}."
echo "cp `dirname ${Python}`"
echo "in ../bin/jpsvis.app/Contents/${Framworks}"
destination=`echo ${p} | awk -F Frameworks '{ print $1"Frameworks" }'`
# todo: this python stuff is hard coded yet!
mkdir -p ../bin/jpsvis.app/Contents/Frameworks/Python.framework/Versions
cp -r `dirname ${Python}` ../bin/jpsvis.app/Contents/Frameworks/Python.framework/Versions
install_name_tool -change $Python @executable_path/../$Frameworks ../bin/${CMD}.app/Contents/MacOS/${CMD}
install_name_tool -change $Python @executable_path/../Frameworks/Python.framework/Versions/3.7/Python ../bin/${CMD}.app/Contents/MacOS/${CMD}
echo "INFO: Check again"
otool -L ../bin/${CMD}.app/Contents/MacOS/${CMD} | grep Python.framework
......@@ -65,4 +72,9 @@ cd ..
# check if dependencies to libs are local to .app
python checkDependencies.py bin/jpsvis.app/
# qt dependencies
python fixQtdependency.py
# because of https://github.com/auriamg/macdylibbundler/issues/12
appdmg Resources/dmg.json ${CMD}-${VERSION}.dmg
import glob
import subprocess
import shlex
import os
import sys
from shutil import copyfile
RED = '\033[0;31m'
NC = '\033[0m' # No Color
executable = "bin/jpsvis.app/Contents/MacOS/jpsvis"
cmd = "otool -L %s"%executable
f = open("blah.txt", "w")
res = subprocess.call(shlex.split(cmd), stdout=f)
f.close()
f = open("blah.txt", "r")
lines = f.readlines()
for line in lines:
if line.find("Qt") > 0 and line.find("vtk") < 0:
old_qt_dep = line.split()[0]
filename = old_qt_dep.split("/")[-1]
new_qt_dep = "bin/jpsvis.app/Contents/libs/%s"%filename
if not os.path.exists(new_qt_dep):
copyfile(old_qt_dep, new_qt_dep)
change = "install_name_tool -change %s %s %s"%(old_qt_dep, "@executable_path/../libs/%s"%filename, executable)
print("<< old: ", old_qt_dep)
print(">> new: ", "@executable_path/../libs/%s"%filename)
res = subprocess.call(shlex.split(change))
# todo: The copied qt libs should not reference system libs.
# Library not loaded: /usr/local/Cellar/qt/5.12.2/lib/QtCore.framework/Versions/5/QtCore
# Referenced from: /Applications/jpsvis.app/Contents/libs/QtNetwork
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment