@@ -1,158 +0,0 @@
3−TARGET_DIR=$PWD/../unity_build
4−BUILD_DIR=$TARGET_DIR/build
8−NUM_JOBS=$(( `grep -c ^processor /proc/cpuinfo` + 1 ))
10−# verified working revisions
16− echo "usage: build_unity [OPTIONS]\n"
17− echo "Script to build Unity on Ubuntu 12.10.\n"
19− echo " -s, --setup Setup the build environment and branch Unity"
20− echo " -u, --update Update Unity's source code"
21− echo " -c, --clean Clean build trees before building"
25−set -- `getopt -n$0 -u -a --longoptions="setup,update,clean,help" "such" "$@"`
27−# FIXME: giving incorrect arguments does not call usage and exit
31− -s|--setup) SETUP=true;;
32− -u|--update) UPDATE=true;;
33− -c|--clean) CLEAN=true;;
41− echo "Installing build utilities.."
42− sudo apt-get install devscripts equivs || exit 4
46− echo "Installing build dependencies.."
48− sudo mk-build-deps -B -i $TARGET_DIR/libunity/debian/control || exit 5
49− sudo mk-build-deps -B -i $TARGET_DIR/unity/debian/control || exit 6
50− sudo mk-build-deps -B -i $TARGET_DIR/hud/debian/control || exit 7
54− echo "Branching libunity.."
55− bzr branch lp:libunity $TARGET_DIR/libunity || exit 8
59− echo "Branching Unity.."
60− bzr branch lp:unity $TARGET_DIR/unity || exit 9
64− echo "Branching hud.."
65− bzr branch lp:hud $TARGET_DIR/hud || exit 10
69− echo "Updating Unity.."
70− bzr pull -d $TARGET_DIR/unity || exit 11
74− echo "Updating libunity.."
75− bzr pull -d $TARGET_DIR/libunity || exit 12
80− bzr pull -d $TARGET_DIR/hud || exit 13
84− echo "Configuring libunity.."
86− if $CLEAN; then bzr clean-tree -d $TARGET_DIR/libunity --quiet --unknown --ignored --force; fi
88− cd $TARGET_DIR/libunity
89− bzr revert --quiet -r $LIBUNITY_REV || exit 14
91− mkdir $TARGET_DIR/libunity/build
92− cd $TARGET_DIR/libunity/build
94− ../autogen.sh --prefix $BUILD_DIR --disable-debug --with-pygi-overrides-dir=$BUILD_DIR/gi-overrides || exit 15
96− echo "Building libunity and installing in " $BUILD_DIR
97− make -j$NUM_JOBS install || exit 16
101−compile_unity_core() {
102− echo "Configuring Unity.."
104− if $CLEAN; then bzr clean-tree -d $TARGET_DIR/unity --quiet --unknown --ignored --force; fi
106− cd $TARGET_DIR/unity
107− bzr revert --quiet -r $UNITY_REV || exit 17
109− mkdir $TARGET_DIR/unity/build
110− cd $TARGET_DIR/unity/build
112− 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
114− echo "Building UnityCore and installing in " $BUILD_DIR
116− make -j$NUM_JOBS install || exit 19
121− echo "Configuring hud.."
123− if $CLEAN; then bzr clean-tree -d $TARGET_DIR/hud --quiet --unknown --ignored --force; fi
126− bzr revert -r $HUD_REV || exit 20
128− mkdir $TARGET_DIR/hud/build
129− cd $TARGET_DIR/hud/build
131− 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
133− echo "Building hud and installing in " $BUILD_DIR
134− make install || exit 22
139− echo "Setting up environment for building Unity.."
141− mkdir -p $TARGET_DIR
152− if $CLEAN; then rm -Rf $BUILD_DIR; fi