User:Nmariusp/More: Difference between revisions
(How kdesrc-build runs cmake configure) |
(Build Qt using kde-builder) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== | == Qt 6 installed using the Qt online installer == | ||
A screen recording version is available https://www.youtube.com/watch?v=3BIbYN2vIZw | |||
The homepage of the Qt Framework is https://www.qt.io . Go to this web page, create an online account. https://www.qt.io/download-open-source > "Download the Qt Online Installer" > Linux x64 > "Qt Online Installer for Linux (x64)" > download a file named e.g. qt-online-installer-linux-x64-4.8.1.run into the directory e.g. "~/Downloads". | |||
<pre> | |||
ls -la ~/Downloads # The downloaded file needs to have the "executable" chmod bit set. | |||
chmod u+x ~/Downloads/qt-online-installer-linux-x64-4.8.1.run | |||
~/Downloads/qt-online-installer-linux-x64-4.8.1.run | |||
</pre> | |||
A graphical user interface (GUI) installer wizard starts. Login using your Qt online account. Next > check the checkbox "I have read and agree to the terms and conditions of using OpenSource Qt", check the checkbox "I'm an individual and do not use Qt for any company" > Next > Next > enable "Help us improve" > Next > Custom installation, notice that the install directory is "~/Qt" > Next. Install the latest version of Qt6 and the latest version of the Qt Creator integrated development environment (IDE). There are some Qt6 components that are not used by KDE and can be left out when installing Qt6 e.g. Qt Design Studio, WebAssembly, Android, Sources, Qt Quick 3D, Qt 3D, Qt Quick 3D Physics, "Qt Debug Information Files". Next > enable "I have read and agree" > Next > Install. | |||
In the KDE Plasma app launcher (start menu) you now have the application "Qt Maintenance Tool". | |||
Set up kde-builder from scratch as usual. | |||
Edit the file kde-builder.yaml to look like: | |||
<pre> | |||
global: | |||
... | |||
qt-install-dir: ~/Qt/6.8.1/gcc_64 # Directory to install Qt if kde-builder supplies it | |||
</pre> | |||
== Build Qt using kde-builder == | |||
=== Qt6 === | |||
If you cannot build the KDE frameworks using {{ic|kde-builder}} and the Qt provided by your Linux distribution is outdated, you might want to build the Qt framework using {{ic|kde-builder}}. | |||
In your configuration file use the {{ic|qt-install-dir}} option (in the ''global'' section) with non-empty value, for example: | |||
{{bc| | |||
global | |||
qt-install-dir ~/kde/usr | |||
branch-group kf6-qt6 | |||
end global | |||
}} | |||
It is recommended that if you build Qt6 using kde-builder, you also build qtwebengine. Edit the file {{ic|~/.local/state/sysadmin-repo-metadata/module-definitions/qt6.ksb}}. Follow the instructions found in the file: if you want qtwebengine, add it to use-modules after "qtwebchannel" and comment out the line "ignore-modules qtwebengine". | |||
<pre> | |||
kde-builder qtbase --refresh-build --debug | |||
</pre> | |||
Press Ctrl+C after the CMake configure summary for qtbase. Make sure that you have the needed dependencies. Should find libb2-dev, libproxy-dev, libmd4c-dev, libmd4c-html0-dev, libxcb-xinput-dev, libatspi2.0-dev, libsqlite3-dev, unixodbc-dev, libmysqlclient-dev, postgresql-client, libecpg-dev, libpq-dev. Optional dependencies libsctp-dev, libts-dev. | |||
<pre> | |||
kde-builder qtwebengine | |||
</pre> | |||
This will build the Qt6 modules from qtbase up to qtwebengine. qtwebengine will probably be built incorrectly because some needed dependencies are missing. | |||
<pre> | <pre> | ||
kde-builder qtwebengine --refresh-build --debug | |||
</pre> | |||
Press Ctrl+C after the CMake configure summary for qtwebengine. Make sure that you have the needed dependencies. Should find node.js >= 14, libdbus-1-dev, libxcomposite-dev, libxshmfence-dev, libxdamage-dev, libharfbuzz-dev, libvpx-dev, libpci-dev, libevent-dev, libre2-dev, libsnappy-dev, libcups2-dev, libxkbfile-dev. | |||
Then build Qt6: {{bc|kde-builder qt6-set}} | |||
To compile Qt6 with Qt X11 Extras (which is a necessary library to compile [https://api.kde.org/frameworks/kwindowsystem/html/ KWindowSystem]), you should enable XCB feature during compilation | |||
{{bc|1=kde-builder qt6-set --cmake-options="-DQT_FEATURE_xcb=ON"}} | |||
=== Qt5 === | |||
If you want the same for Qt5, change {{ic|branch-group}} option and use {{ic|qt5-set}} instead of {{ic|qt6-set}}. | |||
==How does kdesrc-build build extra-cmake-modules== | |||
<pre> | |||
Running cmake targeting Kate - Ninja... | |||
cd /home/username/kde/build/extra-cmake-modules | cd /home/username/kde/build/extra-cmake-modules | ||
Line 14: | Line 81: | ||
# kdesrc-build running: 'cmake' '-B' '.' '-S' '/home/username/kde/src/extra-cmake-modules' '-G' 'Kate - Ninja' '-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON' '-DCMAKE_BUILD_TYPE=Debug' '-DBUILD_WITH_QT6=ON' '-DCMAKE_CXX_FLAGS:STRING=-pipe' '-DCMAKE_INSTALL_PREFIX=/home/username/kde/usr' | # kdesrc-build running: 'cmake' '-B' '.' '-S' '/home/username/kde/src/extra-cmake-modules' '-G' 'Kate - Ninja' '-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON' '-DCMAKE_BUILD_TYPE=Debug' '-DBUILD_WITH_QT6=ON' '-DCMAKE_CXX_FLAGS:STRING=-pipe' '-DCMAKE_INSTALL_PREFIX=/home/username/kde/usr' | ||
# from directory: /home/username/kde/build/extra-cmake-modules | # from directory: /home/username/kde/build/extra-cmake-modules | ||
... | |||
Compiling... | |||
cd /home/username/kde/build/extra-cmake-modules | |||
run_logged_command(): Module extra-cmake-modules, Command: ninja -j 16 | |||
Setting environment variable CMAKE_PREFIX_PATH to /home/username/kde/usr | |||
Setting environment variable QT_PLUGIN_PATH to /home/username/kde/usr/lib64/plugins:/home/username/kde/usr/lib/plugins | |||
Setting environment variable CMAKE_MODULE_PATH to /home/username/kde/usr/lib64/cmake:/home/username/kde/usr/lib/cmake | |||
Setting environment variable LD_LIBRARY_PATH to /home/username/kde/usr/lib/x86_64-linux-gnu | |||
Setting environment variable XDG_DATA_DIRS to /home/username/kde/usr/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop | |||
Setting environment variable PKG_CONFIG_PATH to /home/username/kde/usr/lib/x86_64-linux-gnu/pkgconfig | |||
Setting environment variable PATH to /home/username/kde/usr/bin:/home/username/.local/bin:/home/username/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin | |||
# kdesrc-build running: 'ninja' '-j' '16' | |||
# from directory: /home/username/kde/build/extra-cmake-modules | |||
... | |||
Installing extra-cmake-modules | |||
cd /home/username/kde/build/extra-cmake-modules | |||
run_logged_command(): Module extra-cmake-modules, Command: ninja install | |||
Setting environment variable CMAKE_PREFIX_PATH to /home/username/kde/usr | |||
Setting environment variable QT_PLUGIN_PATH to /home/username/kde/usr/lib64/plugins:/home/username/kde/usr/lib/plugins:/home/username/kde/usr/lib64/plugins:/home/username/kde/usr/lib/plugins | |||
Setting environment variable CMAKE_MODULE_PATH to /home/username/kde/usr/lib64/cmake:/home/username/kde/usr/lib/cmake:/home/username/kde/usr/lib64/cmake:/home/username/kde/usr/lib/cmake | |||
Setting environment variable XDG_DATA_DIRS to /home/username/kde/usr/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop | |||
Setting environment variable PKG_CONFIG_PATH to /home/username/kde/usr/lib/x86_64-linux-gnu/pkgconfig | |||
Setting environment variable LD_LIBRARY_PATH to /home/username/kde/usr/lib/x86_64-linux-gnu | |||
Setting environment variable PATH to /home/username/kde/usr/bin:/home/username/.local/bin:/home/username/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin | |||
# kdesrc-build running: 'ninja' 'install' | |||
# from directory: /home/username/kde/build/extra-cmake-modules | |||
</pre> | |||
==OpenIndiana >= 2024.04== | |||
<pre> | |||
pkg update | |||
pkg install git | |||
pkg install build-essential cmake ninja qt6 | |||
</pre> | </pre> |
Latest revision as of 22:30, 6 December 2024
Qt 6 installed using the Qt online installer
A screen recording version is available https://www.youtube.com/watch?v=3BIbYN2vIZw
The homepage of the Qt Framework is https://www.qt.io . Go to this web page, create an online account. https://www.qt.io/download-open-source > "Download the Qt Online Installer" > Linux x64 > "Qt Online Installer for Linux (x64)" > download a file named e.g. qt-online-installer-linux-x64-4.8.1.run into the directory e.g. "~/Downloads".
ls -la ~/Downloads # The downloaded file needs to have the "executable" chmod bit set. chmod u+x ~/Downloads/qt-online-installer-linux-x64-4.8.1.run ~/Downloads/qt-online-installer-linux-x64-4.8.1.run
A graphical user interface (GUI) installer wizard starts. Login using your Qt online account. Next > check the checkbox "I have read and agree to the terms and conditions of using OpenSource Qt", check the checkbox "I'm an individual and do not use Qt for any company" > Next > Next > enable "Help us improve" > Next > Custom installation, notice that the install directory is "~/Qt" > Next. Install the latest version of Qt6 and the latest version of the Qt Creator integrated development environment (IDE). There are some Qt6 components that are not used by KDE and can be left out when installing Qt6 e.g. Qt Design Studio, WebAssembly, Android, Sources, Qt Quick 3D, Qt 3D, Qt Quick 3D Physics, "Qt Debug Information Files". Next > enable "I have read and agree" > Next > Install.
In the KDE Plasma app launcher (start menu) you now have the application "Qt Maintenance Tool".
Set up kde-builder from scratch as usual.
Edit the file kde-builder.yaml to look like:
global: ... qt-install-dir: ~/Qt/6.8.1/gcc_64 # Directory to install Qt if kde-builder supplies it
Build Qt using kde-builder
Qt6
If you cannot build the KDE frameworks using kde-builder
and the Qt provided by your Linux distribution is outdated, you might want to build the Qt framework using kde-builder
.
In your configuration file use the qt-install-dir
option (in the global section) with non-empty value, for example:
global qt-install-dir ~/kde/usr branch-group kf6-qt6 end global
It is recommended that if you build Qt6 using kde-builder, you also build qtwebengine. Edit the file ~/.local/state/sysadmin-repo-metadata/module-definitions/qt6.ksb
. Follow the instructions found in the file: if you want qtwebengine, add it to use-modules after "qtwebchannel" and comment out the line "ignore-modules qtwebengine".
kde-builder qtbase --refresh-build --debug
Press Ctrl+C after the CMake configure summary for qtbase. Make sure that you have the needed dependencies. Should find libb2-dev, libproxy-dev, libmd4c-dev, libmd4c-html0-dev, libxcb-xinput-dev, libatspi2.0-dev, libsqlite3-dev, unixodbc-dev, libmysqlclient-dev, postgresql-client, libecpg-dev, libpq-dev. Optional dependencies libsctp-dev, libts-dev.
kde-builder qtwebengine
This will build the Qt6 modules from qtbase up to qtwebengine. qtwebengine will probably be built incorrectly because some needed dependencies are missing.
kde-builder qtwebengine --refresh-build --debug
Press Ctrl+C after the CMake configure summary for qtwebengine. Make sure that you have the needed dependencies. Should find node.js >= 14, libdbus-1-dev, libxcomposite-dev, libxshmfence-dev, libxdamage-dev, libharfbuzz-dev, libvpx-dev, libpci-dev, libevent-dev, libre2-dev, libsnappy-dev, libcups2-dev, libxkbfile-dev.
Then build Qt6:
kde-builder qt6-set
To compile Qt6 with Qt X11 Extras (which is a necessary library to compile KWindowSystem), you should enable XCB feature during compilation
kde-builder qt6-set --cmake-options="-DQT_FEATURE_xcb=ON"
Qt5
If you want the same for Qt5, change branch-group
option and use qt5-set
instead of qt6-set
.
How does kdesrc-build build extra-cmake-modules
Running cmake targeting Kate - Ninja... cd /home/username/kde/build/extra-cmake-modules run_logged_command(): Module extra-cmake-modules, Command: cmake -B . -S /home/username/kde/src/extra-cmake-modules -G Kate - Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_WITH_QT6=ON -DCMAKE_CXX_FLAGS:STRING=-pipe -DCMAKE_INSTALL_PREFIX=/home/username/kde/usr Setting environment variable LD_LIBRARY_PATH to /home/username/kde/usr/lib/x86_64-linux-gnu Setting environment variable XDG_DATA_DIRS to /home/username/kde/usr/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop Setting environment variable PKG_CONFIG_PATH to /home/username/kde/usr/lib/x86_64-linux-gnu/pkgconfig Setting environment variable PATH to /home/username/kde/usr/bin:/home/username/.local/bin:/home/username/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin Setting environment variable CMAKE_PREFIX_PATH to /home/username/kde/usr Setting environment variable QT_PLUGIN_PATH to /home/username/kde/usr/lib64/plugins:/home/username/kde/usr/lib/plugins Setting environment variable CMAKE_MODULE_PATH to /home/username/kde/usr/lib64/cmake:/home/username/kde/usr/lib/cmake # kdesrc-build running: 'cmake' '-B' '.' '-S' '/home/username/kde/src/extra-cmake-modules' '-G' 'Kate - Ninja' '-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON' '-DCMAKE_BUILD_TYPE=Debug' '-DBUILD_WITH_QT6=ON' '-DCMAKE_CXX_FLAGS:STRING=-pipe' '-DCMAKE_INSTALL_PREFIX=/home/username/kde/usr' # from directory: /home/username/kde/build/extra-cmake-modules ... Compiling... cd /home/username/kde/build/extra-cmake-modules run_logged_command(): Module extra-cmake-modules, Command: ninja -j 16 Setting environment variable CMAKE_PREFIX_PATH to /home/username/kde/usr Setting environment variable QT_PLUGIN_PATH to /home/username/kde/usr/lib64/plugins:/home/username/kde/usr/lib/plugins Setting environment variable CMAKE_MODULE_PATH to /home/username/kde/usr/lib64/cmake:/home/username/kde/usr/lib/cmake Setting environment variable LD_LIBRARY_PATH to /home/username/kde/usr/lib/x86_64-linux-gnu Setting environment variable XDG_DATA_DIRS to /home/username/kde/usr/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop Setting environment variable PKG_CONFIG_PATH to /home/username/kde/usr/lib/x86_64-linux-gnu/pkgconfig Setting environment variable PATH to /home/username/kde/usr/bin:/home/username/.local/bin:/home/username/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin # kdesrc-build running: 'ninja' '-j' '16' # from directory: /home/username/kde/build/extra-cmake-modules ... Installing extra-cmake-modules cd /home/username/kde/build/extra-cmake-modules run_logged_command(): Module extra-cmake-modules, Command: ninja install Setting environment variable CMAKE_PREFIX_PATH to /home/username/kde/usr Setting environment variable QT_PLUGIN_PATH to /home/username/kde/usr/lib64/plugins:/home/username/kde/usr/lib/plugins:/home/username/kde/usr/lib64/plugins:/home/username/kde/usr/lib/plugins Setting environment variable CMAKE_MODULE_PATH to /home/username/kde/usr/lib64/cmake:/home/username/kde/usr/lib/cmake:/home/username/kde/usr/lib64/cmake:/home/username/kde/usr/lib/cmake Setting environment variable XDG_DATA_DIRS to /home/username/kde/usr/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop Setting environment variable PKG_CONFIG_PATH to /home/username/kde/usr/lib/x86_64-linux-gnu/pkgconfig Setting environment variable LD_LIBRARY_PATH to /home/username/kde/usr/lib/x86_64-linux-gnu Setting environment variable PATH to /home/username/kde/usr/bin:/home/username/.local/bin:/home/username/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin # kdesrc-build running: 'ninja' 'install' # from directory: /home/username/kde/build/extra-cmake-modules
OpenIndiana >= 2024.04
pkg update pkg install git pkg install build-essential cmake ninja qt6