Skip to content

Instantly share code, notes, and snippets.

@trollixx
Last active December 18, 2015 23:39
Show Gist options
  • Save trollixx/5862908 to your computer and use it in GitHub Desktop.
Save trollixx/5862908 to your computer and use it in GitHub Desktop.
Qt5 Build Script
#!/bin/bash
INSTALL_DIR=~/dev/qt5
QT_VERSION=5.2.1
QT_CONFIG="-nomake examples -nomake tests -opensource -confirm-license -debug -developer-build"
QT_PLATFORM_CONFIG="-qpa xcb"
QT_CROSSCOMPULE_CONFIG=""
MODULES=(base declarative graphicaleffects multimedia serialport)
function failure {
echo -e "\033[1m$qtmod:\033[0m \E[31m$1\033[0m"
exit 1
}
function build {
qtmod="qt$1"
echo -e "Installing \033[1m$qtmod\033[0m module..."
if [ ! -d "$qtmod" ]; then
echo "Checking out from git..."
git clone git://gitorious.org/qt/${qtmod}.git
[ $? -ne 0 ] && failure "Git clone failed!"
cd $qtmod
#git checkout v$QT_VERSION
[ $? -ne 0 ] && failure "Git checkout failed!"
else
cd $qtmod
git pull
fi
echo "Configuring..."
if [ "$mod" = "base" ]; then
./configure -prefix $INSTALL_DIR $QT_CONFIG $QT_PLATFORM_CONFIG $QT_CROSSCOMPULE_CONFIG
[ $? -ne 0 ] && failure "configure failed"
else
eval "$INSTALL_DIR/bin/qmake"
[ $? -ne 0 ] && failure "qmake failed"
fi
echo "Building module..."
make -j5
[ $? -ne 0 ] && failure "building failed"
echo "Installing module..."
make install
[ $? -ne 0 ] && failure "install failed"
cd ..
echo
}
if [ $# -eq 0 ]; then
for mod in ${MODULES[*]}
do
build $mod
done
else
build $1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment