trollixx

Qt5 Build Script

Feb 8th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.30 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. INSTALL_DIR=~/dev/qt5
  4.  
  5. QT_CONFIG="-nomake examples -nomake demos -nomake tests -opensource -confirm-license -release -no-accessibility -qt-libpng -qt-libjpeg -qt-pcre -no-widgets"
  6. #QT_CONFIG="-nomake examples -nomake demos -nomake tests -opensource -confirm-license -release -no-accessibility -qt-libpng -qt-libjpeg -qt-pcre"
  7. MODULES=(base jsbackend declarative multimedia graphicaleffects)
  8.  
  9. function failure {
  10.     echo -e "\033[1m$qtmod:\033[0m \E[31m$1"
  11.     exit 1
  12. }
  13.  
  14. for mod in ${MODULES[*]}
  15. do
  16.     echo -e "Installing \033[1m$mod\033[0m module..."
  17.     qtmod="qt$mod"
  18.  
  19.     if [ ! -d "$qtmod" ]; then
  20.     echo "Checking out from git..."
  21.     git clone git://gitorious.org/qt/${qtmod}.git
  22.     [ $? -ne 0 ] && failure "Git chechout failed!"
  23.     cd $qtmod
  24.     else
  25.     cd $qtmod
  26.     git pull
  27.     [ $? -ne 0 ] && failure "git pull failed"
  28.     fi
  29.  
  30.     echo "Configuring..."
  31.     if [ $mod == "base" ]; then
  32.     ./configure -prefix $INSTALL_DIR $QT_CONFIG
  33.     [ $? -ne 0 ] && failure "configure failed"
  34.     else
  35.     eval "$INSTALL_DIR/bin/qmake"
  36.     [ $? -ne 0 ] && failure "qmake failed"
  37.     fi
  38.  
  39.     echo "Building module..."
  40.     make -j5
  41.     [ $? -ne 0 ] && failure "building failed"
  42.  
  43.     echo "Installing module..."
  44.     make install
  45.     [ $? -ne 0 ] && failure "install failed"
  46.  
  47.     cd ..
  48.     echo
  49. done
Advertisement
Add Comment
Please, Sign In to add comment