downloadAndBuildAll.sh 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #!/bin/bash
  2. # Copyright (C) 2013 Tomasz Olszak <olszak.tomasz@gmail.com>
  3. # All rights reserved.
  4. # Redistribution and use in source and binary forms, with or without
  5. # modification, are permitted provided that the following conditions
  6. # are met:
  7. # 1. Redistributions of source code must retain the copyright
  8. # notice, this list of conditions and the following disclaimer.
  9. # 2. Redistributions in binary form must reproduce the copyright
  10. # notice, this list of conditions and the following disclaimer in the
  11. # documentation and/or other materials provided with the distribution.
  12. # 3. The name of the author may not be used to endorse or promote products
  13. # derived from this software without specific prior written permission.
  14. #
  15. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  16. # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  17. # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  18. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  19. # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  20. # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  21. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  22. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  24. # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. #
  26. set -e
  27. CURRENT_DIR=$(pwd)
  28. SCRIPT_DIR=$(dirname $0)
  29. cd $SCRIPT_DIR
  30. function usage {
  31. echo -e "\n"
  32. echo "Script for Qt for tizen compilation. "
  33. echo "Set Parameters or environment variables with absolute paths"
  34. echo ""
  35. echo "Usage:"
  36. echo "sudo [MAKE_THREADS=numberOfCPUCores] [QT5SRCDIR=Qt5SrcPath] [INSTALLDIR=QtInstallPrefix] ./downloadAndBuildAll.sh"
  37. echo ""
  38. echo "QT5SRCDIR - directory with qt5 sources"
  39. echo "INSTALLDIR - here qmake and other host binaries will be installed"
  40. echo "If corresponding environment variables are set then script can be invoked without parameters"
  41. echo "set MAKE_THREADS environment variable to number of your CPU cores to fast up compilation step"
  42. echo ""
  43. cd $CURRENT_DIR
  44. exit;
  45. }
  46. if [ "$1" == "-h" -o "$1" == "--help" ]; then
  47. usage
  48. fi
  49. if [ "$QT5SRCDIR" == "" ]; then
  50. QT5SRCDIR=$PWD/qt5.gitorious
  51. echo "Setting QT5SRCDIR to $QT5SRCDIR"
  52. fi
  53. if [ "$INSTALLDIR" == "" ]; then
  54. INSTALLDIR=$PWD/qt5hostInstall
  55. echo "Setting INSTALLDIR to $INSTALLDIR"
  56. fi
  57. if [ "$QT5SRCDIR" == "$PWD/qt5.gitorious" ]; then
  58. if [ ! -d qt5.gitorious ]; then
  59. git clone -b release https://git.gitorious.org/qt/qt5.git qt5.gitorious
  60. cd qt5.gitorious
  61. git clone -b wip/tizen https://git.gitorious.org/qt/qtquickcontrols-tizen.git
  62. ./init-repository --http --no-webkit --module-subset=qtactiveqt,qtbase,qtdeclarative,qtdoc,qtgraphicaleffects,qtimageformats,qtjsbackend,qtmultimedia,qtquickcontrols,qtsensors,qtserialport,qtsvg,qttools,qttranslations,qtxmlpatterns
  63. cd qtquickcontrols
  64. git checkout wip/tizen
  65. cd ../
  66. cd qtbase
  67. git checkout wip/tizen
  68. cd ../../
  69. else
  70. echo "Looks like qt5.gitorious directory exists"
  71. fi;
  72. fi;
  73. mkdir -p buildQt5
  74. cd buildQt5
  75. echo "================================================="
  76. echo "Configuration:"
  77. echo "QT5SRCDIR=$QT5SRCDIR"
  78. echo "INSTALLDIR=$INSTALLDIR"
  79. echo "================================================="
  80. $QT5SRCDIR/configure -prefix $INSTALLDIR -v \
  81. -release -opensource \
  82. -confirm-license -nomake examples -no-widgets
  83. MAKE_ARGS=""
  84. if [ "$MAKE_THREADS" != "" ]; then
  85. echo "setting make thread"
  86. MAKE_ARGS="-j $MAKE_THREADS"
  87. fi
  88. echo make $MAKE_ARGS
  89. make $MAKE_ARGS
  90. echo make install $MAKE_ARGS
  91. make install $MAKE_ARGS
  92. if [ -d $QT5SRCDIR/qtquickcontrols-tizen ]; then
  93. mkdir -p qtquickcontrols-tizen
  94. cd qtquickcontrols-tizen
  95. $INSTALLDIR/bin/qmake $QT5SRCDIR/qtquickcontrols-tizen
  96. make $MAKE_ARGS
  97. make install $MAKE_ARGS
  98. fi
  99. cd $CURRENT_DIR