123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- #!/bin/bash
- # Arguments = -r qtbase,qtdeclarative,...,qtxmlpatterns -f
- set -e
- parts="qtchooser qtbase qtxmlpatterns qtimageformats qtdeclarative qtgraphicaleffects qtquickcontrols qtquickcontrols-tizen qtsensors qttools qtwayland"
- parts_comma=$(echo $parts | sed "s/ /,/g")
- usage()
- {
- cat << EOF
- usage: $0 options
- This script will build Qt Tizen repos
- OPTIONS:
- -h Show this message
- -r REPO_LIST comma separated list of qt repositories to build:
- qtchooser,qtbase,qtxmlpatterns,qtimageformats,qtdeclarative,qtgraphicaleffects,qtquickcontrols,qtquickcontrols-tizen,qtsensors,qttools,qtwayland
- -d Build debug version of packages
- -a GBS_BUILD_ARGS Gbs build arguments
- -q QT5SRCDIR Qt tizen sources
- -c GBS_CONF_FILE Gbs configuration file
- -v VERSION_NUMBER Version number passed to gbs with --define "dist $VERSION_NUMBER"
-
- Handled parts: $parts_comma
- example:
- $0 -r qtbase,qtdeclarative,qtquickcontrols-tizen -d -a "-P mobile_2.2 -A armv7l -C --include-all"
- EOF
- }
- qtparts=""
- build_debug_packages=0
- gbsBuildArgs=""
- QT5SRCDIR=""
- GBS_CONF_FILE=""
- VERSION_NUMBER="0"
- while getopts ":hdr:a:c:q:v:" opt; do
- case $opt in
- h)
- usage
- exit
- ;;
- r)
- if [[ "$OPTARG" == *"~"* ]]; then
- excludeqtparts=$(echo -n $OPTARG | sed "s/,/ /gi" | sed "s/~//gi")
- else
- qtparts=$(echo -n $OPTARG | sed "s/,/ /gi")
- fi
- ;;
- d)
- build_debug_packages=1
- ;;
- a)
- gbsBuildArgs="$OPTARG"
- ;;
- q)
- QT5SRCDIR="$OPTARG"
- ;;
- c)
- GBS_CONF_FILE="$OPTARG"
- ;;
- v)
- VERSION_NUMBER=$OPTARG
- ;;
- ?)
- echo "Invalid option $OPTARG"
- usage
- exit
- esac
- done
- isMobileProfile=0
- isIVIProfile=0
- isEmulatorProfile=0
- if [[ "$@" == *"-P "*mobile* ]]; then
- isMobileProfile=1
- qtBaseSpec="qtbase_mobile.spec"
- fi
- if [[ "$@" == *"-P "*ivi* ]]; then
- isIVIProfile=1
- qtBaseSpec="qtbase_ivi.spec"
- fi
- if [[ "$@" == *"-P "*emulator* ]]; then
- isEmulatorProfile=1
- qtBaseSpec="qtbase_emulator.spec"
- fi
- if [ "$qtBaseSpec" == "" ]; then
- echo "Can't recognize tizen profile"
- exit 1;
- fi
- if [ "$qtparts" == "" ]; then
- if [ "$excludeqtparts" != "" ]; then
- for excludePart in "$excludeqtparts"; do
- parts=$(echo -n $parts | sed "s/$excludePart//gi")
- done
- fi
- else
- parts="$qtparts"
- fi
- if [ "$QT5SRCDIR" == "" ]; then
- QT5SRCDIR=$PWD
- fi
- if [ "$GBS_CONF_FILE" != "" ]; then
- MAIN_GBS_ARGS="--conf $GBS_CONF_FILE"
- fi
- CURDIR=$PWD
- cd $QT5SRCDIR
- rootRepoDir=`pwd`
- for qtrepo in $parts; do
- echo =============================================
- echo building $qtrepo
- echo =============================================
- cd $rootRepoDir/$qtrepo
- specArg=""
- if [ "$qtrepo" == "qtbase" ]; then
- specArg="--spec $qtBaseSpec"
- fi
- if [ "$qtrepo" != "qtwayland" ]; then
- gbs --debug $MAIN_GBS_ARGS build $gbsBuildArgs --define "dist $VERSION_NUMBER" --define "create_debug_packages $build_debug_packages" $specArg
- else
- if [ "$isIVIProfile" == "1" ]; then
- gbs $MAIN_GBS_ARGS build $gbsBuildArgs --define "dist $VERSION_NUMBER" --define "create_debug_packages $build_debug_packages" --spec qtwayland_egl.spec
- else
- echo "qtwayland module can be built only in IVI profile"
- fi
- fi
- done
- cd $CURDIR
|