%general-entities; ]> $LastChangedBy$ $Date$ Qt-&qt5-version; Modules Qt Modules After the has been installed, various modules can be added to provide more functionalities. They are divided in several groups, each of which depends on the precedent: are used in almost all Qt5 based applications, and must be built first. are needed for and . is a huge module that integrates chromium's web capabilities into Qt5 are not needed for building packages in the book, but can be built for a complete installation of Qt5 &lfs10_checked; Package Information Download (HTTP): Download (FTP): Download MD5 sum: &qt5-md5sum; Download size: &qt5-size; Estimated disk space required: &qt5-buildsize; Estimated build time: &qt5-time; Creating the module list and utility functions Create the list of modules in the proper order as follows: cat > qt5-submodules-&qt5-version;.md5 << "EOF" # Begin basic group 739403634e1326a3d52902a835015a4b qttools-everywhere-src-5.15.2.tar.xz c0f5c1c2cc1b66e56ce4ef13a2b7093a qtsvg-everywhere-src-5.15.2.tar.xz 92cf72015788bb4dcab14494f2835b32 qtx11extras-everywhere-src-5.15.2.tar.xz 26577fbbe0d011b7034bca3c64bc38ae qtwayland-everywhere-src-5.15.2.tar.xz # End basic group # Begin KDE group db3c185d6f13fc60828f8f9f20e092c4 qtdeclarative-everywhere-src-5.15.2.tar.xz 2abc5e7b8e6b4a80d7533daad37749e9 qtquickcontrols2-everywhere-src-5.15.2.tar.xz 2ae1ef858425aa71d62b15467a84b022 qtgraphicaleffects-everywhere-src-5.15.2.tar.xz ef96631d72399cfa495f223ef21bb039 qtxmlpatterns-everywhere-src-5.15.2.tar.xz # TODO # End KDE group # Begin qtwebengine c88cbe3158feb20c4feb3d54262feb23 qtwebengine-everywhere-src-5.15.2.tar.xz # End qtwebengine # Begin optional group # TODO # End optional group EOF Next create two utility functions, one for switching to user root, the other for module building: as_root() { if [ "$EUID" = 0 ]; then $* elif [ -x /usr/bin/sudo ]; then sudo -E $* else su -c \\"$*\\" fi } export -f as_root module_build() { # MD5_ENTRY contains the md5sum entry from the .md5 file for this module echo $MD5_ENTRY | { read md5 tarball # download wget &qt5-download-http;$tarball md5sum -c - <<< "$MD5_ENTRY" || exit 1 packagedir=${tarball%.tar*} tar -xf $tarball pushd $packagedir # OPTIONS contains the qmake options if [ -n "$OPTIONS" ]; then qmake -- $OPTIONS else qmake fi make as_root make install if type -p post_install; then post_install; fi popd rm -rf $packagedir } as_root /sbin/ldconfig # Remove references to the build directory from installed library # dependency (prl) files: as_root find $QT5DIR/ -name \*.prl \ -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; } export -f module_build Basic Qt5 Modules The modules in this group only depend on and a properly set QT5DIR environment variable. Install the basic modules with the following instructions: ( # start a subshell set -e # exit the subshell in case of error unset OPTIONS sed -n "/Begin basic/,/End basic/p" qt5-submodules-&qt5-version;.md5 | \ while read MD5_ENTRY; do if [ -z "${MD5_ENTRY%\#*}" ]; then continue; fi case "$MD5_ENTRY" in *qttools*) post_install(){ QT5BINDIR=$QT5DIR/bin as_root sh << ROOT_EOF install -v -dm755 /usr/share/pixmaps/ install -v -Dm644 src/assistant/assistant/images/assistant-128.png \ /usr/share/pixmaps/assistant-qt5.png install -v -Dm644 src/designer/src/designer/images/designer.png \ /usr/share/pixmaps/designer-qt5.png install -v -Dm644 src/linguist/linguist/images/icons/linguist-128-32.png \ /usr/share/pixmaps/linguist-qt5.png install -v -Dm644 src/qdbus/qdbusviewer/images/qdbusviewer-128.png \ /usr/share/pixmaps/qdbusviewer-qt5.png install -dm755 /usr/share/applications cat > /usr/share/applications/assistant-qt5.desktop << EOF [Desktop Entry] Name=Qt5 Assistant Comment=Shows Qt5 documentation and examples Exec=$QT5BINDIR/assistant Icon=assistant-qt5.png Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Development;Documentation; EOF cat > /usr/share/applications/designer-qt5.desktop << EOF [Desktop Entry] Name=Qt5 Designer GenericName=Interface Designer Comment=Design GUIs for Qt5 applications Exec=$QT5BINDIR/designer Icon=designer-qt5.png MimeType=application/x-designer; Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Development; EOF cat > /usr/share/applications/linguist-qt5.desktop << EOF [Desktop Entry] Name=Qt5 Linguist Comment=Add translations to Qt5 applications Exec=$QT5BINDIR/linguist Icon=linguist-qt5.png MimeType=text/vnd.trolltech.linguist;application/x-linguist; Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Development; EOF cat > /usr/share/applications/qdbusviewer-qt5.desktop << EOF [Desktop Entry] Name=Qt5 QDbusViewer GenericName=D-Bus Debugger Comment=Debug D-Bus applications Exec=$QT5BINDIR/qdbusviewer Icon=qdbusviewer-qt5.png Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Development;Debugger; EOF ROOT_EOF } export -f post_install ;; *) unset -f post_install ;; esac module_build done # Some packages such as vlc look for certain # executables with a -qt5 suffix: for file in lconvert lrelease lupdate; do as_root ln -sfrvn $QT5DIR/bin/$file /usr/bin/$file-qt5 done ) Contents of basic modules Installed Programs Installed Libraries Installed Directories assistant, designer, lconvert, linguist, lprodump, lrelease, lrelease-pro, lupdate, lupdate-pro, pixeltool, qcollectiongenerator, qdbus, qdbusviewer, qdoc, qhelpgenerator, qtattributionsscanner, qtdiag, qtpaths, qtplugininfo, and qtwaylandscanner libQt5DesignerComponents.so, libQt5Designer.so, libQt5Help.so, libQt5Svg.so, libQt5WaylandClient.so, libQt5WaylandCompositor.so, and libQt5X11Extras.so $QT5DIR/phrasebooks, $QT5DIR/include/{QtUiTools,QtHelp,QtDesigner,QtX11Extras,QtSvg}, $QT5DIR/include/{QtWaylandCompositor,QtWaylandClient}, $QT5DIR/include/{QtDesignerComponents,QtUiPlugin}, $QT5DIR/lib/cmake/{Qt5AttributionsScannerTools,Qt5Help,Qt5Designer}, $QT5DIR/lib/cmake/{Qt5X11Extras,Qt5Svg,Qt5UiTools,Qt5DocTools}, $QT5DIR/lib/cmake/{Qt5WaylandCompositor,Qt5WaylandClient}, $QT5DIR/lib/cmake/{Qt5DesignerComponents,Qt5UiPlugin}, $QT5DIR/lib/cmake/Qt5LinguistTools, $QT5DIR/plugins/wayland-graphics-integration-client, $QT5DIR/plugins/wayland-graphics-integration-server, $QT5DIR/plugins/wayland-decoration-client, and $QT5DIR/plugins/iconengines Short Descriptions lconvert is part of Qt5's Linguist tool chain. It can be used as a standalone tool to convert and filter translation data files. lconvert linguist provides support for translating applications into local languages. linguist lrelease is a simple command line tool. It reads XML-based translation file in TS format and produces message files used by the application. lrelease lrelease-pro extracts project information from qmake projects and passes it to lrelease. lrelease-pro lupdate finds the translatable strings in the specified source, header and Qt Designer interface files, and stores the extracted messages in translation files to be processed by lrelease. lupdate lupdate-pro reads a Qt project file, an passes the collected information to lupdate. lupdate-pro pixeltool is a desktop magnifier and as you move your mouse around the screen it will show the magnified contents in its window. pixeltool qcollectiongenerator processes and converts Qt help files. qcollectiongenerator-qt5 qdbus lists available services, object paths, methods, signals, and properties of objects on a bus. qdbus qdbusviewer is a graphical D-Bus browser. qdbusviewer qdoc is a tool used by Qt Developers to generate documentation for software projects. qdoc qhelpgenerator is a tool used to generate a Qt compressed help file. qhelpgenerator qtattributionsscanner processes qt_attribution.json files in Qt sources. qtattributionsscanner qtdiag is a tool for reporting diagnostic information about Qt and its environment. qtdiag qtpaths is a tool to query Qt path information. qtpaths qtplugininfo dumps meta-data about Qt plugins in JSON format. qtplugininfo Modules Needed for KDE Install the modules needed for KDE with the following instructions: QTWebEngine Install QtWebEngine with the following instructions: Other Modules Install the remaining modules with the following instructions: Installation of Qt5 If Qt5 is being reinstalled into the same directory as an existing instance, run the commands done by root, such as make install, from a console or non-Qt5 based window manager. It overwrites Qt5 libraries that should not be in use during the install process. If you did not install some of the recommended dependencies, examine ./configure --help output to check how to disable them or use internal versions bundled in the source tarball. The build time and space required for the full Qt5 is quite long. The instructions below do not build the tutorials and examples. Removing the -nomake line will create a complete build. The BLFS editors do not recommend installing Qt5 into the /usr hierarchy because it becomes difficult to find components and to update to a new version. If you do want to install Qt5 in /usr, the directories need to be specified explicitly. In this case, set QT5PREFIX=/usr and add the following to the configure arguments below: -archdatadir /usr/lib/qt5 \ -bindir /usr/bin \ -plugindir /usr/lib/qt5/plugins \ -importdir /usr/lib/qt5/imports \ -headerdir /usr/include/qt5 \ -datadir /usr/share/qt5 \ -docdir /usr/share/doc/qt5 \ -translationdir /usr/share/qt5/translations \ -examplesdir /usr/share/doc/qt5/examples Install Qt5 by running the following commands: ./configure -prefix $QT5PREFIX \ -sysconfdir /etc/xdg \ -confirm-license \ -opensource \ -dbus-linked \ -openssl-linked \ -system-harfbuzz \ -system-sqlite \ -nomake examples \ -no-rpath \ -skip qtwebengine && make This package does not come with a test suite. Now, as the root user: make install Remove references to the build directory from installed library dependency (prl) files by running the following command as the root user: find $QT5PREFIX/ -name \*.prl \ -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; Install images and create the menu entries for installed applications. The QT5BINDIR variable is used here to point to the directory for the executable programs. If you have changed the bindir above, QT5BINDIR will need to be adjusted below. Be sure that the QT5BINDIR variable is defined in root's environment and as the root user: QT5BINDIR=$QT5PREFIX/bin install -v -dm755 /usr/share/pixmaps/ && install -v -Dm644 qttools/src/assistant/assistant/images/assistant-128.png \ /usr/share/pixmaps/assistant-qt5.png && install -v -Dm644 qttools/src/designer/src/designer/images/designer.png \ /usr/share/pixmaps/designer-qt5.png && install -v -Dm644 qttools/src/linguist/linguist/images/icons/linguist-128-32.png \ /usr/share/pixmaps/linguist-qt5.png && install -v -Dm644 qttools/src/qdbus/qdbusviewer/images/qdbusviewer-128.png \ /usr/share/pixmaps/qdbusviewer-qt5.png && install -dm755 /usr/share/applications && cat > /usr/share/applications/assistant-qt5.desktop << EOF [Desktop Entry] Name=Qt5 Assistant Comment=Shows Qt5 documentation and examples Exec=$QT5BINDIR/assistant Icon=assistant-qt5.png Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Development;Documentation; EOF cat > /usr/share/applications/designer-qt5.desktop << EOF [Desktop Entry] Name=Qt5 Designer GenericName=Interface Designer Comment=Design GUIs for Qt5 applications Exec=$QT5BINDIR/designer Icon=designer-qt5.png MimeType=application/x-designer; Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Development; EOF cat > /usr/share/applications/linguist-qt5.desktop << EOF [Desktop Entry] Name=Qt5 Linguist Comment=Add translations to Qt5 applications Exec=$QT5BINDIR/linguist Icon=linguist-qt5.png MimeType=text/vnd.trolltech.linguist;application/x-linguist; Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Development; EOF cat > /usr/share/applications/qdbusviewer-qt5.desktop << EOF [Desktop Entry] Name=Qt5 QDbusViewer GenericName=D-Bus Debugger Comment=Debug D-Bus applications Exec=$QT5BINDIR/qdbusviewer Icon=qdbusviewer-qt5.png Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Development;Debugger; EOF Some packages such as look for certain executables with a -qt5 suffix. Run the following command as the root user to create the necessary symlinks: for file in moc uic rcc qmake lconvert lrelease lupdate; do ln -sfrvn $QT5BINDIR/$file /usr/bin/$file-qt5 done Command Explanations sed ...: Allows using Python 3 instead of Python 2. This command destroys the build for QtWebEngine, so do not use it if you remove the -skip qtwebengine switch. -confirm-license: Accept license without prompting user during configuration. -opensource: Install the opensource version of Qt. -nomake examples: This switch disables building of the example programs included in the source tarball. Remove it if you want to build them. -system-sqlite: This switch enables use of the system version of SQLite. -dbus-linked -openssl-linked: These switches enable explicit linking of the D-Bus and OpenSSL libraries into Qt5 libraries instead of dlopen()-ing them. -skip qtwebengine: This switch disables building the QtWebEngine. -system-harfbuzz: This switch enables use of the system version of Harfbuzz. Configuring Qt5 Configuration Information If you installed Qt5 in /usr, create an environment variable needed by certain packages. As the root user: cat > /etc/profile.d/qt5.sh << "EOF" # Begin /etc/profile.d/qt5.sh QT5DIR=/usr export QT5DIR pathappend $QT5DIR/bin # End /etc/profile.d/qt5.sh EOF If is installed, QT5DIR should be available to the super user as well. Execute the following commands as the root user: cat > /etc/sudoers.d/qt << "EOF" Defaults env_keep += QT5DIR EOF If you installed Qt5 in a location other than /usr, you need to update the following configuration files so that Qt5 is correctly found by other packages and system processes. As the root user, update the /etc/ld.so.conf file and the dynamic linker's run-time cache file: cat >> /etc/ld.so.conf << EOF # Begin Qt addition /opt/qt5/lib # End Qt addition EOF ldconfig /etc/ld.so.conf As the root user, create the /etc/profile.d/qt5.sh file: cat > /etc/profile.d/qt5.sh << "EOF" # Begin /etc/profile.d/qt5.sh QT5DIR=/opt/qt5 pathappend $QT5DIR/bin PATH pathappend $QT5DIR/lib/pkgconfig PKG_CONFIG_PATH export QT5DIR # End /etc/profile.d/qt5.sh EOF Contents Installed Programs Installed Libraries Installed Directories assistant, balsam, canbusutil, designer, fixqt4headers.pl, lconvert, linguist, lprodump, lrelease, lrelease-pro, lupdate, lupdate-pro, meshdebug, moc, pixeltool, qcollectiongenerator, qdbus, qdbuscpp2xml, qdbusviewer, qdbusxml2cpp, qdistancefieldgenerator, qdoc, qgltf, qhelpgenerator, qlalr, qmake, qml, qmlcachegen, qmleasing, qmlformat, qmlimportscanner, qmllint, qmlmin, qmlplugindump, qmlpreview, qmlprofiler, qmlscene, qmltestrunner, qscxmlc, qtattributionscanner, qtdiag, qtpaths, qtplugininfo, qtwaylandscanner, qvkgen, rcc, repc, sdpscanner, syncqt.pl, tracegen, uic, xmlpatterns, and xmlpatternsvalidator libQt53DAnimation.so, libQt53DCore.so, libQt53DExtras.so, libQt53DInput.so, libQt53DLogic.so, libQt53DQuick.so, libQt53DQuickAnimation.so, libQt53DQuickExtras.so, libQt53DQuickInput.so, libQt53DQuickRender.so, libQt53DQuickScene2D.so, libQt53DRender.so, libQt5AccessibilitySupport.a, libQt5Bluetooth.so, libQt5Bodymovin.so, libQt5Bootstrap.a, libQt5Charts.so, libQt5Concurrent.so, libQt5Core.so, libQt5DataVisualization.so, libQt5DBus.so, libQt5DesignerComponents.so, libQt5Designer.so, libQt5DeviceDiscoverySupport.a, libQt5EdidSupport.a, libQt5EglFSDeviceIntegration.so, libQt5EglFsKmsSupport.so, libQt5EglSupport.a, libQt5EventDispatcherSupport.a, libQt5FbSupport.a, libQt5FontDatabaseSupport.a, libQt5Gamepad.so, libQt5GlxSupport.a, libQt5Gui.so,libQt5Help.so, libQt5InputSupport.a, libQt5KmsSupport.a, libQt5LinuxAccessibilitySupport.a, libQt5Location.so, libQt5Multimedia.so, libQt5MultimediaGstTools.so, libQt5MultimediaQuick.so, libQt5MultimediaWidgets.so, libQt5Network.so, libQt5NetworkAuth.so, libQt5Nfc.so, libQt5OpenGLExtensions.a, libQt5OpenGL.so, libQt5PacketProtocol.a, libQt5PlatformCompositorSupport.a, libQt5Positioning.so, libQt5PositioningQuick.so, libQt5PrintSupport.so, libQt5Purchasing.so, libQt5Qml.so, libQt5QmlDebug.a, libQt5QmlDevTools.a, libQt5QmlModels.so, libQt5QmlWorkerScript.so, libQt5Quick.so, libQt5Quick3D.so, libQt5Quick3DAssetImport.so, libQt5Quick3DRender.so, libQt5Quick3DRuntimeRender.so, libQt5Quick3DUtils.so, libQt5QuickControls2.so, libQt5QuickParticles.so, libQt5QuickShapes.so, libQt5QuickTemplates2.so, libQt5QuickTest.so, libQt5QuickWidgets.so, libQt5RemoteObjects.so, libQt5Script.so, libQt5ScriptTools.so, libQt5Scxml.so, libQt5Sensors.so, libQt5SerialBus.so, libQt5SerialPort.so, libQt5ServiceSupport.a, libQt5Sql.so, libQt5Svg.so, libQt5Test.so, libQt5TextToSpeech.so, libQt5ThemeSupport.a, libQt5UiTools.a, libQt5VirtualKeyboard.so, libQt5WaylandClient.so, libQt5WaylandCompositor.so, libQt5WebChannel.so, libQt5WebSockets.so, libQt5WebView.so, libQt5Widgets.so, libQt5X11Extras.so, libQt5XcbQpa.so, libQt5XkbCommonSupport.a, libQt5Xml.so, libQt5XmlPatterns.so, and several plugins under /opt/qt5/{plugins,qml} /usr/include/qt5, /usr/lib/qt5, /usr/share/doc/qt5, and /usr/share/qt5 OR /opt/qt5 and /opt/qt-&qt5-version;