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
17 echo "usage: build_unity [OPTIONS]\n"
18 echo "Script to build Unity on Ubuntu 12.10.\n"
20 echo " -s, --setup Setup the build environment and branch Unity"
21 echo " -u, --update Update Unity's source code"
22 echo " -c, --clean Clean build trees before building"
26set -- `getopt -n$0 -u -a --longoptions="setup,update,clean,help" "such" "$@"`
28# FIXME: giving incorrect arguments does not call usage and exit
32 -s|--setup) SETUP=true;;
33 -u|--update) UPDATE=true;;
34 -c|--clean) CLEAN=true;;
42 echo "Installing build utilities.."
43 sudo apt-get install devscripts equivs || exit 4
47 echo "Installing build dependencies.."
49 sudo mk-build-deps -B -i $TARGET_DIR/libunity/debian/control || exit 5
50 sudo mk-build-deps -B -i $TARGET_DIR/unity/debian/control || exit 6
51 sudo mk-build-deps -B -i $TARGET_DIR/hud/debian/control || exit 7
55 echo "Branching libunity.."
56 bzr branch lp:libunity/phablet $TARGET_DIR/libunity || exit 8
60 echo "Branching Unity.."
61 bzr branch lp:unity/phablet-mods $TARGET_DIR/unity || exit 9
65 echo "Branching hud.."
66 bzr branch lp:hud $TARGET_DIR/hud || exit 10
70 echo "Updating Unity.."
71 bzr pull -d $TARGET_DIR/unity || exit 11
75 echo "Updating libunity.."
76 bzr pull -d $TARGET_DIR/libunity || exit 12
81 bzr pull -d $TARGET_DIR/hud || exit 13
85 echo "Configuring libunity.."
87 if $CLEAN; then bzr clean-tree -d $TARGET_DIR/libunity --quiet --unknown --ignored --force; fi
89 cd $TARGET_DIR/libunity
90 bzr revert --quiet -r $LIBUNITY_REV || exit 14
92 mkdir $TARGET_DIR/libunity/build
93 cd $TARGET_DIR/libunity/build
95 ../autogen.sh --prefix $BUILD_DIR --disable-debug || exit 15
97 echo "Building libunity and installing in " $BUILD_DIR
98 make -j$NUM_JOBS install || exit 16
102compile_unity_core() {
103 echo "Configuring Unity.."
105 if $CLEAN; then bzr clean-tree -d $TARGET_DIR/unity --quiet --unknown --ignored --force; fi
108 bzr revert --quiet -r $UNITY_REV || exit 17
110 mkdir $TARGET_DIR/unity/build
111 cd $TARGET_DIR/unity/build
113 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 18
115 echo "Building UnityCore and installing in " $BUILD_DIR
117 make -j$NUM_JOBS install || exit 19
122 echo "Configuring hud.."
124 if $CLEAN; then bzr clean-tree -d $TARGET_DIR/hud --quiet --unknown --ignored --force; fi
127 bzr revert -r $HUD_REV || exit 20
129 mkdir $TARGET_DIR/hud/build
130 cd $TARGET_DIR/hud/build
132 cmake $TARGET_DIR/hud/ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$BUILD_DIR -DCMAKE_INSTALL_LIBDIR=lib -DLOCAL_INSTALL=ON -DENABLE_TESTS=OFF || exit 21
134 echo "Building hud and installing in " $BUILD_DIR
135 make install || exit 22
140 echo "Linking system lenses.."
141 mkdir -p $BUILD_DIR/share/unity/lenses/
142 for LENS in $LENSES; do
143 [ -e $BUILD_DIR/share/unity/lenses/$LENS ] || ln -ivs /usr/share/unity/lenses/$LENS $BUILD_DIR/share/unity/lenses/$LENS
148 echo "Setting up environment for building Unity.."
161 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