This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Get Involved - Set up Qt

Tags: qt, get involve, fedora qt, get involve, fedora qt, get involve, fedora
(comma "," separated)
robbinespu
Registered Member
Posts
3
Karma
0
OS

Get Involved - Set up Qt

Fri Oct 02, 2020 7:50 am
Hello there! I am new here and plan to involve myself with KDE development..

The statement state here (https://community.kde.org/Get_Involved/development#Set_up_Qt) are making me confuse what todo next ???

I using Fedora 32. I not sure if my step to check QT version are correct or not...
Code: Select all
[rnm@b0x kdesrc-build]$ sudo dnf info qt
[sudo] password for rnm:
Last metadata expiration check: 0:53:11 ago on Fri 02 Oct 2020 02:43:17 PM +08.
Installed Packages
Name         : qt
Epoch        : 1
Version      : 4.8.7
Release      : 55.fc32
Architecture : x86_64
Size         : 18 M
Source       : qt-4.8.7-55.fc32.src.rpm
Repository   : @System
From repo    : updates
Summary      : Qt toolkit
URL          : http://qt-project.org/
License      : (LGPLv2 with exceptions or GPLv3 with exceptions) and ASL 2.0
             : and BSD and FTL and MIT
Description  : Qt is a software toolkit for developing applications.
             :
             : This package contains base tools, like string, xml, and
             : network handling.

Available Packages
Name         : qt
Epoch        : 1
Version      : 4.8.7
Release      : 55.fc32
Architecture : i686
Size         : 5.0 M
Source       : qt-4.8.7-55.fc32.src.rpm
Repository   : updates
Summary      : Qt toolkit
URL          : http://qt-project.org/
License      : (LGPLv2 with exceptions or GPLv3 with exceptions) and ASL 2.0
             : and BSD and FTL and MIT
Description  : Qt is a software toolkit for developing applications.
             :
             : This package contains base tools, like string, xml, and
             : network handling.


Based on dnf output, my qt are version 4.8.7.. the link https://community.kde.org/Get_Involved/ ... #Set_up_Qt said
If your Linux distribution provides a recent version of Qt (5.14 or newer), you can save some time and disk space and use that version instead of building your own


ok.. so i need to build it right? but how?do step https://community.kde.org/Get_Involved/ ... esrc-build already do the job?

please enlighten me. thank you
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS

Re: Get Involved - Set up Qt

Fri Oct 02, 2020 9:08 am
I prefer keeping a separated qt-build . You can get the source e.g. at https://download.qt.io/archive/qt/5.15/5.15.1/single/qt-everywhere-src-5.15.1.tar.xz and build it in a separate folder or install it as I did in /usr/local/Qt-5.15.1. Then edit your ~/.kdesrc-buildrc to use the correct path:
Code: Select all
global

    qtdir /usr/local/Qt-5.15.1/

end global


You can check if it is correctly set with
Code: Select all
kdebuild-src --query qtdir
robbinespu
Registered Member
Posts
3
Karma
0
OS

Re: Get Involved - Set up Qt

Fri Oct 02, 2020 2:01 pm
i have ~/.kdesrc-buildrc (i did't do any modification yet)
Code: Select all
[rnm@b0x kdesrc-build]$ cat  ~/.kdesrc-buildrc
# This file controls options to apply when configuring/building modules, and
# controls which modules are built in the first place.
# List of all options: https://go.kde.org/u/ksboptions

global
    # Paths

    kdedir ~/kde/usr # Where to install KF5-based software
#   qtdir  ~/kde/qt5 # Where to install Qt5 if kdesrc-build supplies it

    source-dir ~/kde/src   # Where sources are downloaded
    build-dir  ~/kde/build # Where the source build is run

    ignore-kde-structure true # Use flat structure

    # Will pull in KDE-based dependencies only, to save you the trouble of
    # listing them all below
    include-dependencies true

    cmake-options -DCMAKE_BUILD_TYPE=RelWithDebInfo

    # kdesrc-build sets 2 options which you can use in options like make-options or set-env
    # to help manage the number of compile jobs that # happen during a build:
    #
    # 1. num-cores, which is just the number of detected CPU cores, and can be passed
    #    to tools like make (needed for parallel build) or ninja (completely optional).
    #
    # 2. num-cores-low-mem, which is set to largest value that appears safe for
    #    particularly heavyweight modules based on total memory, intended for
    #    modules like qtwebengine
    num-cores 2

    num-cores-low-mem 2


    make-options  -j ${num-cores}
end global

# With base options set, the remainder of the file is used to define modules to build, in the
# desired order, and set any module-specific options.
#
# Modules may be grouped into sets, and this is the normal practice.
#
# You can include other files inline using the "include" command. We do this here
# to include files which are updated with kdesrc-build.

# Common options that should be set for some KDE modules no matter how
# kdesrc-build finds them. Do not comment these out unless you know
# what you are doing.
include /home/rnm/kde/src/kdesrc-build/kf5-common-options-build-include

# Qt and some Qt-using middleware libraries. Uncomment if your distribution's Qt
# tools are too old but be warned that Qt take a long time to build!
#include /home/rnm/kde/src/kdesrc-build/qt5-build-include
#include /home/rnm/kde/src/kdesrc-build/custom-qt5-libs-build-include

# KF5 and Plasma :)
include /home/rnm/kde/src/kdesrc-build/kf5-qt5-build-include

# To change options for modules that have already been defined, use an
# 'options' block. See kf5-common-options-build-include for an example



so currently i get
Code: Select all
$ ./kdesrc-build  --query qtdir
 * Ignoring --pretend option to download required metadata
 * --pretend mode will resume after metadata is available.
kdesrc-build encountered an exceptional error condition:
 ========
    Runtime Error: git had error exit 128 when verifying master present in repository at kde:sysadmin/repo-metadata
 ========
        Can't continue, so stopping now.


I dont have good internet right now
https://i.imgur.com/FqCVSbf.png

i will download it first, extract and run kdesrc-build --query qtdir again.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS

Re: Get Involved - Set up Qt

Fri Oct 02, 2020 4:46 pm
robbinespu wrote:i have ~/.kdesrc-buildrc (i did't do any modification yet)
Code: Select all

#   qtdir  ~/kde/qt5 # Where to install Qt5 if kdesrc-build supplies it


Commentet out means it uses the system-qt. So there is no need to check as there is no custom qt and the results all would be empty. This is only valid in case you use a custom qt as in my example. You have to set up Qt first, then use kdesrc-build to build your wanted kde-package(s) against this custom qt.

You may uncomment it anyway and set it to ~/wherever/qt/should/be/build/into. If kdesrc builds qt for you, that is the place where to put it. Defaults to ~/kde/qt5 as mentioned in the comment.
robbinespu
Registered Member
Posts
3
Karma
0
OS

Re: Get Involved - Set up Qt

Sat Oct 03, 2020 6:22 am
I download and extract qt-everywhere-src-5.15.1 to ~/kde/qt5/qt-everywhere-src-5.15.1/
Code: Select all
$ ls ~/kde/qt5/qt-everywhere-src-5.15.1/
_clang-format   LICENSE.GPLv3                 qtcharts            qtlocation     qtquickcontrols   qtserialport       qtwebengine
coin            LICENSE.LGPLv21               qtconnectivity      qtlottie       qtquickcontrols2  qtspeech           qtwebglplugin
configure       LICENSE.LGPLv3                qtdatavis3d         qtmacextras    qtquicktimeline   qtsvg              qtwebsockets
configure.bat   LICENSE.QT-LICENSE-AGREEMENT  qtdeclarative       qtmultimedia   qtremoteobjects   qttools            qtwebview
configure.json  qt3d                          qtdoc               qtnetworkauth  qtscript          qttranslations     qtwinextras
gnuwin32        qtactiveqt                    qtgamepad           qt.pro         qtscxml           qtvirtualkeyboard  qtx11extras
LICENSE.FDL     qtandroidextras               qtgraphicaleffects  qtpurchasing   qtsensors         qtwayland          qtxmlpatterns
LICENSE.GPLv2   qtbase                        qtimageformats      qtquick3d      qtserialbus       qtwebchannel       README


I add new line
Code: Select all
$ cat ~/.kdesrc-buildrc | grep qtdir
#   qtdir  ~/kde/qt5 # Where to install Qt5 if kdesrc-build supplies it
    qtdir  ~/kde/qt5/qt-everywhere-src-5.15.1 #rob - fedora use older qt,so we need to supply the latest qt src

$ cat ~/.kdesrc-buildrc
# This file controls options to apply when configuring/building modules, and
# controls which modules are built in the first place.
# List of all options: https://go.kde.org/u/ksboptions

global
    # Paths

    kdedir ~/kde/usr # Where to install KF5-based software
#   qtdir  ~/kde/qt5 # Where to install Qt5 if kdesrc-build supplies it
    qtdir  ~/kde/qt5/qt-everywhere-src-5.15.1 #rob - fedora use older qt,so we need to supply the latest qt src

    source-dir ~/kde/src   # Where sources are downloaded
    build-dir  ~/kde/build # Where the source build is run

    ignore-kde-structure true # Use flat structure

    # Will pull in KDE-based dependencies only, to save you the trouble of
    # listing them all below
    include-dependencies true

    cmake-options -DCMAKE_BUILD_TYPE=RelWithDebInfo

    # kdesrc-build sets 2 options which you can use in options like make-options or set-env
    # to help manage the number of compile jobs that # happen during a build:
    #
    # 1. num-cores, which is just the number of detected CPU cores, and can be passed
    #    to tools like make (needed for parallel build) or ninja (completely optional).
    #
    # 2. num-cores-low-mem, which is set to largest value that appears safe for
    #    particularly heavyweight modules based on total memory, intended for
    #    modules like qtwebengine
    num-cores 2

    num-cores-low-mem 2


    make-options  -j ${num-cores}
end global

# With base options set, the remainder of the file is used to define modules to build, in the
# desired order, and set any module-specific options.
#
# Modules may be grouped into sets, and this is the normal practice.
#
# You can include other files inline using the "include" command. We do this here
# to include files which are updated with kdesrc-build.

# Common options that should be set for some KDE modules no matter how
# kdesrc-build finds them. Do not comment these out unless you know
# what you are doing.
include /home/rnm/kde/src/kdesrc-build/kf5-common-options-build-include

# Qt and some Qt-using middleware libraries. Uncomment if your distribution's Qt
# tools are too old but be warned that Qt take a long time to build!
#include /home/rnm/kde/src/kdesrc-build/qt5-build-include
#include /home/rnm/kde/src/kdesrc-build/custom-qt5-libs-build-include

# KF5 and Plasma :)
include /home/rnm/kde/src/kdesrc-build/kf5-qt5-build-include

# To change options for modules that have already been defined, use an
# 'options' block. See kf5-common-options-build-include for an example


but when i execute the query, i get something like git error
Code: Select all
$ pwd
/home/rnm/kde/src/kdesrc-build

$ ./kdesrc-build --query qtdir
 * Ignoring --pretend option to download required metadata
 * --pretend mode will resume after metadata is available.
kdesrc-build encountered an exceptional error condition:
 ========
    Runtime Error: git had error exit 128 when verifying master present in repository at kde:sysadmin/repo-metadata
 ========
        Can't continue, so stopping now.


1 ) i don't know why that git error happen... do i need special access to https://invent.kde.org/sysadmin/repo-metadata ? ( i read and check kdesrc-build script, unable to found it do what (pull / clone ?) on git. but surely i found a comment said about git stuff

2) may i ask you said "kdebuild-src" but that is typo right?

3) the qt , i did't do anything. just extract and put the location inside ~/.kdesrc-buildrc file. So do I also need to configure, make, make install ? (do it will interrupt my current installed qt?)
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS

Re: Get Involved - Set up Qt

Sat Oct 03, 2020 6:34 pm
QT:
robbinespu wrote:I download and extract qt-everywhere-src-5.15.1 to ~/kde/qt5/qt-everywhere-src-5.15.1/

You missed to build it. It is not just a download. There is a lfs link explaining the details: http://www.linuxfromscratch.org/blfs/view/svn/x/qt5.html. Read it carefully as it is not a copy and paste thing and you have to adopt it to your distributions environment! Ensure that you do not overwrite your current Qt-Version as this could mess up your system. After successfully having compiled Qt you can switch over to the KDE-Stuff — or you comment the line in and let kdesrc get Qt for you (I think this will use Qt5.14 but I'm not quite sure about.
You can have more than one Qt-Version installed at once, but you have to configure it manually, like you already tried in the ~/.kdesrc-buildrc

If compiling Qt is too much for now, you can skip this step and just concentrate on a properly set up kde environment. If you are barely new to compiling and installing from source code packages, I would advise you to use a virtual machine for the first tries. You can e.g. easily install a KVM-machine using the virt-manager package. There you can choose a dsitribution with a more current release of Qt5 and just concentrate on the kde-part. The counter part is, that it will slow down compiling, depending on your system.

KDE:
Did you initialize your kdesrc like described here? Did you configure git as described on the page? The global git configuration should be in ~/.gitconfig on a default git-setup. Again: Read this page carefully.

may i ask you said "kdebuild-src" but that is typo right?

Yes, sorry. We only need kdesrc-build and after successful having build the first application, kdesrc-run

For now, forget running --query qtdir as it does not work until you get a running setup. Try setting up kdesrc and test with
Code: Select all
kdesrc-build kcalc
duosvid
Registered Member
Posts
1
Karma
0

Re: Get Involved - Set up Qt

Wed Jul 13, 2022 8:53 am
i was also looking for the setup, vidmate.app saveinsta


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]