|
1 | 1 | #!/bin/bash |
| 2 | +########################################################################################## |
| 3 | +# |
| 4 | +# |
| 5 | +########################################################################################## |
| 6 | +export OCCT_VERSION=7.2.0 |
| 7 | +export OCCT_PACKAGE=occt-${OCCT_VERSION} |
| 8 | +if [ `uname` == "Darwin" ];then |
| 9 | +export OCCT_TARFILE=${OCCT_PACKAGE}-osx.tgz |
| 10 | +else |
| 11 | +export OCCT_TARFILE=${OCCT_PACKAGE}-linux.tgz |
| 12 | +fi |
| 13 | +export OCCT_TARFILE_URL="https://github.com/OpenWebCAD/occt_builder/releases/download/${OCCT_VERSION}/${OCCT_TARFILE}" |
2 | 14 |
|
3 | | -# This is a temporary file for Travis builds. |
4 | | -# Once Travis is correctly set up for this project, this file |
5 | | -# will be removed. |
6 | | -./build.sh |
| 15 | +echo " OCCT_TARFILE = " ${OCCT_TARFILE} |
| 16 | +echo " OCCT_TARFILE_URL = " ${OCCT_TARFILE_URL} |
| 17 | + |
| 18 | +echo "-------------------------- OCCT TAR FILE ${OCCT_TARFILE}" |
| 19 | +ls ${OCCT_TARFILE} |
| 20 | +if [ ! -f "${OCCT_TARFILE}" ]; then |
| 21 | + wget -q ${OCCT_TARFILE_URL} |
| 22 | +fi |
| 23 | +if [ ! -d "${OCCT_PACKAGE}" ]; then |
| 24 | + echo "extracting package ${OCCT_TARFILE}" |
| 25 | + tar -xf ${OCCT_TARFILE} |
| 26 | +fi |
| 27 | + |
| 28 | +export LD_LIBRARY_PATH=`pwd`/${OCCT_PACKAGE}/lib:$LD_LIBRARY_PATH |
| 29 | + |
| 30 | +export VERSION_FILE=`pwd`/${OCCT_PACKAGE}/include/opencascade/Standard_Version.hxx |
| 31 | +grep -i "#define OCC_VERSION_COMPLETE" ${VERSION_FILE} ; |
| 32 | +lscpu ; |
| 33 | +cmake --version ; |
| 34 | + |
| 35 | +#set NPROC=`nproc` |
| 36 | +# on linux: |
| 37 | +# NPROC=$(grep "^core id" /proc/cpuinfo | sort -u | wc -l) |
| 38 | +# on MacOS |
| 39 | +# NPROC=$(sysctl -n hw.ncpu) |
| 40 | +# on both |
| 41 | +NPROC=$(node -p "os.cpus().length") |
| 42 | + |
| 43 | +echo "Number of processors =" ${NPROC} |
| 44 | + |
| 45 | + |
| 46 | +PATH=$PATH:`pwd`/node_modules/.bin |
| 47 | +uname -a |
| 48 | +echo "NODE PATH = `which node`" |
| 49 | +echo "NODE VERSION = `node --version`" |
| 50 | +echo "NODE = `node -p 'process.platform + "@" + process.arch'`" |
| 51 | +echo "NPM VERSION = `npm --version`" |
| 52 | + |
| 53 | + |
| 54 | +# figure out if we should publish |
| 55 | +PUBLISH_BINARY=false |
| 56 | + |
| 57 | +# if we are building a tag then publish |
| 58 | +echo $TRAVIS_BRANCH |
| 59 | +export CURRENT BRANCH=`git describe --tags --always HEAD` |
| 60 | +echo "CURRENT BRANCH = $CURRENT_BRANCH" |
| 61 | +if [[ "$TRAVIS_BRANCH" == "$CURRENT_BRANCH" ]]; then PUBLISH_BINARY=true; fi; |
| 62 | + |
| 63 | + |
| 64 | +echo "Publishing native platform Binary Package? ->" $PUBLISH_BINARY |
| 65 | + |
| 66 | +# Cleanup the output of npm |
| 67 | +npm config set progress false |
| 68 | +npm config set spin false |
| 69 | + |
| 70 | +if [[ ! -z $TRAVIS_ELECTRON_VERSION ]]; then |
| 71 | + if [[ $TRAVIS_OS_NAME == "linux" ]]; then |
| 72 | + export DISPLAY=:99.0 |
| 73 | + sh -e /etc/init.d/xvfb start |
| 74 | + fi |
| 75 | + export npm_config_target=$TRAVIS_ELECTRON_VERSION |
| 76 | + export npm_config_arch=$ARCH |
| 77 | + export npm_config_disturl=https://atom.io/download/atom-shell |
| 78 | + export npm_config_runtime=electron |
| 79 | + npm install --arch=$ARCH electron@$TRAVIS_ELECTRON_VERSION |
| 80 | + npm install electron-mocha |
| 81 | + echo "installed Electron $TRAVIS_ELECTRON_VERSION" |
| 82 | +fi |
| 83 | + |
| 84 | +# git submodule update --depth 50 --init --recursive |
| 85 | +npm install --build-from-source |
0 commit comments