1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
  
     | 
    
      
Building, running and Valgrinding KDE 4.2 svn from source
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is recommended to make a new user ("kde4", maybe) to do the
building, and do all the following as that user.  This means it can't
mess up any existing KDE sessions/settings.
Prelims (note, needed for both building and running KDE4):
# Change these as you like; but "-g -O" is known to be a good
# speed vs debuginfo-accuracy tradeoff for Valgrind
export CFLAGS="-g -O"
export CXXFLAGS="-g -O"
export KDEINST=$HOME/InstKdeSvn  ## change as you like
export PATH=$KDEINST/bin:$PATH
export LD_LIBRARY_PATH=$KDEINST/lib:$KDEINST/lib64:$LD_LIBRARY_PATH
unset XDG_DATA_DIRS # to avoid seeing kde3 files from /usr
unset XDG_CONFIG_DIRS
export PKG_CONFIG_PATH=$KDEINST/lib/pkgconfig:$KDEINST/lib64/pkgconfig:$PKG_CONFIG_PATH
# else kdelibs' config detection of strigi screws up
Check these carefully before proceeding.
env | grep FLAGS
env | grep PATH
env | grep XDG
env | grep KDEINST
The final installation will be placed in the directory $KDEINST.
As a general comment, it is particularly important to read the output
of the cmake runs (below), as these tell you of missing libraries that
may screw up the build.  After a cmake run, you may want to install
some supporting libs (through yast, etc) before re-running cmake.  The
"rm -f CMakeCache.txt" ensures cmakes starts afresh.
Getting the sources
~~~~~~~~~~~~~~~~~~~
  # note also that this assumes that the KDE 4.2 sources are
  # acquired from the KDE trunk; that is, this is happening
  # prior to the 4.2 release.
  # note this takes ages, unless you are fortunate enough to have
  # a gazigabit-per-second network connection
  # checking out merely "trunk" is a really bad idea
  # due to the enormous amount of unnecessary stuff fetched.
  #
  svn co svn://anonsvn.kde.org/home/kde/trunk/kdesupport trunk_kdesupport
  svn co svn://anonsvn.kde.org/home/kde/trunk/KDE trunk_KDE
  # This alone soaks up about 2.5GB of disk space.
  # You'll also need to snarf a copy of qt-x11-opensource-src-4.4.3.tar.bz2
  # (md5 = 00e00c6324d342a7b0d8653112b4f08c)
