@@ -39,52 +39,58 @@ do
3939 shift
4040done
4141
42−install_dependencies() {
42+install_utils() {
43+ echo "Installing build utilities.."
44+ sudo apt-get install devscripts equivs || exit 4
45+}
46+
47+mk_build_deps() {
4348 echo "Installing build dependencies.."
44− sudo apt-get build-dep -y libunity unity || exit 4
45− sudo apt-get install -y libgtest-dev gnome-common libfolks-dev libtelepathy-glib-dev || exit 5
46− # HUD dependencies
47− sudo apt-get install -y bamfdaemon debhelper dh-autoreconf gir1.2-dee-1.0 gnome-common gnome-doc-utils gobject-introspection gtk-doc-tools indicator-application indicator-appmenu indicator-appmenu-tools intltool libappindicator3-dev libbamf3-dev libdbusmenu-glib-dev libdbusmenu-gtk3-dev libdbusmenu-jsonloader-dev libdbustest1-dev libdee-dev libgirepository1.0-dev libgtk-3-dev libncurses5-dev libreadline-dev libsqlite3-dev metacity sqlite3 valac-0.18 libpocketsphinx-dev libsphinxbase-dev || exit 6
49+ cd $TARGET_DIR
50+ sudo mk-build-deps -B -i $TARGET_DIR/libunity/debian/control || exit 5
51+ sudo mk-build-deps -B -i $TARGET_DIR/unity/debian/control || exit 6
52+ sudo mk-build-deps -B -i $TARGET_DIR/people_lens/debian/control || exit 7
53+ sudo mk-build-deps -B -i $TARGET_DIR/hud/debian/control || exit 8
4854}
4955
5056branch_libunity() {
5157 echo "Branching libunity.."
52− bzr branch lp:libunity/phablet $TARGET_DIR/libunity
58+ bzr branch lp:libunity/phablet $TARGET_DIR/libunity || exit 9
5359}
5460
5561branch_unity() {
5662 echo "Branching Unity.."
57− bzr branch lp:unity/phablet-mods $TARGET_DIR/unity
63+ bzr branch lp:unity/phablet-mods $TARGET_DIR/unity || exit 10
5864}
5965
6066branch_people_lens() {
6167 echo "Branching people lens.."
62− bzr branch lp:unity-lens-people $TARGET_DIR/people_lens
68+ bzr branch lp:unity-lens-people $TARGET_DIR/people_lens || exit 11
6369}
6470
6571branch_hud() {
6672 echo "Branching hud.."
67− bzr branch lp:hud $TARGET_DIR/hud
73+ bzr branch lp:hud $TARGET_DIR/hud || exit 12
6874}
6975
7076update_unity() {
7177 echo "Updating Unity.."
72− bzr pull -d $TARGET_DIR/unity
78+ bzr pull -d $TARGET_DIR/unity || exit 13
7379}
7480
7581update_libunity() {
7682 echo "Updating libunity.."
77− bzr pull -d $TARGET_DIR/libunity
83+ bzr pull -d $TARGET_DIR/libunity || exit 14
7884}
7985
8086update_people_lens() {
8187 echo "Updating people lens.."
82− bzr pull -d $TARGET_DIR/people_lens
88+ bzr pull -d $TARGET_DIR/people_lens || exit 15
8389}
8490
8591update_hud() {
8692 echo "Updating hud"
87− bzr pull -d $TARGET_DIR/hud
93+ bzr pull -d $TARGET_DIR/hud || exit 16
8894}
8995
9096compile_libunity() {
@@ -93,12 +99,12 @@ compile_libunity() {
9399 if $CLEAN; then bzr clean-tree -d $TARGET_DIR/libunity --quiet --unknown --ignored --force; fi
94100
95101 cd $TARGET_DIR/libunity
96− bzr revert --quiet -r $LIBUNITY_REV || exit 8
102+ bzr revert --quiet -r $LIBUNITY_REV || exit 17
97103
98− ./autogen.sh --prefix $BUILD_DIR --disable-debug
104+ ./autogen.sh --prefix $BUILD_DIR --disable-debug || exit 18
99105
100106 echo "Building libunity and installing in " $BUILD_DIR
101− make -j$NUM_JOBS install
107+ make -j$NUM_JOBS install || exit 19
102108
103109}
104110
@@ -108,17 +114,16 @@ compile_unity_core() {
108114 if $CLEAN; then bzr clean-tree -d $TARGET_DIR/unity --quiet --unknown --ignored --force; fi
109115
110116 cd $TARGET_DIR/unity
111− bzr revert --quiet -r $UNITY_REV || exit 9
117+ bzr revert --quiet -r $UNITY_REV || exit 20
112118
113119 mkdir $TARGET_DIR/unity/build
114120 cd $TARGET_DIR/unity/build
115121
116− PKG_CONFIG_PATH=$BUILD_DIR/lib/pkgconfig:$PKG_CONFIG_PATH cmake $TARGET_DIR/unity -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$BUILD_DIR -DCOMPIZ_PLUGIN_INSTALL_TYPE=local -DGSETTINGS_LOCALINSTALL=ON
122+ PKG_CONFIG_PATH=$BUILD_DIR/lib/pkgconfig:$PKG_CONFIG_PATH cmake $TARGET_DIR/unity -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$BUILD_DIR -DCOMPIZ_PLUGIN_INSTALL_TYPE=local -DGSETTINGS_LOCALINSTALL=ON || exit 21
117123
118124 echo "Building UnityCore and installing in " $BUILD_DIR
119125 cd UnityCore
120− make -j$NUM_JOBS
121− make install
126+ make -j$NUM_JOBS install || exit 21
122127
123128}
124129
@@ -128,12 +133,12 @@ compile_people_lens() {
128133 if $CLEAN; then bzr clean-tree -d $TARGET_DIR/people_lens --quiet --unknown --ignored --force; fi
129134
130135 cd $TARGET_DIR/people_lens
131− bzr revert --quiet -r $PEOPLE_LENS_REV || exit 10
136+ bzr revert --quiet -r $PEOPLE_LENS_REV || exit 22
132137
133− PKG_CONFIG_PATH=$BUILD_DIR/lib/pkgconfig:$PKG_CONFIG_PATH ./autogen.sh --prefix $BUILD_DIR --enable-localinstall
138+ PKG_CONFIG_PATH=$BUILD_DIR/lib/pkgconfig:$PKG_CONFIG_PATH ./autogen.sh --prefix $BUILD_DIR --enable-localinstall || exit 23
134139
135140 echo "Building people lens and installing in " $BUILD_DIR
136− MAINTAINER_VALAFLAGS="--vapidir=${BUILD_DIR}/share/vala/vapi" make -j$NUM_JOBS install
141+ MAINTAINER_VALAFLAGS="--vapidir=${BUILD_DIR}/share/vala/vapi" make -j$NUM_JOBS install || exit 24
137142
138143}
139144
@@ -143,15 +148,15 @@ compile_hud() {
143148 if $CLEAN; then bzr clean-tree -d $TARGET_DIR/hud --quiet --unknown --ignored --force; fi
144149
145150 cd $TARGET_DIR/hud
146− bzr revert -r $HUD_REV || exit 11
151+ bzr revert -r $HUD_REV || exit 25
147152
148153 mkdir $TARGET_DIR/hud/build
149154 cd $TARGET_DIR/hud/build
150155
151− cmake $TARGET_DIR/hud/ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$BUILD_DIR -DCMAKE_INSTALL_LIBDIR=lib -DLOCAL_INSTALL=ON -DENABLE_TESTS=OFF
156+ cmake $TARGET_DIR/hud/ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$BUILD_DIR -DCMAKE_INSTALL_LIBDIR=lib -DLOCAL_INSTALL=ON -DENABLE_TESTS=OFF || exit 26
152157
153158 echo "Building hud and installing in " $BUILD_DIR
154− make install
159+ make install || exit 27
155160
156161}
157162
@@ -165,17 +170,19 @@ link_lenses() {
165170
166171if $SETUP; then
167172 echo "Setting up environment for building Unity.."
168− install_dependencies
173+ install_utils
169174 mkdir -p $TARGET_DIR
170175 branch_libunity
171176 branch_unity
172177 branch_people_lens
173178 branch_hud
179+ mk_build_deps
174180elif $UPDATE; then
175181 update_libunity
176182 update_unity
177183 update_people_lens
178184 update_hud
185+ mk_build_deps
179186else
180187 if $CLEAN; then rm -Rf $BUILD_DIR; fi
181188 mkdir -p $BUILD_DIR