forked from felixge/node-cross-compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-vm.sh
executable file
·42 lines (34 loc) · 1.08 KB
/
setup-vm.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
#!/bin/bash
set -eu
NODE_VERSION="v0.10.33"
echo "-> Installing apt-get packages"
sudo apt-get -y install \
build-essential \
curl \
git
echo "-> Installing node.js"
if [ ! -d /home/vagrant/node ]; then
curl -O http://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}.tar.gz
tar -zxf node-${NODE_VERSION}.tar.gz
mv node-${NODE_VERSION} node
chown -R vagrant:vagrant node
rm -rf node-${NODE_VERSION}.tar.gz
fi
cd node
echo "-> Installing node-serialport.js"
if [ ! -d /home/vagrant/node-serialport ]; then
git clone https://github.com/voodootikigod/node-serialport.git
fi
cd node-serialport
# Unfortunately we can't put this into our project dir as vboxfs complains
# about hardlinks in the tar : /
echo "-> Installing code sourcer (arm toolchain)"
if [ ! -d /home/vagrant/armtools ]; then
cd ~
tarball="arm-2012.03-57-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2"
curl -OL http://www.codesourcery.com/public/gnu_toolchain/arm-none-linux-gnueabi/${tarball}
tar -xf ${tarball}
mv arm-2012.03 armtools
chown -R vagrant:vagrant armtools
rm -rf ${tarball}
fi