Building KDE_3.3.2 [LONG]

Joseph E. Sacco, Ph.D. joseph_sacco at comcast.net
Thu Jan 13 12:28:08 MST 2005


I have successfully built KDE_3.3.2. ALSA based KDE sound works 
properly as do external media players like XMMS and XINE. Thanks to
Robert Story for suggesting reasonable values for sound auto-suspend.


The build was performed using the GAR-based framework, Konstruct:

	http://developer.kde.org/build/konstruct/

For those who are not familar with GAR, GAR is "a mechanism for
automating the compilation and installation of third-party source code."

	http://www.lnx-bbc.org/garchitecture.html

GAR is a wonderous thing that allows you to fetch, patch, compile, and
install in proper order N different packages remotely located at P
different sites. Each package may have Q subcomponents.

The space-time requirements for building KDE are considerable. 

The work space required for the GAR tree building the main kde branch,
apps, apps-unsupported, and whatever libraries are required is sizeble:

        % du -sk /usr/local/src/KDE/konstruct/
        4058820 /usr/local/src/KDE/konstruct/

The time required to build the GAR complete tree including applications
on a dual processor G4 Silver is measured in days, given the bumps and
roadblocks encountered along the way. 

GAR has a build-install mode,

	% make paranoid-install

that will stop at the first sign of trouble.  This is a good thing.  The
bad news is if you kick off a build and go away, you may find when you
return that the build didn't get very far.   The good news is GAR knows
how to pick up where it left off.

Watching GAR slave away in background brought to mind the refrain from
an old Peter, Paul and Mary song:

        [From "The Mavelous Toy"]
        "It went zip when it moved and pop when it stopped,
        And whirrrrrr when it stood still.
        I never knew just what it was and I guess I never will."

The resulting install tree is also quite large:

        % du -sk /opt/kde3.3.2/
        952620  /opt/kde3.3.2/


BUILD ISSUES
-------------
(1) Include files
(2) Locale environment variables
(3) libpng / setjmp

Include file issues
-------------------
KDE has a number of utilities and libraries that when built  require
kernel include files.  There are issues with the linux-2.6.9 include
files. Specificly, some declarations and types are available only when
__KERNEL__ is defined. This is a known problem to the folks who work on
the kernel. Some of these issues have been resolved on linux-2.6.10.

Blindly defining __KERNEL__ is not the answer since doing so has all
sorts of unexpected consequences.  The favored workaround is to add the
necessary declarations to the include files. 

The files that were effected during the build are:

	/usr/include/linux/byteorder/big_endian.h
	/usr/include/linux/byteorder/little_endian.h
	/usr/include/linux/byteorder/swab.h

Other files have  been modified from builds of other applications:

	/usr/include/linux/mod_devicetable.h
	/usr/include/linux/crc-ccitt.h
        /usr/include/linux/prio-tree.h


Locale environment variables
------------------------------
As reported earlier in a earlier post to the list:

http://lists.terrasoftsolutions.com/pipermail/yellowdog-general/2005-January/017518.html

there is a problem compiling the KDE java buildings. IBM's sdkguide
provided a workaround, which is to redefine an environment variable:

	LOCALE=en_US.UTF-8  ==> LOCALE=en_US

This is a workaround. It would be good if someone who understands what
really needs to be done to resolve this problem helps to resolve it.


libpng / setjmp
------------------
The application

	./konstruct/apps/graphics/gwenview
	
failed to compile because of an issue related to setjmp. 

libpng comes built with its own internal version of setjmp,

[from /usr/include/pngconf.h]

        ifdef PNG_SETJMP_SUPPORTED
        /* This is an attempt to force a single setjmp behaviour on
        Linux.  If
         * the X config stuff didn't define _BSD_SOURCE we wouldn't need
        this.
         */

        #  ifdef __linux__
        #    ifdef _BSD_SOURCE
        #      define PNG_SAVE_BSD_SOURCE
        #      undef _BSD_SOURCE
        #    endif
        #    ifdef _SETJMP_H
             /* If you encounter a compiler error here, see the
        explanation
              * near the end of INSTALL.
              */
                 __png.h__ already includes setjmp.h;
                 __dont__ include it again.;
        #    endif
        #  endif /* __linux__ */
        
           /* include setjmp.h for error handling */
        #  include <setjmp.h>
        
        #  ifdef __linux__
        #    ifdef PNG_SAVE_BSD_SOURCE
        #      define _BSD_SOURCE
        #      undef PNG_SAVE_BSD_SOURCE
        #    endif
        #  endif /* __linux__ */
        #endif /* PNG_SETJMP_SUPPORTED */


[from ./libpng/INSTALL]

        If you encounter a compiler error message complaining about the
        lines
              __png.h__ already includes setjmp.h;
              __dont__ include it again.;
        This means you have compiled another module that includes
        setjmp.h, which is hazardous because the two modules might not
        include exactly the same setjmp.h.  If you are sure that you
        know what you are doing and that they are exactly the same, then
        you can comment out or delete the two lines.  Better yet, use
        the cexcept interface instead, as demonstrated in
        contrib/visupng of the libpng distribution.
        
        Further information can be found in the README and libpng.txt
        files, in the individual makefiles, in png.h, and the manual
        pages libpng.3 and png.5.

Pretending that I was sure that I knew what I was doing,  I deleted the
two error generating lines in the include file and rolled on.

It would be good if someone who understands what really needs to be done
to resolve this problem helps to resolve it.


RUNNING KDE_3.3.2
------------------
To bring up KDE-3.3.2 I mimicked what I had done for Garnome.

* Create two files:

.xinitrc
        #!/bin/sh
        exec /usr/local/bin/kde-session
        
kde-session
        !/bin/sh
        
        # set up the environment
        QTDIR=/opt/kde3.3.2
        KDEDIR=/opt/kde3.3.2
        PATH=$KDEDIR/bin:$PATH
        LD_LIBRARY_PATH=$KDEDIR/lib:$LD_LIBRARY_PATH
        PYTHONPATH=$KDEDIR/lib/python2.3/site-packages
        PKG_CONFIG_PATH=$KDEDIR/lib/pkgconfig:/usr/lib/pkgconfig
        XDG_DATA_DIRS=$KDEDIR/share
        GDK_USE_XFT=1
        MANPATH=$KDEDIR/share/man:$MANPATH
        
        export QTDIR KDEDIR PATH LD_LIBRARY_PATH PYTHONPATH
        PKG_CONFIG_PATH GDK_USE_XFT XDG_DATA_DIRS MANPATH
        
        # start KDE
        exec $KDEDIR/bin/startkde

I don't know if all of this stuff is necessary.


* delete existing ~/.kde stuff

* run "startx"

The KDE desktop comes up and runs. 

When the desktop comes up, there are a couple of "missing font"
complaints that I have yet to track down.


TESTING
-------
I have neither the patience nor access to a test framework that would
allow me to extensively test this build. I have tried out a number of
the sound applications, graphics applications, KOffice, and some of the
system tools. At a cursorary level, they all appear to work. 

To date, I have witnessed only one real problem: 

        Manipulating the Sound System settings 
        through the KDE Control Center can hang KDE.

Sometimes, but not always, if I make a change and then click the "Apply"
button, the KDE world hangs.  I escape from this conundrum by retreating
to another terminal [ctrl-option-Fn] and killing the X server. When KDE
is brought back up, I see that the changes did take effect and all is
well.  Go figure...

-Joseph

-- 
joseph_sacco[at]comcast[dot]net



More information about the yellowdog-general mailing list