Difference between revisions of "How to Build TDE Core Modules"
(9 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
[[Category:Installation]] |
[[Category:Installation]] |
||
[[Category:Developers]] |
[[Category:Developers]] |
||
+ | [[Category:Packagers]] |
||
+ | [[Category:Building from source code]] |
||
This HowTo provides detailed notes and explanations for building the Trinity Desktop Environment base |
This HowTo provides detailed notes and explanations for building the Trinity Desktop Environment base |
||
packages. |
packages. |
||
Line 46: | Line 48: | ||
− | ===About |
+ | ===About TQt=== |
− | |||
⚫ | |||
− | several years ago, the Trinity Project has taken over QT3's maintenance. In other words, we're now |
||
− | QT3 upstream, and you should be obtaining your QT3 sources from the Trinity package tarballs or GIT repository. |
||
− | |||
− | The version of QT3 used with Trinity 3.5.13 and later incorporates numerous patches. If you're trying to |
||
− | use an old QT3/KDE3 packaging build setup for your distribution with Trinity's QT3, don't be too surprised |
||
− | if some patches don't apply. Unless the patch is distribution-specific, chances are that it's been added |
||
− | to the main source tree. |
||
+ | Trinity uses the TQt widget toolkit. TQt is a fork of the last version of Qt3, with a significant amount of |
||
⚫ | |||
+ | the Trinity Project has forked it and continued its maintenance and development. |
||
===About libart=== |
===About libart=== |
||
Line 68: | Line 64: | ||
− | ===Coexisting with |
+ | ===Coexisting with QT5/KDE Plasma=== |
− | Trinity is intended to be able to run on computers that also have |
+ | Trinity is intended to be able to run on computers that also have KDE Plasma installed. Originally, a lot of |
Trinity applications had the same names as their KDE4 counterparts, which was problematic. All of |
Trinity applications had the same names as their KDE4 counterparts, which was problematic. All of |
||
those have been renamed. In general, this was accomplished by changing the old KDE "K" prefix to a |
those have been renamed. In general, this was accomplished by changing the old KDE "K" prefix to a |
||
− | "T" ("kwin" -> "twin"). Applications that don't match anything currently part of |
+ | "T" ("kwin" -> "twin"). Applications that don't match anything currently part of KDE Plasma have retained |
− | old names. |
+ | their old names. |
− | To avoid stepping on |
+ | To avoid stepping on KDE Plasma's toes, we ''strongly'' suggest picking a specific subdirectory prefix to install Trinity |
to--the one used in these directions is $PREFIX=/opt/trinity. |
to--the one used in these directions is $PREFIX=/opt/trinity. |
||
Line 97: | Line 93: | ||
Start with the required core packages: |
Start with the required core packages: |
||
+ | #tqt3 |
||
− | #tqt3 (replaces Qt3; Qt3 without the tqtinterface layer remains available) |
||
#cmake-trinity |
#cmake-trinity |
||
#tqtinterface |
#tqtinterface |
||
Line 117: | Line 113: | ||
#pytdeextensions |
#pytdeextensions |
||
#python-trinity |
#python-trinity |
||
− | #tqscintilla |
+ | #tqscintilla (if you want thr Scintilla editor component) |
The following build order seems to work well for the remaining core packages when building the stable release. |
The following build order seems to work well for the remaining core packages when building the stable release. |
||
Line 167: | Line 163: | ||
export LD_LIBRARY_PATH=$LIBDIR:$LIBDIR/trinity:$LD_LIBRARY_PATH |
export LD_LIBRARY_PATH=$LIBDIR:$LIBDIR/trinity:$LD_LIBRARY_PATH |
||
export PKG_CONFIG_PATH=:$LIBDIR/pkgconfig:$TQTDIR/lib/pkgconfig:$PKG_CONFIG_PATH |
export PKG_CONFIG_PATH=:$LIBDIR/pkgconfig:$TQTDIR/lib/pkgconfig:$PKG_CONFIG_PATH |
||
+ | # for lib64: |
||
⚫ | |||
+ | # export LIBDIRSUFFIX=64 |
||
⚫ | |||
from the Trinity module: |
from the Trinity module: |
||
mkdir -p build && cd build |
mkdir -p build && cd build |
||
Line 173: | Line 171: | ||
-DCMAKE_EXPORT_COMPILE_COMMANDS="ON" \ |
-DCMAKE_EXPORT_COMPILE_COMMANDS="ON" \ |
||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
||
− | -DCMAKE_VERBOSE_MAKEFILE="ON" \ |
||
-DCMAKE_SKIP_RPATH="OFF" \ |
-DCMAKE_SKIP_RPATH="OFF" \ |
||
-DCMAKE_INSTALL_PREFIX=${PREFIX} \ |
-DCMAKE_INSTALL_PREFIX=${PREFIX} \ |
||
Line 180: | Line 177: | ||
-DMAN_INSTALL_DIR=${MANDIR} \ |
-DMAN_INSTALL_DIR=${MANDIR} \ |
||
-DBUILD_ALL="ON" \ |
-DBUILD_ALL="ON" \ |
||
− | -DWITH_ALL_OPTIONS="ON" .. |
+ | -DWITH_ALL_OPTIONS="ON" .. |
− | cmake --build . |
+ | cmake --build . -- -v |
====Notes==== |
====Notes==== |
Latest revision as of 11:01, 21 December 2023
This HowTo provides detailed notes and explanations for building the Trinity Desktop Environment base packages.
Introduction and Requirements
Basic Building Requirements
Individual Linux distributions might have different build requirements. If these are known they will be available on the Distribution Specific Builds page.
There is an ongoing effort to convert the build process from autotools to cmake. Until the cmake conversion is complete, both cmake and autotools are needed to build Trinity packages. cmake 2.8.12 or more recent is expected when building with cmake.
To build the packages still using autotools, you will need a standard autotools setup (automake, autoconf, etc.)
You'll also need a C++ compiler. g++ from the GNU Compiler Collection is the most usual, the current GIT version of Trinity has been tested against versions up to and including 4.6. clang++ is also supported.
Other Requirements
(NOTE: List compiled from old QT3/kdelibs/kde-base ebuilds--will someone please check these?)
Most of the non-build-related mandatory dependencies for the core Trinity packages are pretty basic:
- an X server
- openssl
- fontconfig
- freetype
- ghostscript
- xdg support
- libpng
- libmng
If your Linux distribution came with any kind of graphical environment at all, you should already have this stuff.
To build tdepim, you will also need libical (standard on many distros).
See Additional Functionality for a list of optional dependencies and what they enable.
About TQt
Trinity uses the TQt widget toolkit. TQt is a fork of the last version of Qt3, with a significant amount of bug-fixes and improvements. Since Trolltech, the original developer of Qt, dropped support for Qt3, the Trinity Project has forked it and continued its maintenance and development.
About libart
libart-lgpl is another dependency package that the Trinity Project has taken over after it was dropped by its original maintainer, because it needed several patches to prevent crashes. The version of libart provided by the Trinity Project includes those patches and is intended to be a replacement for any version of libart currently installed by any distro. Build this patched version of libart and replace the stock libart installed with the distro.
Coexisting with QT5/KDE Plasma
Trinity is intended to be able to run on computers that also have KDE Plasma installed. Originally, a lot of Trinity applications had the same names as their KDE4 counterparts, which was problematic. All of those have been renamed. In general, this was accomplished by changing the old KDE "K" prefix to a "T" ("kwin" -> "twin"). Applications that don't match anything currently part of KDE Plasma have retained their old names.
To avoid stepping on KDE Plasma's toes, we strongly suggest picking a specific subdirectory prefix to install Trinity to--the one used in these directions is $PREFIX=/opt/trinity.
Preparing the Source
To use the release tarballs, just untar them somewhere.
To live dangerously and use the GIT sources, read Notes on GIT Sources first.
Building
Suggested Build Order
A lot of the Trinity core packages depend on one another (in particular, everything depends on tdelibs). Follow this build order to prevent problems.
Start with the required core packages:
- tqt3
- cmake-trinity
- tqtinterface
- arts
- dbus-tqt
- dbus-1-tqt
- tqca-tls (Recommended but required for some applications, such as the Kopete OTR add-on)
- libart-lgpl
- avahi-tqt (Recommended but required when supporting DNS discovery services)
- tdelibs
- tdebase
At this point, you should have a functioning TDE desktop with basic utilities (terminal, file manager, text/source editors, etc.) If you're going to build tdebindings and want Python support available, continue with the Python linking packages (or skip over them if you don't care about Python support):
- sip4-tqt
- python-tqt
- pytdeextensions
- python-trinity
- tqscintilla (if you want thr Scintilla editor component)
The following build order seems to work well for the remaining core packages when building the stable release. You don't have to install everything, though, unless you're packaging TDE for your distribution--pick the packages that suit your use case.
- tdebindings
- tdeaccessibility
- tdeutils
- tdemultimedia
- tdenetwork
- tdeadmin
- tdeartwork
- tdegames
- tdetoys
- tdeedu
- tdegraphics
- tdepim
- tdesdk (Build tdesdk after installing tdepim. tdepim provides libkcal (bugzilla) hooks for tdesdk.)
- tdevelop (Build tdevelop after tdesdk. tdesdk provides cvs support for tdevelop.)
- tdeaddons
Once that's done, you may want to add some extra applications on top.
Building Packages with cmake
Starting from TDE version R14.0.11, the package cmake-trinity is mandatory prior to building, this package includes the required macros for the build.
List of Packages Building with cmake
cmake is the newer, easier, and more maintainable build system the Trinity Project is in the process of porting TDE source to.
The list of modules maintained as an issue #9 in the TGW indicates which core and dependency packages have already been converted, and their autotools build scripts are no longer maintained. Some other packages are in the process of conversion, but do not have complete cmake build scripts yet. Build everything not in the list above with autotools.
Read the notes section below for individual package requirements before trying to build anything.
Performing a cmake Build with Ninja
The command listing below is only an example. You will wish to edit the exports if your distribution puts things in unusual locations or if you wish to install to somewhere other than /opt/trinity (tqtinterface has special requirements--see the Notes). Not all exports will be needed on all systems.
export PREFIX=/opt/trinity export SYSCONFDIR=/etc/trinity export LIBDIR=$PREFIX/lib export MANDIR=$PREFIX/man export TQTDIR=$PREFIX/tqt3 export PATH=$TQTDIR/bin:$PREFIX/bin:$PATH export LD_LIBRARY_PATH=$LIBDIR:$LIBDIR/trinity:$LD_LIBRARY_PATH export PKG_CONFIG_PATH=:$LIBDIR/pkgconfig:$TQTDIR/lib/pkgconfig:$PKG_CONFIG_PATH # for lib64: # export LIBDIRSUFFIX=64 # from the Trinity module: mkdir -p build && cd build cmake -G "Ninja" \ -DCMAKE_EXPORT_COMPILE_COMMANDS="ON" \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_SKIP_RPATH="OFF" \ -DCMAKE_INSTALL_PREFIX=${PREFIX} \ -DSYSCONF_INSTALL_DIR=${SYSCONFDIR} \ -DLIB_SUFFIX=${LIBDIRSUFFIX} \ -DMAN_INSTALL_DIR=${MANDIR} \ -DBUILD_ALL="ON" \ -DWITH_ALL_OPTIONS="ON" .. cmake --build . -- -v
Notes
- Until the cmake migration is fully completed, tqtinterface should be built to install with a $PREFIX of /usr rather than /opt/trinity, even if you are installing everything else to /opt/trinity.
- tqtinterface requires the following additional QT-related build option:
-DQT_VERSION=3
- arts and tdelibs execute compiled binaries as part of the build process. Therefore they need to have -DCMAKE_SKIP_RPATH="OFF" set. All other modules do not need the RPATH set.
- When building on 64-bit, the following (T)Qt3 configuration option might need to be explicitly declared in some distro build scripts:
-platform linux-g++-64 (rather than linux-g++ (notice the dash!))
- If class constructor issues surface during the build, please post the error to the trinity-users list.
Building Packages with Autoconf
Introduction
If the package you're trying to build is on the list of those that will build with cmake, try that first, because its autotools files will be unmaintained, bit-rotted, and possibly outright broken.
Please read the notes section below for individual package requirements before trying to build anything.
For those packages that still need to be built with autotools, the following steps must be run for each affected Trinity module, including tarball snapshots.
Regenerate Autoconf/Automake files
cd to the desired module to build, then run:
cp -Rp <path to your system's libtool.m4 file> admin/libtool.m4.in cp -Rp <path to your system's ltmain.sh file> admin/ltmain.sh make -f admin/Makefile.common
Configure and Build
export PREFIX=/opt/trinity export SYSCONFDIR=/etc/trinity export LIBDIR=/opt/trinity/lib export MANDIR=/opt/trinity/man export QTDIR=/opt/trinity/lib/qt3-3.3.8.d export PATH=/opt/trinity/qt3-3.3.8.d/bin:/opt/trinity/bin:$PATH export LD_LIBRARY_PATH=/opt/trinity/lib:/opt/trinity/lib/trinity:$LD_LIBRARY_PATH export PKG_CONFIG_PATH=:/opt/trinity/lib/pkgconfig:/opt/trinity/qt3-3.3.8.d/lib/pkgconfig:$PKG_CONFIG_PATH # Enable only one of the following: # export DEBUG_AUTOTOOL_OPT="--enable-debug=full" export DEBUG_AUTOTOOL_OPT="--disable-debug" CFLAGS=$CPUOPT \ CXXFLAGS=$CPUOPT \ ./configure \ --prefix=${PREFIX} \ --sysconfdir=${SYSCONFDIR} \ --libdir=${LIBDIR} \ --mandir=${MANDIR} \ --with-qt-dir=${QTDIR} \ --with-qt-includes=${QTDIR}/include \ --with-qt-libraries=${QTDIR}/lib \ $DEBUG_AUTOTOOL_OPT
View the Distribution Specific Builds page for additional configure options.
Notes
- Certain modules will not build across multiple cores in parallel. That is, with a "make -j" flag set to anything greater than 1. These packages are:
- tdebindings (some people have no problems with this package and parallel processing)
- tdemultimedia (some people have no problems with this package and parallel processing)
- Not well documented anywhere, but when building with automake several packages need the --enable-closure configure option:
- tdeaccessibility
- tdeaddons
- tdeadmin
- tdebindings
- tdeedu
- tdegames
- tdemultimedia
- tdesdk
- When building on 64-bit, the following (T)Qt3 configuration option might need to be explicitly declared in some distro build scripts:
-platform linux=g++-64 (rather than linux-g++ (notice the dash!))
Build Times
Building Trinity requires time and patience. Build times vary. Here are some guidelines from building Trinity 3.5.12 on a dual core 2.3 GHz AM2 with 4GB of RAM, using tmpfs, 7200 rpm SATA II hard drives; with Amarok, Firefox, Konsole, Konqueror, Kate, and other various apps often running concurrently. Compile times will be faster without such overhead, but likely will be longer when building with support package hooks. Packages using cmake will build faster than those still stuck on autotools.
- tqtinterface: 2 minutes
- arts: 4 minutes
- tdelibs: 44 minutes
- tdebase: 33 minutes
- tdebindings: 36 minutes
- tdeaccessibility: 5 minutes
- tdeutils: 8 minutes
- tdemultimedia: 24 minutes
- tdenetwork: 23 minutes
- tdeadmin: 4 minutes
- tdeartwork: 3 minutes
- tdegames: 8 minutes
- tdetoys: 2 minutes
- tdeedu: 15 minutes
- tdegraphics: 17 minutes
- tdesdk: 14 minutes
- tdevelop: 27 minutes
- tdeaddons: 7 minutes
- tdewebdev: 12 minutes
- tdepim: 63 minutes
Approximate total time: 5 hours 51 minutes
Time to a functional system (basic desktop): 1 hour 23 minutes
Installing
The command is the same regardless of whether your package was built with cmake or autotools:
make install || exit 1
Additional Functionality
Certain Trinity packages gain additional functionality when compiled with additional dependencies available. Also, we maintain some libraries which provide purely optional functionality.
Optional Trinity Libraries
None of these Trinity libraries are required but all provide additional functionality for a variety of packages. These libraries must be built and installed before any packages using these libraries can take advantage of the additional functionality.
- libkipi: required by kipi-plugins
- kipi-plugins: several high-end image viewers such as gwenview and digikam
- libkdcraw: several image viewers and graphics apps, such as chalk and digikam
- libkexiv2: several image viewers
- libksquirrel: required by ksquirrel (TDE swiss-army-knife for graphic file formats, also supports medical image formats if xmedcon is provided)
- libtqt-perl: adept add-on
- mlt: not required or supported at this time
- mlt++: not required or supported at this time
- pytdeextensions: replacement for PyQt3 and PyKDE3, and used by apps such as tdebindings and tde-guidance
- python-trinity: replacement for PyQt3 and PyKDE3, and used by apps such as tdebindings and tde-guidance
List of Optional Dependencies by Trinity Package
tdelibs
- avahi DNS discovery
- avahi-tqt Trinity TQt layer for avahi, available in Trinity libraries
- hspell Hebrew spell checking
- krb5 Kerberos authentication
- openexr EXR image format
tdebase
- avahi DNS discovery
- avahi-tqt Trinity TQt layer for avahi, available in Trinity libraries
- krb5 Kerberos authentication
- openexr EXR image format
- GraphicsMagick image filters
tdebindings
- Ruby
- JRE Java Runtime Environment
- JDK Java Development Kit
- Python
- python-trinity, available in Trinity libraries
- pytdeextensions, available in Trinity libraries
tdeutils
- xmms multimedia player (superkaramba)
tdemultimedia
- cdparanoia digital audio extraction tool (kaudiocreator)
- speex an audio compression format designed for speech
tdenetwork
- xmms multimedia player (kopete plugins)
- ortp real-time transport protocol stack under GPL (kopete plugins)
- speex audio compression format designed for speech (kopete plugins)
tdeedu
- facile functional constraint library (kalzium)
- ocaml A programming language (kalzium)
- boost boost C++ Libraries
tdevelop
- graphviz graph visualization
tdeaddons
- xmms multimedia player (kicker applets)
tdewebdev
- XSLT Extensible Stylesheet Language Transformations
- DocBook text markup
tdepim
- krb5 Kerberos authentication
- ortp real-time transport protocol stack under GPL (kopete)
- gnokii Nokia mobile phone support
- opensync data synchronization support
- libcaldav online calendar support, available through Trinity web site (http://www.trinitydesktop.org/relatedprojects.php)
- libcarddav online address book support, available through Trinity web site (http://www.trinitydesktop.org/relatedprojects.php)
Quirks and Known Bugs
Building Sip
Sip is available on many/most distros. Sip requires Qt3 to build, but won't build on TQt3, which adds the tqinterface layer to Qt3. More than likely down the road, Sip will be dumped or moved to Qt4 by distro maintainers. All of the python-*-tqt-* packages need Sip to build. Build this TQt3 compatible version of Sip and replace the stock Sip installed with the distro.
OpenGL and nVidia
Building many Trinity and related packages depend upon OpenGL, such as tdegraphics, k3b, koffice, tdenetwork, gwenview, digikam, etc.;
as well as dependency packages such as libkipi, libkdcraw, libkexiv2, avahi, etc.
If any of those packages are built when the proprietary nvidia drivers are installed, the dependent package will fail to build with an error about /usr/lib/libGL.la.
That file is installed by the proprietary nvidia package. When building for personal use only, then building those packages with nvidia installed will pose no harm.
When building packages for other users then build the entire suite of packages in a "clean" generic OpenGL environment.
Other users might not use the proprietary nvidia package. This is true of any package that has OpenGL dependencies.
Tdeartwork and xhack Screensavers
Before building tdeartwork, install any and all xhack screensavers that might be uses, then
cd <tdeartwork>/kscreensaver/kxsconfig/ ./update_hacks.sh
This will generate the TDE bindings required to allow installed screensavers show up in the Trinity screensaver control panel, along with their configuration options. When adding a new screensaver the update_hacks command needs to be rerun and tdeartwork recompiled/reinstalled. Distribution maintainers should install all available screensavers from their distribution and then run update_hacks during the initial build setup when building redistributable binary packages (see the Debian tdeartwork build scripts in GIT for an example of how to do this).
Poppler Support in Tdegraphics
Building tdegraphics with poppler support requires building a Trinity poppler-tqt support package. With many distros poppler no longer is built with Qt3 support. The Trinity poppler-tqt provides the necessary hooks for tdegraphics without rebuilding poppler. The poppler-tqt dependency sources are located in the tdegraphics/kfile-plugins dependencies directory and are built automatically with the tdegraphics build option -DWITH_PDF=ON.
Tdesvn/Tdesdk svn-kio Conflict
tdesvn and tdesdk provide conflicting files for svn-kio services. Neither package is a dependency of the other. When tdesdk or tdesvn will be installed without the other, then no change is required. When both tdesdk and tdesvn are to be installed, then to avoid filesystem conflicts the following files must be removed from one of the packages before installing:
/opt/trinity/share/services/svn+file.protocol /opt/trinity/share/services/svn+http.protocol /opt/trinity/share/services/svn+https.protocol /opt/trinity/share/services/svn+ssh.protocol /opt/trinity/share/services/svn.protocol
Since tdesvn uses the ksvn kio exclusively, while tdesdk uses the svn kio, consider removing the conflicting files from tdesdk to eliminate the same services relying on multiple kio service files.