on xenial help sign in
Drop build_unity that's not needed anymore and clean up build/run scripts.
commit4a0910435f37206b162d3b616d69216264e1cf9b authorMichał Sawicz <michal.sawicz@canonical.com> dateThu 20 Jun 2013, 14:56 (13 years ago) parent3d62c2b
3 files changed+8−167
build+8−8 build_unity−158 run−1
build+8−8
@@ -1,10 +1,9 @@
11#!/bin/sh
22
3−PACKAGE=unity8
4−UNITY_BUILD_DIR=$PWD/../unity_build/build
53SETUP=false
64CLEAN=false
75NUM_JOBS=$(( `grep -c ^processor /proc/cpuinfo` + 1 ))
6+CODE_DIR=$( dirname `readlink -f $0` )
87
98usage() {
109 echo "usage: build [OPTIONS] [BUILD_TYPE]\n" >&2
@@ -37,13 +36,16 @@ BUILD_TYPE="debug"
3736[ $# -eq 1 ] && BUILD_TYPE="$1"
3837
3938install_dependencies() {
40− . /etc/lsb-release
4139 [ -f /etc/apt/sources.list.d/phablet-team-desktop-deps-${DISTRIB_CODENAME}.list ] || sudo add-apt-repository ppa:phablet-team/desktop-deps || exit 1
4240 [ -f /etc/apt/sources.list.d/canonical-qt5-edgers-qt5-proper-${DISTRIB_CODENAME}.list ] || sudo add-apt-repository ppa:canonical-qt5-edgers/qt5-proper || exit 2;
4341 [ -f /etc/apt/sources.list.d/ubuntu-sdk-team-ppa-${DISTRIB_CODENAME}.list ] || sudo add-apt-repository ppa:ubuntu-sdk-team/ppa || exit 3
4442 sudo apt-get update || exit 4
4543 echo "Installing Unity 8 dependencies.."
46− sudo apt-get install qtdeclarative5-ubuntu-ui-toolkit-plugin qtdeclarative5-dee-plugin indicators-client indicators-client-plugin-* qtbase5-dev qtbase5-private-dev qtdeclarative5-dev qtdeclarative5-dev-tools qtdeclarative5-test-plugin libdee-qt5-dev libpulse-dev qtdeclarative5-xmllistmodel-plugin unity-lens-mock demo-assets ubuntu-mobile-icons || exit 5
44+ sudo apt-get install devscripts equivs qtdeclarative5-ubuntu-ui-toolkit-plugin qtdeclarative5-dee-plugin indicators-client indicators-client-plugin-* ubuntu-mobile-icons unity-notifications-impl-1 || exit 5
45+}
46+
47+mk_build_deps() {
48+ [ ! -f unity8-build-deps*deb -o $CODE_DIR/debian/control -nt unity8-build-deps*deb ] && mk-build-deps --install --root-cmd sudo $CODE_DIR/debian/control
4749}
4850
4951if [ -f "/usr/bin/ninja" ] ; then
@@ -56,13 +58,11 @@ fi
5658
5759if $SETUP; then
5860 install_dependencies
59− ./build_unity --setup || exit 1$?
60− ./build_unity || exit 1$?
6161else
6262 if $CLEAN; then rm -rf builddir; fi
6363 mkdir -p builddir
6464 cd builddir
65− PKG_CONFIG_PATH=$UNITY_BUILD_DIR/lib/pkgconfig/:$PKG_CONFIG_PATH cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. ${GENERATOR} || exit 6
65+ mk_build_deps
66+ cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CODE_DIR ${GENERATOR} || exit 6
6667 ${BUILD_COMMAND} || exit 7
6768fi
68−
build_unitydeleted−158
@@ -1,158 +0,0 @@
1−#!/bin/bash
2−
3−TARGET_DIR=$PWD/../unity_build
4−BUILD_DIR=$TARGET_DIR/build
5−SETUP=false
6−UPDATE=false
7−CLEAN=false
8−NUM_JOBS=$(( `grep -c ^processor /proc/cpuinfo` + 1 ))
9−
10−# verified working revisions
11−LIBUNITY_REV=228
12−UNITY_REV=3343
13−HUD_REV=252
14−
15−usage() {
16− echo "usage: build_unity [OPTIONS]\n"
17− echo "Script to build Unity on Ubuntu 12.10.\n"
18− echo "OPTIONS:"
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"
22− exit 1
23−}
24−
25−set -- `getopt -n$0 -u -a --longoptions="setup,update,clean,help" "such" "$@"`
26−
27−# FIXME: giving incorrect arguments does not call usage and exit
28−while [ $# -gt 0 ]
29−do
30− case "$1" in
31− -s|--setup) SETUP=true;;
32− -u|--update) UPDATE=true;;
33− -c|--clean) CLEAN=true;;
34− -h|--help) usage;;
35− --) shift;break;;
36− esac
37− shift
38−done
39−
40−install_utils() {
41− echo "Installing build utilities.."
42− sudo apt-get install devscripts equivs || exit 4
43−}
44−
45−mk_build_deps() {
46− echo "Installing build dependencies.."
47− cd $TARGET_DIR
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
51−}
52−
53−branch_libunity() {
54− echo "Branching libunity.."
55− bzr branch lp:libunity $TARGET_DIR/libunity || exit 8
56−}
57−
58−branch_unity() {
59− echo "Branching Unity.."
60− bzr branch lp:unity $TARGET_DIR/unity || exit 9
61−}
62−
63−branch_hud() {
64− echo "Branching hud.."
65− bzr branch lp:hud $TARGET_DIR/hud || exit 10
66−}
67−
68−update_unity() {
69− echo "Updating Unity.."
70− bzr pull -d $TARGET_DIR/unity || exit 11
71−}
72−
73−update_libunity() {
74− echo "Updating libunity.."
75− bzr pull -d $TARGET_DIR/libunity || exit 12
76−}
77−
78−update_hud() {
79− echo "Updating hud"
80− bzr pull -d $TARGET_DIR/hud || exit 13
81−}
82−
83−compile_libunity() {
84− echo "Configuring libunity.."
85−
86− if $CLEAN; then bzr clean-tree -d $TARGET_DIR/libunity --quiet --unknown --ignored --force; fi
87−
88− cd $TARGET_DIR/libunity
89− bzr revert --quiet -r $LIBUNITY_REV || exit 14
90−
91− mkdir $TARGET_DIR/libunity/build
92− cd $TARGET_DIR/libunity/build
93−
94− ../autogen.sh --prefix $BUILD_DIR --disable-debug --with-pygi-overrides-dir=$BUILD_DIR/gi-overrides || exit 15
95−
96− echo "Building libunity and installing in " $BUILD_DIR
97− make -j$NUM_JOBS install || exit 16
98−
99−}
100−
101−compile_unity_core() {
102− echo "Configuring Unity.."
103−
104− if $CLEAN; then bzr clean-tree -d $TARGET_DIR/unity --quiet --unknown --ignored --force; fi
105−
106− cd $TARGET_DIR/unity
107− bzr revert --quiet -r $UNITY_REV || exit 17
108−
109− mkdir $TARGET_DIR/unity/build
110− cd $TARGET_DIR/unity/build
111−
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
113−
114− echo "Building UnityCore and installing in " $BUILD_DIR
115− cd UnityCore
116− make -j$NUM_JOBS install || exit 19
117−
118−}
119−
120−compile_hud() {
121− echo "Configuring hud.."
122−
123− if $CLEAN; then bzr clean-tree -d $TARGET_DIR/hud --quiet --unknown --ignored --force; fi
124−
125− cd $TARGET_DIR/hud
126− bzr revert -r $HUD_REV || exit 20
127−
128− mkdir $TARGET_DIR/hud/build
129− cd $TARGET_DIR/hud/build
130−
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
132−
133− echo "Building hud and installing in " $BUILD_DIR
134− make install || exit 22
135−
136−}
137−
138−if $SETUP; then
139− echo "Setting up environment for building Unity.."
140− install_utils
141− mkdir -p $TARGET_DIR
142− branch_libunity
143− branch_unity
144− branch_hud
145− mk_build_deps
146−elif $UPDATE; then
147− update_libunity
148− update_unity
149− update_hud
150− mk_build_deps
151−else
152− if $CLEAN; then rm -Rf $BUILD_DIR; fi
153− mkdir -p $BUILD_DIR
154− compile_libunity
155− compile_unity_core
156− compile_hud
157−fi
158−
run−1
@@ -1,7 +1,6 @@
11#!/bin/sh
22
33QML_PHONE_SHELL_PATH=./builddir/unity8
4−export LD_LIBRARY_PATH=$PWD/../unity_build/build/lib
54GDB=false
65FAKE=false
76PINLOCK=false