%general-entities; ]> $LastChangedBy$ $Date$ Qt-&qt5-version; Base qtbase Introduction to Qt Library Qt5 is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) (in which cases Qt5 is classified as a widget toolkit), and also used for developing non-GUI programs such as command-line tools and consoles for servers. One of the major users of Qt is KDE Frameworks 5 (KF5). Qt5 is made of several modules, which are not all necessary for a given application. It has its own building tool (qmake), and provides a complete development environment. The instructions on this page allow to set up that environment and to build basic modules. &lfs10_checked; Package Information Download (HTTP): Download (FTP): Download MD5 sum: &qtbase-md5sum; Download size: &qtbase-size; Estimated disk space required: &qtbase-buildsize; Estimated build time: &qtbase-time; Qt5 Dependencies Required Recommended , , , , , , , , , , , , , , , and Optional , , , or MySQL, , , Firebird, FreeTDS, libmd4c, OpenAL, openvg, tslib, and Vulkan User Notes: Setting the installation prefix Installing in /opt/qt5 The BLFS editors recommend installing Qt5 in a directory other than /usr, ie /opt/qt5. To do this, set the following environment variable: export QT5PREFIX=/opt/qt5 Sometimes, the installation paths are hardcoded into installed files. This is the reason why /opt/qt5 is used as installation prefix instead of /opt/qt-&qt5-version;. To create a versioned Qt5 directory after the installation is complete, you may rename the directory and create a symlink: mkdir /opt/qt-&qt5-version; ln -sfnv qt-&qt5-version; /opt/qt5 Later on, you may want to install other versions of Qt5. To do that, just remove the symlink and use /opt/qt5 as the prefix again. Which version of Qt5 you use depends only on where the symlink points. Installation of qtbase 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 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 qtbase by running the following commands: ./configure -prefix $QT5PREFIX \ -sysconfdir /etc/xdg \ -confirm-license \ -opensource \ -dbus-linked \ -openssl-linked \ -system-sqlite \ -nomake examples \ -no-rpath && 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 commands as the root user: find $QT5DIR/ -name \*.prl \ -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; Command Explanations -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. -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. Configuring qtbase Configuration Information If you installed qtbase in /usr, create an environment variable needed by certain packages. As the root user: cat > /etc/profile.d/qtbase.sh << "EOF" # Begin /etc/profile.d/qtbase.sh QT5DIR=/usr export QT5DIR # End /etc/profile.d/qtbase.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 qtbase in a location other than /usr, you need to update the following configuration files so that qtbase 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/qtbase.sh file: cat > /etc/profile.d/qtbase.sh << "EOF" # Begin /etc/profile.d/qtbase.sh QT5DIR=/opt/qt5 pathappend $QT5DIR/bin PATH pathappend $QT5DIR/lib/pkgconfig PKG_CONFIG_PATH export QT5DIR # End /etc/profile.d/qtbase.sh EOF Contents Installed Programs Installed Libraries Installed Directories qtwebengine_convert_dict and QtWebEngineProcess (in $QT5DIR/libexec) libQt5Pdf.so, libQt5PdfWidgets.so, libQt5WebEngineCore.so, libQt5WebEngine.so, and libQt5WebEngineWidgets.so $QT5DIR/include/QtPdf, $QT5DIR/include/QtPdfWidgets, $QT5DIR/include/QtWebEngine, $QT5DIR/include/QtWebEngineCore, $QT5DIR/include/QtWebEngineWidgets, $QT5DIR/qml/QtWebEngine, and $QT5DIR/translations/qtwebengine_locales