Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • jupedsim/jpsvis
1 result
Select Git revision
Show changes
Commits on Source (5)
variables:
nproc: "1"
before_script:
- nproc=`grep -c '^processor' /proc/cpuinfo`
- echo "nproc = $nproc"
#========== Pipeline ==================
stages:
- configure
- compile
#=====================================
#============== configure ============
configure-linux:
artifacts:
name: "${CI_BUILD_NAME}_${CI_BUILD_ID}"
expire_in: 1 hour
paths:
- build
- lib
- lib/Debug
- bin
script:
- mkdir -p build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=g++-8 ..
- echo "configure | ${CI_PROJECT_DIR}"
stage: configure
tags:
- linux
#============== compile ============
make-linux:
dependencies:
- configure-linux
artifacts:
name: "${CI_BUILD_NAME}_${CI_BUILD_ID}"
expire_in: 1 hour # optional expiry
paths:
- build
- bin
- lib
- lib/Debug
stage: compile
script:
- cd build
- make -j$nproc
- echo "compile | ${CI_PROJECT_DIR}"
tags:
- linux
after_script:
- echo "End CI" # todo: run report script
Resources/back.png

60.2 KiB

# 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,13 +37,13 @@ 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()
if os.path.exists ("blah.txt"):
os.remove("blah.txt")
if os.path.exists("blah.txt"):
os.remove("blah.txt")
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
rm -rf build/*
else
echo "INFO: mkdir build"
mkdir build
fi
......@@ -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/
......@@ -45,14 +45,21 @@ if [[ -n $isPythonDependencyGlobal ]];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}."
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
......@@ -61,7 +68,13 @@ if [[ -n $isPythonDependencyGlobal ]];then
fi
fi
cd ..
# check if dependencies to libs are local to .app
python checkDependencies.py
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}-0.8.1.dmg
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