3TARGET_DIR=$PWD/../unity_build
4BUILD_DIR=$TARGET_DIR/build
8NUM_JOBS=$(( `grep -c ^processor /proc/cpuinfo` + 1 ))
9LENSES="applications mockmusic mockvideos"
11# verified working revisions
18 echo "usage: build_unity [OPTIONS]\n"
19 echo "Script to build Unity on Ubuntu 12.10.\n"
21 echo " -s, --setup Setup the build environment and branch Unity"
22 echo " -u, --update Update Unity's source code"
23 echo " -c, --clean Clean build trees before building"
27set -- `getopt -n$0 -u -a --longoptions="setup,update,clean,help" "such" "$@"`
29# FIXME: giving incorrect arguments does not call usage and exit
33 -s|--setup) SETUP=true;;
34 -u|--update) UPDATE=true;;
35 -c|--clean) CLEAN=true;;
42install_dependencies() {
43 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
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
51 echo "Branching libunity.."
52 bzr branch lp:libunity $TARGET_DIR/libunity
56 echo "Branching Unity.."
57# bzr branch lp:unity/phablet-mods $TARGET_DIR/unity
58 bzr branch lp:unity $TARGET_DIR/unity
62 echo "Branching people lens.."
63 bzr branch lp:unity-lens-people $TARGET_DIR/people_lens
67 echo "Branching hud.."
68 bzr branch lp:hud $TARGET_DIR/hud
72 echo "Updating Unity.."
73 bzr pull -d $TARGET_DIR/unity
77 echo "Updating libunity.."
78 bzr pull -d $TARGET_DIR/libunity
82 echo "Updating people lens.."
83 bzr pull -d $TARGET_DIR/people_lens
88 bzr pull -d $TARGET_DIR/hud
92 echo "Configuring libunity.."
94 if $CLEAN; then bzr clean-tree -d $TARGET_DIR/libunity --quiet --unknown --ignored --force; fi
96 cd $TARGET_DIR/libunity
97 bzr revert --quiet -r $LIBUNITY_REV || exit 8
100 ./autogen.sh --prefix $BUILD_DIR --disable-debug --with-pygi-overrides-dir=$BUILD_DIR/gi-overrides
102 echo "Building libunity and installing in " $BUILD_DIR
103 make -j$NUM_JOBS install
107compile_unity_core() {
108 echo "Configuring Unity.."
110 if $CLEAN; then bzr clean-tree -d $TARGET_DIR/unity --quiet --unknown --ignored --force; fi
113 bzr revert --quiet -r $UNITY_REV || exit 9
115 mkdir $TARGET_DIR/unity/build
116 cd $TARGET_DIR/unity/build
118 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
120 echo "Building UnityCore and installing in " $BUILD_DIR
127compile_people_lens() {
128 echo "Configuring people lens.."
130 if $CLEAN; then bzr clean-tree -d $TARGET_DIR/people_lens --quiet --unknown --ignored --force; fi
132 cd $TARGET_DIR/people_lens
133 bzr revert --quiet -r $PEOPLE_LENS_REV || exit 10
135 PKG_CONFIG_PATH=$BUILD_DIR/lib/pkgconfig:$PKG_CONFIG_PATH ./autogen.sh --prefix $BUILD_DIR --enable-localinstall
137 echo "Building people lens and installing in " $BUILD_DIR
138 MAINTAINER_VALAFLAGS="--vapidir=${BUILD_DIR}/share/vala/vapi" make -j$NUM_JOBS install
143 echo "Configuring hud.."
145 if $CLEAN; then bzr clean-tree -d $TARGET_DIR/hud --quiet --unknown --ignored --force; fi
148 bzr revert -r $HUD_REV || exit 11
150 mkdir $TARGET_DIR/hud/build
151 cd $TARGET_DIR/hud/build
153 cmake $TARGET_DIR/hud/ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$BUILD_DIR -DCMAKE_INSTALL_LIBDIR=lib -DLOCAL_INSTALL=ON -DENABLE_TESTS=OFF
155 echo "Building hud and installing in " $BUILD_DIR
161 echo "Linking system lenses.."
162 mkdir -p $BUILD_DIR/share/unity/lenses/
163 for LENS in $LENSES; do
164 [ -e $BUILD_DIR/share/unity/lenses/$LENS ] || ln -ivs /usr/share/unity/lenses/$LENS $BUILD_DIR/share/unity/lenses/$LENS
169 echo "Setting up environment for building Unity.."
182 if $CLEAN; then rm -Rf $BUILD_DIR; fi
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list