%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. &lfs110a_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; Qtbase 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 $QT5PREFIX/ -name \*.prl \ -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; 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 qmake rcc uic; do ln -sfrvn $QT5PREFIX/bin/$file /usr/bin/$file-qt5 done 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/qt5.sh << "EOF" # Begin /etc/profile.d/qt5.sh QT5DIR=/usr export QT5DIR # 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 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/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 fixqt4headers.pl, moc, qdbuscpp2xml, qdbusxml2cpp, qlalr, qmake, qvkgen, rcc, syncqt.pl, tracegen, and uic libQt5AccessibilitySupport.a, libQt5Bootstrap.a, libQt5Concurrent.so, libQt5Core.so, libQt5DBus.so, libQt5DeviceDiscoverySupport.a, libQt5EdidSupport.a, libQt5EglFSDeviceIntegration.so, libQt5EglFsKmsSupport.so, libQt5EglSupport.a, libQt5EventDispatcherSupport.a, libQt5FbSupport.a, libQt5FontDatabaseSupport.a, libQt5GlxSupport.a, libQt5Gui.so, libQt5InputSupport.a, libQt5KmsSupport.a, libQt5Network.so, libQt5OpenGLExtensions.a, libQt5OpenGL.so, libQt5PlatformCompositorSupport.a, libQt5PrintSupport.so, libQt5ServiceSupport.a, libQt5Sql.so, libQt5Test.so, libQt5themeSupport.a, libQt5Widgets.so, libQt5XcbQpa.so, libQt5XkbCommonSupport.a, and libQt5Xml.so /opt/qt5 and /opt/qt-&qt5-version;, or, if installing in /usr: /usr/include/qt5, /usr/lib/qt5, /usr/share/{,doc}/qt5 Short Descriptions fixqt4headers.pl is a script to replace all Qt 4 style includes with Qt 5 includes. fixqt4headers.pl moc generates Qt meta object support code. moc qdbuscpp2xml takes a C++ source file and generates a D-Bus XML definition of the interface. qdbuscpp2xml qdbusxml2cpp is a tool that can be used to parse interface descriptions and produce static code representing those interfaces, qdbusxml2cpp qlalr is a tool used to generate code from grammar specifications. qlalr qmake uses information stored in project files to determine what should go in the makefiles it generates. qmake qvkgen converts Vulkan specfiles to C++ headers and code. qvkgen rcc is a resource compiler used in conjunction with designer. rcc syncqt.pl is a script to create the forwarding headers in the include directories. It is an internal development tool. syncqt.pl tracegen is a trace generator for LTTng or ETW. tracegen uic is a Qt user interface compiler. uic