build_tizen_qt 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. #!/bin/bash
  2. # Arguments = -r qtbase,qtdeclarative,...,qtxmlpatterns -f
  3. set -e
  4. parts="qtchooser qtbase qtxmlpatterns qtimageformats qtdeclarative qtgraphicaleffects qtquickcontrols qtquickcontrols-tizen qtsensors qttools qtwayland"
  5. parts_comma=$(echo $parts | sed "s/ /,/g")
  6. usage()
  7. {
  8. cat << EOF
  9. usage: $0 options
  10. This script will build Qt Tizen repos
  11. OPTIONS:
  12. -h Show this message
  13. -r REPO_LIST comma separated list of qt repositories to build:
  14. qtchooser,qtbase,qtxmlpatterns,qtimageformats,qtdeclarative,qtgraphicaleffects,qtquickcontrols,qtquickcontrols-tizen,qtsensors,qttools,qtwayland
  15. -d Build debug version of packages
  16. -a GBS_BUILD_ARGS Gbs build arguments
  17. -q QT5SRCDIR Qt tizen sources
  18. -c GBS_CONF_FILE Gbs configuration file
  19. -v VERSION_NUMBER Version number passed to gbs with --define "dist $VERSION_NUMBER"
  20. Handled parts: $parts_comma
  21. example:
  22. $0 -r qtbase,qtdeclarative,qtquickcontrols-tizen -d -a "-P mobile_2.2 -A armv7l -C --include-all"
  23. EOF
  24. }
  25. qtparts=""
  26. build_debug_packages=0
  27. gbsBuildArgs=""
  28. QT5SRCDIR=""
  29. GBS_CONF_FILE=""
  30. VERSION_NUMBER="0"
  31. while getopts ":hdr:a:c:q:v:" opt; do
  32. case $opt in
  33. h)
  34. usage
  35. exit
  36. ;;
  37. r)
  38. if [[ "$OPTARG" == *"~"* ]]; then
  39. excludeqtparts=$(echo -n $OPTARG | sed "s/,/ /gi" | sed "s/~//gi")
  40. else
  41. qtparts=$(echo -n $OPTARG | sed "s/,/ /gi")
  42. fi
  43. ;;
  44. d)
  45. build_debug_packages=1
  46. ;;
  47. a)
  48. gbsBuildArgs="$OPTARG"
  49. ;;
  50. q)
  51. QT5SRCDIR="$OPTARG"
  52. ;;
  53. c)
  54. GBS_CONF_FILE="$OPTARG"
  55. ;;
  56. v)
  57. VERSION_NUMBER=$OPTARG
  58. ;;
  59. ?)
  60. echo "Invalid option $OPTARG"
  61. usage
  62. exit
  63. esac
  64. done
  65. isMobileProfile=0
  66. isIVIProfile=0
  67. isEmulatorProfile=0
  68. if [[ "$@" == *"-P "*mobile* ]]; then
  69. isMobileProfile=1
  70. qtBaseSpec="qtbase_mobile.spec"
  71. fi
  72. if [[ "$@" == *"-P "*ivi* ]]; then
  73. isIVIProfile=1
  74. qtBaseSpec="qtbase_ivi.spec"
  75. fi
  76. if [[ "$@" == *"-P "*emulator* ]]; then
  77. isEmulatorProfile=1
  78. qtBaseSpec="qtbase_emulator.spec"
  79. fi
  80. if [ "$qtBaseSpec" == "" ]; then
  81. echo "Can't recognize tizen profile"
  82. exit 1;
  83. fi
  84. if [ "$qtparts" == "" ]; then
  85. if [ "$excludeqtparts" != "" ]; then
  86. for excludePart in "$excludeqtparts"; do
  87. parts=$(echo -n $parts | sed "s/$excludePart//gi")
  88. done
  89. fi
  90. else
  91. parts="$qtparts"
  92. fi
  93. if [ "$QT5SRCDIR" == "" ]; then
  94. QT5SRCDIR=$PWD
  95. fi
  96. if [ "$GBS_CONF_FILE" != "" ]; then
  97. MAIN_GBS_ARGS="--conf $GBS_CONF_FILE"
  98. fi
  99. CURDIR=$PWD
  100. cd $QT5SRCDIR
  101. rootRepoDir=`pwd`
  102. for qtrepo in $parts; do
  103. echo =============================================
  104. echo building $qtrepo
  105. echo =============================================
  106. cd $rootRepoDir/$qtrepo
  107. specArg=""
  108. if [ "$qtrepo" == "qtbase" ]; then
  109. specArg="--spec $qtBaseSpec"
  110. fi
  111. if [ "$qtrepo" != "qtwayland" ]; then
  112. gbs --debug $MAIN_GBS_ARGS build $gbsBuildArgs --define "dist $VERSION_NUMBER" --define "create_debug_packages $build_debug_packages" $specArg
  113. else
  114. if [ "$isIVIProfile" == "1" ]; then
  115. gbs $MAIN_GBS_ARGS build $gbsBuildArgs --define "dist $VERSION_NUMBER" --define "create_debug_packages $build_debug_packages" --spec qtwayland_egl.spec
  116. else
  117. echo "qtwayland module can be built only in IVI profile"
  118. fi
  119. fi
  120. done
  121. cd $CURDIR