Web lists-archives.com

Re: Building Qt with kdesrc-build

On Sat, Oct 14, 2017 at 07:19:38AM +0100, Bob Ham wrote:
> Hi all,
> I'm trying to build Qt using kdesrc-build on Debian Stretch.  I've
> successfully built a number of KDE modules but now I've come up
> against plasma-workspace's dependency on Qt >= 5.9.0 which Stretch
> doesn't provide.
> I've followed the instructions here
> https://docs.kde.org/trunk5/en/extragear-utils/kdesrc-build/basic-features.html
> but unfortunately a number of Qt packages fail to build as
> kdesrc-build expects a CMakeLists.txt file:
> rah@myrtle:~/proj/plasma-mobile/kdesrc$ grep "Error" $( ls -1rt src/log/latest/*/cmake.log | tail -n 3 )
> src/log/latest/qtmultimedia/cmake.log:CMake Error: The source directory "/home/rah/proj/plasma-mobile/kdesrc/src/qt5/qtmultimedia" does not appear to contain CMakeLists.txt.
> src/log/latest/qtdeclarative/cmake.log:CMake Error: The source directory "/home/rah/proj/plasma-mobile/kdesrc/src/qt5/qtdeclarative" does not appear to contain CMakeLists.txt.
> src/log/latest/qtwayland/cmake.log:CMake Error: The source directory "/home/rah/proj/plasma-mobile/kdesrc/src/qt5/qtwayland" does not appear to contain CMakeLists.txt.
> I've taken a look at some of the kdesrc-build source and played around
> but I don't really understand how the different build system classes
> are meant to change kdesrc-build's behaviour, or what behaviour is
> expected for Qt.
> Is it expected that kdesrc-build should build Qt5 without issue and if
> so, how?

It is not currently expected for kdesrc-build to be able to build Qt5.
The Qt5 developers themselves provide a fairly robust infrastructure for
building Qt5 from git, if your distribution does not have updated
packages available.  This infrastructure is useful since some of the Qt5
modules use git features that are a bit more sophisticated than what KDE
uses (and therefore are not currently well-supported in kdesrc-build).
For instance qtwebengine has an embedded Chromium source which is
maintained using the git-submodule command.

With that said, kdesrc-build is not very far from being able to support
Qt5.  The attached file seems to work for me, when used with the changes
I just pushed to kdesrc-build.  I have only tested this with existing
sources however, though there's no reason a git-clone should fail.

You could adjust some of the options (e.g. source-dir and build-dir) to
make them specific to Qt or just inherent from the global settings.

This should hopefully help to get you started.  The Qt modules should
probably go before any KDE-based modules, and you'll want to make sure
your qtdir setting points to where you want kdesrc-build to install Qt5

 - Michael Pyne
# For this all to work, you also need to add the following line
# to the global section of your kdesrc-buildrc, and make sure to
# uncomment it:
#    git-repository-base qt-git git://code.qt.io/qt/

module-set qt5-modules
    repository qt-git # As set in git-repository-base
    use-modules qtbase.git qtxmlpatterns.git qtwebsockets.git      \
                qttools.git qtdoc.git qtsvg.git qtdeclarative.git  \
                qtwebchannel.git qtscript.git qtwebview.git        \
                qtquickcontrols.git qtquickcontrols2.git           \
                qtgraphicaleffects.git qtwebengine.git             \
                qtx11extras.git qtwebkit.git
    branch 5.9   # or "dev", if you wish
#    qtdir ~/qt5 # make sure this is already set in global

    # These need to be the same dir for most Qt modules since Qt code
    # doesn't always fully support srcdir != builddir
    # But kdesrc-build will simulate the effect (after 2017-10-15) so that
    # you can use a different build dir, which makes --refresh-build work.
    # Run "git clean -dfx" in an existing source dir to remove build artifacts
#    source-dir /kdesrc/src/qt5
#    build-dir  /kdesrc/build/qt5
end module-set

options qtbase
    override-build-system qt    # help kdesrc-build avoid confusion with qmake
    configure-flags -silent -nomake examples
end options