> ${JOB_NAME}.sh cat << "EOF" #!/bin/bash MAKEFLAGS=j$(nproc) export MAKEFLAGS mkdir prefix cd prefix PREFIX_DIR=$(pwd) cd .. tar -xf libqt5_src.tar.xz cd qt* # set QT_CONFIGURE_OPTIONS based on ${JOB_NAME}, i.e. OS, architecture, and build types QT_CONFIGURE_OPTIONS="-prefix ${PREFIX_DIR} \ -opensource -confirm-license \ -pch \ -nomake examples \ -nomake tools \ -nomake tests \ -skip translations \ -skip doc \ -skip qtdeclarative \ -skip activeqt \ -skip qtwebsockets \ -skip qtscript \ -skip qtquick1 \ -skip qtquickcontrols \ -skip qtconnectivity \ -skip qtenginio \ -skip qtsensors \ -skip qtserialport \ -skip qtlocation \ -skip qtgraphicaleffects \ -skip qttools \ -skip qtimageformats \ -skip webkit \ -skip webkit-examples \ -skip webchannel \ -skip multimedia \ -no-openssl \ -no-dbus \ -no-icu \ -no-qml-debug \ -qt-libjpeg \ -qt-libpng \ -qt-zlib \ -qt-pcre" if [[ ${JOB_NAME} == *"release"* ]] then QT_CONFIGURE_OPTIONS="-release $QT_CONFIGURE_OPTIONS" elif [[ ${JOB_NAME} == *"debug"* ]] then QT_CONFIGURE_OPTIONS="-debug $QT_CONFIGURE_OPTIONS" else echo "Error: Unknown build type, neither release or debug. Exiting." exit 1 fi if [[ ${JOB_NAME} == *"static"* ]] then QT_CONFIGURE_OPTIONS="-static $QT_CONFIGURE_OPTIONS" elif [[ ${JOB_NAME} == *"shared"* ]] then QT_CONFIGURE_OPTIONS="-shared $QT_CONFIGURE_OPTIONS" else echo "Error: Unknown build type, neither static or shared. Exiting." exit 1 fi if [[ ${JOB_NAME} == *"windows"* ]] then if [[ ${JOB_NAME} == *"x86-64"* ]] then QT_CONFIGURE_OPTIONS="-device-option CROSS_COMPILE=x86_64-w64-mingw32- $QT_CONFIGURE_OPTIONS" elif [[ ${JOB_NAME} == *"x86"* ]] then QT_CONFIGURE_OPTIONS="-device-option CROSS_COMPILE=i686-w64-mingw32- $QT_CONFIGURE_OPTIONS" else echo "Error: Support only x86 and x86-64 architectires on Windows. Exiting." exit 1 fi QT_CONFIGURE_OPTIONS="-xplatform win32-g++ $QT_CONFIGURE_OPTIONS" elif [[ ${JOB_NAME} == *"linux"* ]] then if [[ ${JOB_NAME} == *"x86-64"* ]] then QT_CONFIGURE_OPTIONS="-platform linux-g++-64 $QT_CONFIGURE_OPTIONS" elif [[ ${JOB_NAME} == *"x86"* ]] then QT_CONFIGURE_OPTIONS="-platform linux-g++-32 $QT_CONFIGURE_OPTIONS" else echo "Error: Support only x86 and x86-64 architectires on Linux. Exiting." exit 1 fi QT_CONFIGURE_OPTIONS="$QT_CONFIGURE_OPTIONS -qt-freetype -qt-xcb" fi ./configure ${QT_CONFIGURE_OPTIONS} make make install cd .. rm -rf qt* rm libqt5_src.tar.xz cd "${PREFIX_DIR}" if [[ ${JOB_NAME} == *"windows"* ]] then zip ${JOB_NAME}.zip -r * mv ${JOB_NAME}.zip .. elif [[ ${JOB_NAME} == *"linux"* ]] then tar -cJf ${JOB_NAME}.tar.xz * mv ${JOB_NAME}.tar.xz .. fi # break the hardcoded into Qt build path mv "${PREFIX_DIR}" "${PREFIX_DIR}"_ EOF chmod +x ${JOB_NAME}.sh