Merge pull request #19 from cyplo/windows_configure

Ability to launch common configure script from Windows as well
This commit is contained in:
Cyryl Płotnicki 2016-08-05 12:56:37 +02:00 committed by GitHub
commit b76255d2c5
5 changed files with 89 additions and 37 deletions

2
.gitattributes vendored
View file

@ -1 +1,3 @@
*.sh -crlf
*.zip filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text

View file

@ -1,4 +1,5 @@
[![Build Status](https://travis-ci.org/cyplo/dotfiles.svg?branch=master)](https://travis-ci.org/cyplo/dotfiles) [![Build Status](https://travis-ci.org/cyplo/dotfiles.svg?branch=master)](https://travis-ci.org/cyplo/dotfiles)
[![Build status](https://ci.appveyor.com/api/projects/status/s6i314lyti4o1ny1/branch/master?svg=true)](https://ci.appveyor.com/project/cyplo/dotfiles/branch/master)
My common dotfiles for Linux, Mac and Cygwin My common dotfiles for Linux, Mac and Cygwin

View file

@ -1,9 +1,16 @@
#!/bin/bash #!/bin/bash
SUDO=""
if [[ -z $NOSUDO ]]; then
SUDO="sudo"
fi
echo "using '$SUDO' as sudo"
set -e set -e
echo echo
echo "configuring settings common among OSes" echo "configuring settings common among OSes"
sudo true $SUDO true
#zsh #zsh
if [[ -z $DONT_CHANGE_SHELL ]]; then if [[ -z $DONT_CHANGE_SHELL ]]; then
@ -13,7 +20,11 @@ fi
CURL="curl -sSf" CURL="curl -sSf"
#submodules if [[ -z $DIR ]]; then
echo "please set DIR"
exit 1
fi
DIR=`realpath $DIR` DIR=`realpath $DIR`
echo "using $DIR as the top level directory" echo "using $DIR as the top level directory"
cd $DIR cd $DIR
@ -46,7 +57,7 @@ source ~/.setenv
# symlink 'nodejs' as node on some systems # symlink 'nodejs' as node on some systems
# will replace symlink if it exists, but won't replace regular file # will replace symlink if it exists, but won't replace regular file
if [[ ! -f /usr/bin/node ]]; then if [[ ! -f /usr/bin/node ]]; then
sudo ln -vfs /usr/bin/nodejs /usr/bin/node $SUDO ln -vfs /usr/bin/nodejs /usr/bin/node
fi fi
# tools # tools
@ -62,36 +73,42 @@ mkdir -p ~/.fonts
cp -rv "$DIR/fonts" ~/.fonts cp -rv "$DIR/fonts" ~/.fonts
set +e set +e
fc-cache -rv fc-cache -rv
sudo fc-cache -rv $SUDO fc-cache -rv
set -e set -e
#rust if [[ -z $NORUST ]]; then
echo "installing rust" #rust
RUSTUP_TEMP="/tmp/blastoff.sh" echo "installing rust"
$CURL https://sh.rustup.rs > "$RUSTUP_TEMP" RUSTUP_TEMP="/tmp/blastoff.sh"
chmod a+x "$RUSTUP_TEMP" $CURL https://sh.rustup.rs > "$RUSTUP_TEMP"
"$RUSTUP_TEMP" -y chmod a+x "$RUSTUP_TEMP"
rm -f "$RUSTUP_TEMP" "$RUSTUP_TEMP" -y
rustup update rm -f "$RUSTUP_TEMP"
rustup default stable rustup update
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib rustup default stable
cd "$DIR/../" export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
echo "getting rust sources..." cd "$DIR/../"
if [[ ! -d rust ]]; then echo "getting rust sources..."
git clone https://github.com/rust-lang/rust.git --recursive if [[ ! -d rust ]]; then
else git clone https://github.com/rust-lang/rust.git --recursive
cd rust else
git pull cd rust
git submodule update --init --recursive git pull
git submodule update --init --recursive
fi
cargo install -f rustfmt
fi fi
cargo install -f rustfmt if [[ -z $NOVIM ]]; then
echo "\n" | vim +PluginInstall +qa
echo "\n" | vim +PluginInstall +qa cd "$DIR/.vim/bundle/YouCompleteMe/"
git submodule update --init --recursive
cd "$DIR/.vim/bundle/YouCompleteMe/" if [[ -z $NORUST ]]; then
git submodule update --init --recursive ./install.py --racer-completer --clang-completer
./install.py --racer-completer --clang-completer else
./install.py --clang-completer
fi
fi
if [[ -z $NO_GO ]]; then if [[ -z $NO_GO ]]; then
export GOPATH="$HOME/go" export GOPATH="$HOME/go"
@ -102,12 +119,12 @@ if [[ -z $NO_GO ]]; then
fi fi
# talks: reveal-md # talks: reveal-md
sudo npm install -g reveal-md $SUDO npm install -g reveal-md
sudo npm install -g diff-so-fancy $SUDO npm install -g diff-so-fancy
# vdir syncer # vdir syncer
echo "installing vdirsyncer" echo "installing vdirsyncer"
sudo pip install vdirsyncer $SUDO pip install vdirsyncer
if [[ -z $USER ]]; then if [[ -z $USER ]]; then
USER=`whoami` USER=`whoami`
@ -115,7 +132,7 @@ fi
# normalize npm permissions # normalize npm permissions
mkdir -p $HOME/.npm mkdir -p $HOME/.npm
sudo chown $USER $HOME/.npm -R $SUDO chown $USER $HOME/.npm -R
echo echo
echo "now go ahead and restart" echo "now go ahead and restart"

17
windows_cygwin/build.bat Normal file → Executable file
View file

@ -1,5 +1,14 @@
choco install -y firefox googlechrome wget @echo on
wget -c https://cygwin.com/setup-x86_64.exe choco install -y firefox googlechrome wget notepadplusplus sublimetext3
REM cygwin installation
setup-x86_64.exe -R "C:\cygwin64" -s http://cygwin.netbet.org/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion
wget -c https://cygwin.com/setup-x86_64.exe
setup-x86_64.exe -R "C:\cygwin64" -s http://cygwin.netbet.org/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang
set script_path=%~dp0
set repo_path=%script_path%\..\
set bash=c:\cygwin64\bin\bash.exe --login -c
for /f "delims=" %%A in ('%bash% "cd `cygpath $HOMEPATH`/dev/dotfiles && git rev-parse --abbrev-ref HEAD"') do set "branch=%%A"
%bash% 'echo "branch is $branch"'
%bash% "cp -vr `cygpath $HOMEPATH`/.ssh $HOME/"
%bash% "export OUTER_CLONE=`cygpath $repo_path` && $script_path/build_insider.sh"

23
windows_cygwin/build_insider.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/bash
DOTFILES_PATH="$HOME/dev/dotfiles"
mkdir -pv $HOME/dev/
rm -fr $DOTFILES_PATH
git clone "$OUTER_CLONE" "$DOTFILES_PATH"
cd "$DOTFILES_PATH"
git remote set-url origin git@github.com:cyplo/dotfiles.git
git checkout $branch
export NOSUDO=true
export DONT_CHANGE_SHELL=true
export NORUST=true
export NOVIM=true
export NO_GO=true
export DIR=$DOTFILES_PATH
curl https://bootstrap.pypa.io/get-pip.py > /tmp/get-pip.py
python /tmp/get-pip.py
$DIR/common/configure_fresh_system