#!/bin/bash #ref: https://doc.qt.io/qt-6/build-sources.html # Building from a tarball like # https://download.qt.io/official_releases/qt/6.6/6.6.2/single/qt-everywhere-6.6.2.tar.xz # appears to only contain some of the qt libraries, but not all that we # need. So we are trying to build Qt and all it's needed libraries from # a git repo. It may be that qt-everywhere-6.6.2.tar.xz contains all of # the source we need, but it's currently broken (we failed to build with # it). # # Looks like downloading Qt6 sources from the git server is faster than # downloading it the tarball from https://download.qt.io/ even when # including the running of init-repository which downloads most of the # code. # Looks like we have a git tag and a git branch that that tag is in: tag=v6.7.0 swtag=6.7 #tag=v6.6.2 gitSrcDir=qt6-$tag-git_source set -exo pipefail cd "$(dirname ${BASH_SOURCE[0]})" function FAIL() { set +x echo "Checking out Qt source $tag code FAILED" exit 1 } if [ ! -d $gitSrcDir ] ; then git clone git://code.qt.io/qt/qt5.git $gitSrcDir || FAIL $(cd $gitSrcDir && ./init-repository) || FAIL # This command I do not understand: $(cd $gitSrcDir && git switch $swtag) || FAIL $(cd $gitSrcDir && git checkout $tag) || FAIL fi # At this point the directory $gitSrcDir exists try=0 builddir=qt6_build-try$try while [ -d $builddir ] ; do let try=$try+1 builddir=qt6_build-try$try done # We'll assume that building in $buildDir does not change files in $gitSrcDir mkdir "$builddir" cd "$builddir" prefix=/usr/local/encap/qt6-$tag #../$gitSrcDir/configure --prefix=$prefix -debug -static # fails ../$gitSrcDir/configure --prefix=$prefix -debug cmake --build . --parallel 9 cmake --install . cd - set +x cat << EOF SUCCESSFULLY installed $prefix EOF