-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconfigure.sh
More file actions
executable file
·79 lines (64 loc) · 2.31 KB
/
configure.sh
File metadata and controls
executable file
·79 lines (64 loc) · 2.31 KB
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
76
77
78
79
#!/bin/bash
PYTHON_VERSION=${1:-3.4}
# system package requirements:
# - dev-lang/python (appropriate version)
# - dev-python/virtualenv
fatal() {
message="$1";
echo "ERROR: $message"
exit 1
}
[[ ! -x /usr/bin/python${PYTHON_VERSION} ]] && fatal "Please install python${PYTHON_VERSION} or use ./configure.sh PYTHON_VERSION"
[[ ! -x /usr/bin/Xvfb ]] && fatal 'Please install xvfb (ubuntu) or xorg-x11-server-Xvfb (centos)'
# setup python modules
[[ ! -x /usr/bin/virtualenv ]] && fatal 'Please install python-virtualenv'
if [[ ! -d .virtualenv ]]
then
virtualenv --python=python${PYTHON_VERSION} .virtualenv || fatal 'Failed to create virtualenv'
fi
if [[ ! -h python_modules ]]
then
ln -s .virtualenv/lib/python${PYTHON_VERSION}/site-packages python_modules || fatal 'Failed to create symlink "python_modules"'
fi
[[ ! -r .virtualenv/bin/activate ]] && fatal 'Cannot activate virtualenv'
if [[ -r .virtualenv/bin/activate ]]
then
. .virtualenv/bin/activate
fi
pip install --upgrade pip || fatal 'Cannot upgrade pip'
if [[ ! -h python_modules/PyQt4 ]]
then
if [[ -d /usr/lib/python${PYTHON_VERSION}/site-packages/PyQt4 ]]
then
[[ ! -r /usr/lib/python${PYTHON_VERSION}/site-packages/PyQt4/QtWebKit.so ]] && fatal 'Please install PyQt4-webkit'
ln -s /usr/lib/python${PYTHON_VERSION}/site-packages/PyQt4 python_modules/
else
if [[ -d /usr/lib64/python${PYTHON_VERSION}/site-packages/PyQt4 ]]
then
[[ ! -r /usr/lib64/python${PYTHON_VERSION}/site-packages/PyQt4/QtWebKit.so ]] && fatal 'Please install PyQt4-webkit'
ln -s /usr/lib64/python${PYTHON_VERSION}/site-packages/PyQt4 python_modules/
else
fatal 'Please install PyQt4'
fi
fi
fi
if [[ ! -h python_modules/sip.so ]]
then
if [[ -r /usr/lib/python${PYTHON_VERSION}/site-packages/sip.so ]]
then
ln -s /usr/lib/python${PYTHON_VERSION}/site-packages/sip* python_modules/
else
if [[ -r /usr/lib64/python${PYTHON_VERSION}/site-packages/sip.so ]]
then
ln -s /usr/lib64/python${PYTHON_VERSION}/site-packages/sip* python_modules/
else
fatal 'Please install python-sip'
fi
fi
fi
if [[ "$PYTHON_VERSION" == '2.6' ]]
then
pip install --upgrade simplejson
fi
pip install --upgrade pyvirtualdisplay
echo 'Done.'