forked from Red5d/mycroft-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-pygtk.sh
executable file
·77 lines (69 loc) · 2.21 KB
/
install-pygtk.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
76
77
# Ensure we're in a virtualenv.
if [ "$VIRTUAL_ENV" == "" ]
then
echo "ERROR: not in a virtual environment."
exit -1
fi
# Setup variables.
CACHE="/tmp/install-pygtk-$$"
# Make temp directory.
mkdir -p $CACHE
# Test for py2cairo.
echo -e "\E[1m * Checking for cairo...\E[0m"
python -c "
try: import cairo; raise SystemExit(0)
except ImportError: raise SystemExit(-1)"
if [ $? == 255 ]
then
echo -e "\E[1m * Installing cairo...\E[0m"
# Fetch, build, and install py2cairo.
( cd $CACHE
wget 'http://cairographics.org/releases/py2cairo-1.10.0.tar.bz2' -O py2cairo.tar.bz2 #> "py2cairo.tar.bz2"
tar -xvf py2cairo.tar.bz2
( cd py2cairo*
autoreconf -ivf
./configure --prefix=$VIRTUAL_ENV --disable-dependency-tracking
make
make install
)
)
fi
# Test for gobject.
echo -e "\E[1m * Checking for gobject...\E[0m"
python -c "
try: import gobject; raise SystemExit(0)
except ImportError: raise SystemExit(-1)"
if [ $? == 255 ]
then
echo -e "\E[1m * Installing gobject...\E[0m"
# Fetch, build, and install gobject.
( cd $CACHE
curl 'http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/pygobject-2.28.6.tar.bz2' > 'pygobject.tar.bz2'
tar -xvf pygobject.tar.bz2
( cd pygobject*
./configure --prefix=$VIRTUAL_ENV --disable-introspection
make
make install
)
)
fi
# Test for gtk.
echo -e "\E[1m * Checking for gtk...\E[0m"
python -c "
try: import gtk; raise SystemExit(0)
except ImportError: raise SystemExit(-1)" 2&> /dev/null
if [ $? == 255 ]
then
echo -e "\E[1m * Installing gtk...\E[0m"
# Fetch, build, and install gtk.
( cd $CACHE
#curl 'https://pypi.python.org/packages/source/P/PyGTK/pygtk-2.24.0.tar.bz2' > 'pygtk.tar.bz2'
wget "https://pypi.python.org/packages/7c/18/fa4f2de77500dd62a314fd845ff6e903ac2ce551164cb421c5750969f799/pygtk-2.24.0.tar.bz2#md5=a1051d5794fd7696d3c1af6422d17a49" -O pygtk.tar.bz2
tar -xvf pygtk.tar.bz2
( cd pygtk*
./configure --prefix=$VIRTUAL_ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$VIRTUAL_ENV/lib/pkgconfig
make
make install
)
)
fi