forked from makerbot/s3g
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_s3g_env.sh
executable file
·62 lines (48 loc) · 1.61 KB
/
setup_s3g_env.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
#!/bin/bash
PYVERSION=$1
DIST_EGGS=$2
MB_EGGS=$3
ENV_DIR=$4
if [ -z $DIST_EGGS ]; then
DIST_EGGS=`echo $0|sed 's|/.*||'`/python
fi
if [ -z $MB_EGGS ]; then
MB_EGGS=$DIST_EGGS
fi
if [ -z $ENV_DIR ]; then
ENV_DIR=virtualenv
fi
if [ -z $PYVERSION ]
then
PYVERSION=`python -c 'import sys; print ".".join(sys.version.split()[0].split(".")[0:2])'`
echo "python version is $PYVERSION"
else
PYBINVERSION=$PYVERSION
fi
UNAME=`uname`
MAC_DISTUTILS=/System/Library/Frameworks/Python.framework/Versions/$PYVERSION/lib/python$PYVERSION/distutils/__init__.py
if [ "$UNAME" == "Darwin" ]
then
MACVER=`system_profiler SPSoftwareDataType |grep '^ *System Version:' |sed 's/.*OS X //' | sed 's/\(10\.[0-9]\)*.*$/\1/'`
export PATH=$PATH:$BASEDIR//mac/$MACVER
if [ ! -f $MAC_DISTUTILS ]
then
sudo cp mac/$PYVERSION/distutils/__init__.py $MAC_DISTUTILS
fi
fi
if [ ! -d $ENV_DIR ]
then
python$PYBINVERSION virtualenv.py --extra-search-dir=$DIST_EGGS --extra-search-dir=$MB_EGGS --never-download --system-site-packages $ENV_DIR
fi
. $ENV_DIR/bin/activate
echo "Upgrading setuptools"
easy_install -q $DIST_EGGS/setuptools-0.6c11-py$PYVERSION.egg
echo "Installing modules"
easy_install -q $DIST_EGGS/mock-1.0.1-py$PYVERSION.egg
easy_install -q $DIST_EGGS/argparse-1.2.1-py$PYVERSION.egg
easy_install -q $DIST_EGGS/unittest2-0.5.1-py$PYVERSION.egg
easy_install -q $MB_EGGS/pyserial-2.7_mb2.1-py$PYVERSION.egg
pip install -q --use-mirrors coverage doxypy unittest-xml-reporting
if [ -f $MB_EGGS/makerbot_driver-0.1.1-py$PYVERSION.egg ]; then
easy_install -q $MB_EGGS/makerbot_driver-0.1.1-py$PYVERSION.egg
fi