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