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

add gitlab CI

parent 54f834e3
No related branches found
No related tags found
No related merge requests found
Pipeline #18883 failed
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 ..
- 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
......@@ -4,8 +4,64 @@ 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/*
else
echo "INFO: mkdir build"
mkdir build
fi
#cd ..
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 bin/jpsvis.app/
......
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