Building Qt
~~~~~~~~~~~
First build qt-4.4.3 with QtDBus support and some other kind of
support (can't remember what.  jpeg?).  These are both added by
default provided the relevant packages are installed.  Check the Qt
configure output to be sure.
  bzip2 -dc qt-x11-opensource-src-4.4.3.tar.bz2 | tar xvf -
  cd qt-x11-opensource-src-4.4.3
  emacs mkspecs/common/g++.conf
  # change QMAKE_CFLAGS_RELEASE and QMAKE_CFLAGS_DEBUG both to be -g -O
  # optionally, in src/corelib/tools/qvector.h, for the defns of
  # QVectorData and QVectorTypedData, change
  #if defined(QT_ARCH_SPARC) && defined(Q_CC_GNU) && defined(__LP64__) \
      && defined(QT_BOOTSTRAPPED)
  # to "if 1 || defined ..."
  # twice (else get strange memcheck errors with QVector on ppc.  Not
  # sure if this is a qt bug (possibly), a gcc bug (unlikely) or a
  # valgrind bug (unlikely)).  I don't think this is necessary on x86
  # or x86_64.
  
  echo yes | ./configure -platform linux-g++-64 -prefix $KDEINST
  # NB: change that to linux-g++-32 for a 32 bit build
  # check configure output before proceeding, to ensure that
  # qt will built with support for the following:
  # 
  # QtDBus module ....... yes (run-time)
  # GIF support ......... plugin
  # TIFF support ........ plugin (system)
  # JPEG support ........ plugin (system)
  # PNG support ......... yes (system)
  # MNG support ......... plugin (system)
  # zlib support ........ system
  # OpenSSL support ..... yes (run-time)
  #
  # If some of these are missing ("... no"), then it means you need
  # to install the relevant supporting libs and redo the qt configure
  # (make confclean, then redo configure)
  make -j 2
  make install
  # this takes approx 1 hour on a dual processor 2.5GHz PPC970
  # check that this installed correctly
  # - qmake is in $KDEINST/bin and is linked against stuff in
  #   $KDEINST/lib
  # - ditto designer and linguist
  # - check qmake, designer, linguist actually start up/run
Building KDE
~~~~~~~~~~~~
The basic deal is
for each package, use a separate source and build dir cd to the build
dir (can be anything)
then
 # note that LIB_SUFFIX must be "" for 32 bit builds and "64" for 64 bit builds
 rm -f CMakeCache.txt && cmake /path/to/source/tree/for/this/package -DCMAKE_INSTALL_PREFIX=$KDEINST -DCMAKE_BUILD_TYPE=debugfull -DLIB_SUFFIX=64 -DQT_QMAKE_EXECUTABLE=$KDEINST/bin/qmake
 # check output, particularly that it has the right Qt
 make 
 # make -j 2 quite often screws up
 make install
Packages should be built in the order: 
   kdesupport
   kdelibs
   kdepimlibs
   kdebase-runtime
   kdebase-workspace
   kdebase
This gives a working basic KDE.  Then build the rest in any order, perhaps:
   kdegraphics
   kdeadmin
   kdeutils
   kdenetwork
   kdepim
So the actual stuff to do is:
   cd ~
   mkdir build
   cd build
   mkdir kdesupport
   cd kdesupport
   rm -f CMakeCache.txt && cmake ~/trunk_kdesupport \
      -DCMAKE_INSTALL_PREFIX=$KDEINST -DCMAKE_BUILD_TYPE=debugfull \
      -DLIB_SUFFIX=64 -DQT_QMAKE_EXECUTABLE=$KDEINST/bin/qmake
   make -j 2
   make install
   cd ~/build
   mkdir kdelibs
   cd kdelibs
   rm -f CMakeCache.txt && cmake ~/trunk_KDE/kdelibs \
      -DCMAKE_INSTALL_PREFIX=$KDEINST -DCMAKE_BUILD_TYPE=debugfull \
      -DLIB_SUFFIX=64 -DQT_QMAKE_EXECUTABLE=$KDEINST/bin/qmake
   make -j 2
   make install
   cd ~/build
   mkdir kdepimlibs
   cd kdepimlibs
   rm -f CMakeCache.txt && cmake ~/trunk_KDE/kdepimlibs \
      -DCMAKE_INSTALL_PREFIX=$KDEINST -DCMAKE_BUILD_TYPE=debugfull \
      -DLIB_SUFFIX=64 -DQT_QMAKE_EXECUTABLE=$KDEINST/bin/qmake
   make -j 2
   make install
   cd ~/build
   mkdir kdebase-runtime
   cd kdebase-runtime
   rm -f CMakeCache.txt && cmake ~/trunk_KDE/kdebase/runtime \
      -DCMAKE_INSTALL_PREFIX=$KDEINST -DCMAKE_BUILD_TYPE=debugfull \
      -DLIB_SUFFIX=64 -DQT_QMAKE_EXECUTABLE=$KDEINST/bin/qmake
   make -j 2
   make install
   cd ~/build
   mkdir kdebase-workspace
   cd kdebase-workspace
   rm -f CMakeCache.txt && cmake ~/trunk_KDE/kdebase/workspace \
         -DCMAKE_INSTALL_PREFIX=$KDEINST -DCMAKE_BUILD_TYPE=debugfull \
         -DLIB_SUFFIX=64 -DQT_QMAKE_EXECUTABLE=$KDEINST/bin/qmake
   make -j 2
   make install
   cd ~/build
   mkdir kdebase-apps
   cd kdebase-apps
   rm -f CMakeCache.txt && cmake ~/trunk_KDE/kdebase/apps \
      -DCMAKE_INSTALL_PREFIX=$KDEINST -DCMAKE_BUILD_TYPE=debugfull \
      -DLIB_SUFFIX=64 -DQT_QMAKE_EXECUTABLE=$KDEINST/bin/qmake
   make -j 2
   make install
   cd ~/build
   mkdir kdegraphics
   cd kdegraphics
   rm -f CMakeCache.txt && cmake ~/trunk_KDE/kdegraphics \
      -DCMAKE_INSTALL_PREFIX=$KDEINST -DCMAKE_BUILD_TYPE=debugfull \
      -DLIB_SUFFIX=64 -DQT_QMAKE_EXECUTABLE=$KDEINST/bin/qmake
   make -j 2
   make install
   cd ~/build
   mkdir kdeadmin
   cd kdeadmin
   rm -f CMakeCache.txt && cmake ~/trunk_KDE/kdeadmin \
      -DCMAKE_INSTALL_PREFIX=$KDEINST -DCMAKE_BUILD_TYPE=debugfull \
      -DLIB_SUFFIX=64 -DQT_QMAKE_EXECUTABLE=$KDEINST/bin/qmake
   make -j 2
   make install
   cd ~/build
   mkdir kdeutils
   cd kdeutils
   rm -f CMakeCache.txt && cmake ~/trunk_KDE/kdeutils \
      -DCMAKE_INSTALL_PREFIX=$KDEINST -DCMAKE_BUILD_TYPE=debugfull \
      -DLIB_SUFFIX=64 -DQT_QMAKE_EXECUTABLE=$KDEINST/bin/qmake
   make -j 2
   make install
   cd ~/build
   mkdir kdenetwork
   cd kdenetwork
   rm -f CMakeCache.txt && cmake ~/trunk_KDE/kdenetwork \
      -DCMAKE_INSTALL_PREFIX=$KDEINST -DCMAKE_BUILD_TYPE=debugfull \
      -DLIB_SUFFIX=64 -DQT_QMAKE_EXECUTABLE=$KDEINST/bin/qmake
   make -j 2
   make install
   cd ~/build
   mkdir kdepim
   cd kdepim
   rm -f CMakeCache.txt && cmake ~/trunk_KDE/kdepim \
      -DCMAKE_INSTALL_PREFIX=$KDEINST -DCMAKE_BUILD_TYPE=debugfull \
      -DLIB_SUFFIX=64 -DQT_QMAKE_EXECUTABLE=$KDEINST/bin/qmake
   make -j 2
   make install
   cd ~/build
   mkdir kdeartwork
   cd kdeartwork
   rm -f CMakeCache.txt && cmake ~/trunk_KDE/kdeartwork \
      -DCMAKE_INSTALL_PREFIX=$KDEINST -DCMAKE_BUILD_TYPE=debugfull \
      -DLIB_SUFFIX=64 -DQT_QMAKE_EXECUTABLE=$KDEINST/bin/qmake
   make -j 2
   make install
   cd ~/build
   mkdir kdemultimedia
   cd kdemultimedia
   rm -f CMakeCache.txt && cmake ~/trunk_KDE/kdemultimedia \
      -DCMAKE_INSTALL_PREFIX=$KDEINST -DCMAKE_BUILD_TYPE=debugfull \
      -DLIB_SUFFIX=64 -DQT_QMAKE_EXECUTABLE=$KDEINST/bin/qmake
   make -j 2
   make install
   # still todo: koffice, amarok ?
Running KDE
~~~~~~~~~~~
Make sure dbus is running (pstree -p <myusername> | grep dbus)
If not running:
   eval `dbus-launch --auto-syntax`
probably best to ensure there's only one instance, to avoid confusion
You need PATH, LD_LIBRARY_PATH, XDG_DATA_DIRS and XDG_CONFIG_DIRS set as above
Then run  startkde  in an xterm on the new X server
 
     |