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

update deplot script

parent 1838f1fa
No related branches found
No related tags found
No related merge requests found
# some vtk libs depend on python.
# correct this dependency and make it point to local python.
import glob2
import glob
import subprocess
import shlex
import os
......@@ -16,13 +16,14 @@ PATH = sys.argv[1] + "/Contents/Frameworks"
CMD = "jpsvis"
# PATH = "./bin/%s.app/Contents/Frameworks" % CMD
# PATH = "/Volumes/jpsvis\ 0.7.0/jpsvis.app/Contents/Frameworks/"
dependencies = glob2.glob("%s/**/*.dylib"%PATH)
dependencies = glob.glob("%s/**/*.dylib"%PATH)
print("VTK dependencies: ", len(dependencies))
#VTK_LIBS
for vtklib in dependencies:
print "lib: <%s>" % vtklib
print("lib: <%s>" % vtklib)
cmd = "otool -L %s" % vtklib
f = open("blah.txt", "w")
......@@ -36,11 +37,11 @@ for vtklib in dependencies:
and not line.startswith("/System") \
and not line.startswith("@executable_path"):
print "%s >> <%s> %s" % (RED, line.split()[0], NC)
print("%s >> <%s> %s" %(RED, line.split()[0], NC))
change = "install_name_tool -change %s @executable_path/../Frameworks/Python.framework/Versions/3.5/Python %s"%(line.split()[0], vtklib)
print "<%s>" % change
print("<%s>" % change)
res = subprocess.call(shlex.split(change))
raw_input("pause ...")
input("pause ...")
f.close()
......
RED='\033[0;31m'
NC='\033[0m' # No Color
CMD="jpsvis"
VERSION=0.8.4
if [ -d build ];then
echo "INFO: found build directory"
echo "INFO:${RED} rm build ${NC}"
rm -rf build
echo "INFO: mkdir build"
mkdir build
fi
echo "INFO: cd build"
cd build
echo "INFO: actual directory: ${PWD}"
if [ -d ../bin ]; then
echo "INFO: found bin directory"
echo "INFO:${RED} remove ./bin directory ${NC}"
rm -rf ../bin
fi
echo "INFO: cmake .."
cmake ..
echo "INFO: make .."
make -j4
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/
# dylibbundler has a problem linking to local python framework. So this quick fix..
isPythonDependencyGlobal=`otool -L ../bin/${CMD}.app/Contents/MacOS/${CMD} | grep Python.framework`
echo "isPythonDependencyGlobal: <$isPythonDependencyGlobal>"
if [[ -n $isPythonDependencyGlobal ]];then
if [[ ! $isPythonSWDependencyGlobal == *"@executable_path"* ]]; then
#install_name_tool -change /usr/local/opt/python3/Frameworks/Python.framework/Versions/3.5/Python
# @executable_path/../Frameworks/Python.framework/Versions/3.5/Python
# ./bin/jpsvis.app/Contents/MacOS/jpsvis
Python=`echo ${isPythonDependencyGlobal} | xargs | awk '{print $1}'`
echo "WARNING: ${RED} <$Python> is not relative to ${CMD} ${NC}."
Frameworks=`echo ${Python} | awk -F Frameworks '{ print "Frameworks"$2 }'`
echo "WARNING: ${RED} change <$Python> to <@executable_path/../$Frameworks> ${CMD} ${NC}."
install_name_tool -change $Python @executable_path/../$Frameworks ../bin/${CMD}.app/Contents/MacOS/${CMD}
echo "INFO: Check again"
otool -L ../bin/${CMD}.app/Contents/MacOS/${CMD} | grep Python.framework
echo "-----------------"
fi
fi
#cd ..
# check if dependencies to libs are local to .app
python checkDependencies.py
python checkDependencies.py bin/jpsvis.app/
appdmg Resources/dmg.json {CMD}-0.8.1.dmg
appdmg Resources/dmg.json ${CMD}-${VERSION}.dmg
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment