-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall_mac.sh
executable file
·75 lines (67 loc) · 2.15 KB
/
install_mac.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
echo "Usage: sh install_mac.sh [NAME] [EMAIL]"
echo "Please first download clang(http://llvm.org/releases/download.html) into download/mac/, then press any keyboard..."
read temp
echo "[NAME]: $1"
echo "[EMAIL] $2"
echo "Starting Install ..."
PWD=`pwd`
# Mac
## TODO: install anaconda
mkdir download
wget -O download/Anaconda2-4.2.0-MacOSX-x86_64.sh https://repo.continuum.io/archive/Anaconda2-4.2.0-MacOSX-x86_64.sh
bash download/Anaconda2-4.2.0-MacOSX-x86_64.sh
pip install ipdb
## install XQuartz
wget -O download/XQuartz-2.7.11.dmg https://dl.bintray.com/xquartz/downloads/XQuartz-2.7.11.dmg
## bash_profile
if [ ! -f '~/.bash_profile' ]; then
touch ~/.bash_profile
fi
echo "
source $PWD/.bash_profile
" >> ~/.bash_profile
## submodule
git submodule update --init --recursive
## install brew
BREW_BIN=`which brew` && echo "Find brew in $BREW_BIN"
BREW_BIN=`which brew` || /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
function install() {
for bin in $*; do
path=`brew list | grep $bin`
if [ "$path" = "" ]; then
brew install $bin
if [ "$bin" = "macvim" ]; then
brew linkapps macvim
fi
else
echo "$bin already installed."
fi
done
return
}
install git macvim python cmake
# TODO: Check avalibility
brew cask install osxfuse
brew install sshfs
## Setting up git
git config --global user.name "$1"
git config --global user.email "$2"
git config --global credential.helper osxkeychain
## Setting up vim
rm -rf ~/.vim ~/.vimrc
ln -sf $PWD/source/vim-pathogen/autoload .vim/autoload
if [ ! -d '.vim/indent' ]; then
mkdir .vim/indent
fi
ln -sf $PWD/source/google-vim/indent/google.vim .vim/indent/cpp.vim
if [ ! -d '.vim/bundle/YouCompleteMe/third_party/ycmd/clang_archives' ]; then
mkdir .vim/bundle/YouCompleteMe/third_party/ycmd/clang_archives
fi
ln -sf $PWD/download/mac/clang+llvm-3.9.0-x86_64-apple-darwin.tar.xz .vim/bundle/YouCompleteMe/third_party/ycmd/clang_archives/clang+llvm-3.9.0-x86_64-apple-darwin.tar.xz
cd .vim/bundle/YouCompleteMe/
./install.py --clang-completer
cd -
ln -sf $PWD/.vim ~/.vim
ln -sf $PWD/.vimrc ~/.vimrc
## tmux conf
ln -s $PWD/.tmux.conf ~/.tmux.conf