~mterry/+junk/u8

« back to all changes in this revision

Viewing changes to build.sh

  • Committer: Bileto Bot
  • Author(s): Michael Zanetti
  • Date: 2016-08-11 06:22:51 UTC
  • mfrom: (2542.1.6 unity8-main-build-scripts)
  • Revision ID: ci-train-bot@canonical.com-20160811062251-1qy0g9dt7v0ertu1
Clean up some build script legacy

Approved by: Albert Astals Cid

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
    echo "usage: build [OPTIONS] [BUILD_TYPE]\n" >&2
10
10
    echo "Script to build the shell. If BUILD_TYPE is not specified, it defaults to \"debug\".\n" >&2
11
11
    echo "OPTIONS:" >&2
12
 
    echo " -s, --setup Setup the build environment and branch Unity" >&2
13
12
    echo " -c, --clean Clean the build tree before building" >&2
14
13
    echo >&2
15
14
    exit 1
22
21
while [ $# -gt 0 ]
23
22
do
24
23
    case "$1" in
25
 
       -s|--setup)   SETUP=true;;
26
24
       -c|--clean)   CLEAN=true;;
27
25
       -h|--help)    usage;;
28
26
       --)           shift;break;;
35
33
BUILD_TYPE="debug"
36
34
[ $# -eq 1 ] && BUILD_TYPE="$1"
37
35
 
38
 
install_dependencies() {
39
 
    sudo apt-get update || exit 4
40
 
    echo "Installing Unity 8 dependencies.."
41
 
    sudo apt-get install devscripts \
42
 
                         equivs \
43
 
                         gsettings-desktop-schemas \
44
 
                         gsettings-ubuntu-schemas \
45
 
                         pay-service \
46
 
                         qmenumodel-qml \
47
 
                         qml-module-qtquick-layouts \
48
 
                         qml-module-qtquick-xmllistmodel \
49
 
                         qml-module-ubuntu-components \
50
 
                         qml-module-ubuntu-thumbnailer0.1 \
51
 
                         qtdeclarative5-gsettings1.0 \
52
 
                         qtdeclarative5-ubuntu-settings-components \
53
 
                         qtdeclarative5-ubuntu-telephony0.1 \
54
 
                         qtdeclarative5-unity-notifications-plugin \
55
 
                         qml-module-ubuntu-connectivity \
56
 
                         ubuntu-mobile-icons \
57
 
                         ubuntu-system-settings \
58
 
                         unity-plugin-scopes \
59
 
                         xvfb \
60
 
        || exit 5
61
 
}
62
 
 
63
36
mk_build_deps() {
64
37
    if [ ! -f control -o $CODE_DIR/debian/control -nt control ]; then
65
38
        sed 's/\:native//g' $CODE_DIR/debian/control > control
85
58
  BUILD_COMMAND="make -j$NUM_JOBS"
86
59
fi
87
60
 
88
 
if $SETUP; then
89
 
    install_dependencies
90
 
else
91
 
    if $CLEAN; then rm -rf builddir; fi
92
 
    mkdir -p builddir
93
 
    cd builddir
94
 
    mk_build_deps
95
 
    cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CODE_DIR ${GENERATOR} || exit 6
96
 
    ${BUILD_COMMAND} || exit 7
97
 
fi
 
61
if $CLEAN; then rm -rf builddir; fi
 
62
mkdir -p builddir
 
63
cd builddir
 
64
mk_build_deps
 
65
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CODE_DIR ${GENERATOR} || exit 6
 
66
${BUILD_COMMAND} || exit 7