1
1
#! /usr/bin/env bash
2
-
2
+ #
3
3
# The script help you set up your develop envirnment
4
+ #
5
+ # --fast: fast mode will skip OS pacakge dependency, only install git hooks and Rust
6
+ #
7
+
8
+ if [[ " $1 " != " --fast" ]]; then
9
+ if [[ " $OSTYPE " == " linux-gnu" ]]; then
10
+ set -e
11
+ if [ -f /etc/redhat-release ]; then
12
+ echo " Redhat Linux detected, but current not support sorry."
13
+ echo " Contribution is always welcome."
14
+ exit 1
15
+ elif [ -f /etc/SuSE-release ]; then
16
+ echo " Suse Linux detected, but current not support sorry."
17
+ echo " Contribution is always welcome."
18
+ exit 1
19
+ elif [ -f /etc/arch-release ]; then
20
+ echo " Arch Linux detected."
21
+ sudo pacman -Syu --needed --noconfirm cmake gcc openssl-1.0 clang llvm rocksdb curl
22
+ export OPENSSL_LIB_DIR=" /usr/lib/openssl-1.0" ;
23
+ export OPENSSL_INCLUDE_DIR=" /usr/include/openssl-1.0"
24
+ elif [ -f /etc/mandrake-release ]; then
25
+ echo " Mandrake Linux detected, but current not support sorry."
26
+ echo " Contribution is always welcome."
27
+ exit 1
28
+ elif [ -f /etc/debian_version ]; then
29
+ echo " Ubuntu/Debian Linux detected."
30
+ sudo apt-get -y update
31
+ sudo apt-get install -y cmake pkg-config libssl-dev
32
+ else
33
+ echo " Unknown Linux distribution."
34
+ echo " Contribution is always welcome."
35
+ exit 1
36
+ fi
37
+ elif [[ " $OSTYPE " == " darwin" * ]]; then
38
+ set -e
39
+ echo " Mac OS (Darwin) detected."
40
+ if ! which brew > /dev/null 2>&1 ; then
41
+ /usr/bin/ruby -e " $( curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install) "
42
+ fi
43
+ brew upgrade
44
+ brew install openssl cmake llvm
45
+ elif [[ " $OSTYPE " == " freebsd" * ]]; then
46
+ echo " FreeBSD detected, but current not support sorry."
47
+ echo " Contribution is always welcome."
48
+ exit 1
49
+ else
50
+ echo " Unknown operating system."
51
+ echo " Contribution is always welcome."
52
+ exit 1
53
+ fi
54
+ fi
4
55
5
56
# Setup git hooks
6
57
cp .hooks/* .git/hooks
@@ -13,7 +64,3 @@ rustup target add wasm32-unknown-unknown
13
64
14
65
# Install rustfmt for coding style checking
15
66
rustup component add rustfmt --toolchain nightly
16
-
17
- # TODO: help other developers with different platform
18
- sudo apt-get -y update
19
- sudo apt-get install -y cmake pkg-config libssl-dev
0 commit comments