-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_deps.sh
executable file
·67 lines (49 loc) · 1.45 KB
/
build_deps.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
#!/usr/bin/env bash
DEPS_LOCATION=_build/deps
if [ -d "$DEPS_LOCATION" ]; then
echo "s2-geometry-library fork already exist. delete $DEPS_LOCATION for a fresh checkout."
exit 0
fi
OS=$(uname -s)
KERNEL=$(echo $(lsb_release -ds 2>/dev/null || cat /etc/*release 2>/dev/null | head -n1 | awk '{print $1;}') | awk '{print $1;}')
##echo $OS
##echo $KERNEL
S2_GEOMETRY_REPO=https://github.com/blueshift-labs/s2-geometry-library.git
S2_GEOMETRY_REV=$1
case $OS in
Linux)
case $KERNEL in
CentOS)
echo "Linux, CentOS"
sudo yum -y install automake cmake gcc-c++ git libtool openssl-devel wget
;;
Ubuntu)
echo "Linux, Ubuntu"
sudo apt-get -y install g++ make cmake libssl-dev
;;
*) echo "Your system $KERNEL is not supported"
esac
;;
Darwin)
brew install cmake openssl
export OPENSSL_ROOT_DIR=$(brew --prefix openssl)
export OPENSSL_INCLUDE_DIR=$OPENSSL_ROOT_DIR/include/
export OPENSSL_LIBRARIES=$OPENSSL_ROOT_DIR/lib
;;
*) echo "Your system $OS is not supported"
esac
mkdir -p $DEPS_LOCATION
#checkout repo
pushd $DEPS_LOCATION
git clone ${S2_GEOMETRY_REPO}
pushd s2-geometry-library
git checkout ${S2_GEOMETRY_REV}
popd
popd
#build
mkdir -p $DEPS_LOCATION/s2-geometry-library/build
pushd $DEPS_LOCATION/s2-geometry-library/build
cmake ../geometry
make -j 3
make install
popd