-
Notifications
You must be signed in to change notification settings - Fork 108
/
setup.sh
executable file
·40 lines (34 loc) · 1.06 KB
/
setup.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
#!/bin/bash
set -e
UNAME="$(uname)"
PLATFORM="$(uname -m)"
if [[ $UNAME == "Darwin" ]]; then
echo "MacOS detected..."
which cmake || brew install cmake
which protoc || brew install protobuf
which openssl || brew install openssl
elif [[ $UNAME == "Linux" ]]; then
echo "Linux detected..."
which cmake || sudo apt-get install --yes build-essential cmake
which protoc || sudo apt-get install --yes protobuf-compiler
which openssl || sudo apt-get install --yes libssl-dev
else
echo "Unsupported OS; please install rust, cmake, protobuf, maturin and openssl manually!"
exit 1
fi
which cargo || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
if [[ $PLATFORM == "x86_64" ]]; then
echo "x86_64 detected..."
which maturin || pip install maturin[patchelf]
fi
if [[ $PLATFORM = "aarch64" ]]; then
echo "aarch64 detected..."
which maturin || pip install maturin
fi
if [[ $PLATFORM = arm* ]]; then
echo "arm detected..."
which maturin || pip install maturin
else
echo "Unsupported platform; please install maturin manually"
exit 0
fi