forked from Guake/guake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev.sh
executable file
·112 lines (92 loc) · 2.88 KB
/
dev.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
# This script is used by the main developer to quickly compile and install the current version
# of Guake sources. Nothing say it will work directly on your environment. Use with caution!
NO_INSTALL=true
RUN_TESTS=false
CREATE_ENV=true
EXEC_AUTOGEN=false
EXEC_UPDATE_PO=false
echo "execute guake for developer."
echo "use --test to run tests"
echo "use --install to install guake on your system"
echo "use --no-create-env to disable virtualenv creation"
echo "(beware, gconf schema will be altered)"
echo "use --reinstall to force complete reinstall"
echo "use --uninstall to force complete uninstall"
echo "use --update-po to force update translations"
ARGS=$*
if [[ `echo $ARGS | grep --regexp="--no-create-env"` ]]; then
CREATE_ENV=false
fi
if [[ `echo $ARGS | grep --regexp="--test"` ]]; then
RUN_TESTS=true
fi
if [[ $1 == "--install" ]]; then
NO_INSTALL=false
fi
if [[ $1 == "--uninstall" ]]; then
UNINSTALL=true
fi
if [[ $1 == "--reinstall" ]]; then
EXEC_AUTOGEN=true
fi
if [[ $1 == "--update-po" ]]; then
EXEC_UPDATE_PO=true
fi
if [[ ! -f configure ]]; then
EXEC_AUTOGEN=true
fi
if [[ $EXEC_AUTOGEN == true ]]; then
sudo apt-get install -y build-essential python autoconf
sudo apt-get install -y gnome-common gtk-doc-tools libglib2.0-dev libgtk2.0-dev libgconf2-dev
sudo apt-get install -y python-gtk2 python-gtk2-dev python-vte glade python-glade2
sudo apt-get install -y python-vte python-gconf python-appindicator
sudo apt-get install -y notify-osd libutempter0 glade-gtk2
sudo apt-get install -y python-notify python-xdg python-keybinder
sudo pip install colorlog
if [[ -f Makefile ]]; then
make clean
fi
./autogen.sh
fi
if [[ $UNINSTALL == true ]]; then
sudo make uninstall
if [[ -d env ]]; then
rm -rfv env
fi
exit 1
fi
make || exit 1
if [[ $EXEC_UPDATE_PO == true ]]; then
cd po
make update-po || exit 1
make || exit 1
cd ..
fi
function make_virtualenv {
echo "Trying to prepare a virtualenv"
if [[ ! -d env ]]; then
virtualenv --system-site-packages env
fi
echo "sourcing env" && source env/bin/activate
echo "Installing dev requirements" && pip install --upgrade -r python-requirements.txt
gconftool-2 --install-schema-file=data/guake.schemas
}
# RUN TESTS or RUN GUAKE without installing it
if [[ $NO_INSTALL == true ]]; then
if [[ $CREATE_ENV == true ]]; then
make_virtualenv
fi
echo "sourcing env" && source env/bin/activate
if [[ $RUN_TESTS == true ]]; then
echo "running tests.."
./run_tests.sh
else
echo "Launching guake inside virtualenv"
PYTHONPATH=src python2.7 src/guake/main.py --no-startup-script
fi
else
sudo make install && gconftool-2 --install-schema-file=/usr/local/etc/gconf/schemas/guake.schemas || exit 1
guake --quit 2> /dev/null
guake --no-startup-script
fi