Qt 5 static build scripts

From Moondust Wiki
Revision as of 23:31, 11 June 2017 by Wohlstand (talk | contribs)
Jump to navigation Jump to search

This is a set of scripts to download and build static Qt assembly for purpose to use them on CI

Linux

#!/bin/bash

OldDir=$PWD

echo Downloading...
wget http://download.qt.io/official_releases/qt/5.9/5.9.0/single/qt-everywhere-opensource-src-5.9.0.tar.xz

echo Unpacking...
tar -xf qt-everywhere-opensource-src-5.9.0.tar.xz

echo Creating /home/runner/Qt (needs root)...
if [ ! -d /home/runner/Qt ]; then
    MyUsername=$(whoami)
    sudo mkdir -p /home/runner/Qt
    sudo chmod -R $MyUsername /home/runner
fi

cd qt-everywhere-opensource-src-5.9.0

./configure -static -release -silent \
-prefix /home/runner/Qt/5.9.0_static \
-opensource -confirm-license -opengl \
-nomake examples \
-skip wayland -skip purchasing -skip serialbus -skip qtserialport -skip script -skip scxml -skip speech \
-system-xcb -qt-libpng -no-libjpeg -qt-zlib -qt-pcre -gtk -qt-harfbuzz -qt-freetype \
-pulseaudio -alsa

make -j 4
make install

cd /home/runner/Qt/
tar -cjf qt-5-9-0-static-ubuntu-14-04-x64-gcc6.tar.bz2 5.9.0_static

cd $OldDir

echo "Everything has been completed!"

Mac OS X

#!/bin/bash

OldDir=$PWD

echo Downloading...
wget http://download.qt.io/official_releases/qt/5.9/5.9.0/single/qt-everywhere-opensource-src-5.9.0.tar.xz

echo Unpacking...
tar -xf qt-everywhere-opensource-src-5.9.0.tar.xz

echo Creating /Users/StaticQt (needs root)...
if [ ! -d /Users/StaticQt ]; then
    MyUsername=$(whoami)
    sudo mkdir -p /Users/StaticQt
    sudo chmod -R $MyUsername /Users/StaticQt
fi

cd qt-everywhere-opensource-src-5.9.0

./configure -static -release -silent \
-prefix /Users/StaticQt/5.9.0 \
-opensource -confirm-license -opengl \
-nomake examples \
-skip wayland -skip purchasing -skip serialbus -skip qtserialport -skip script -skip scxml -skip speech \
-system-xcb -qt-libpng -no-libjpeg -qt-zlib -qt-pcre -gtk -qt-harfbuzz -qt-freetype

make -j 4
make install

cd /Users/StaticQt/
tar -cjf qt-5-9-0-static-macosx-10-12-5.tar.bz2 5.9.0

cd $OldDir

echo "Everything has been completed!"


Windows