Quick Start

Build-Tool provides a command called build-tool. This command is not able to compile anything. It is used to maintain and use recipes. So lets see which recipes currently are provided.

  1. <pre>$ build-tool recipes list
  2. </pre>

None. All recipes should be external to the script. Get the kde recipe with

  1. <pre>
  2. build-tool recipe add git://gitorious.org/build-tool/kde-trunk-recipe.git kde
  3. </re>

Let's start with the kde recipe. To use a recipe we have to install it first. We can get some insight without installing it.

  1. <pre>$ build-tool recipe info kde
  2. Description: Build the kde 4.x development branch.
  3. Website: <a href="http://www.kde.org
  4. Repository:" title="http://www.kde.org
  5. Repository:">http://www.kde.org
  6. Repository:</a> svn://anonsvn.kde.org/home/kde/trunk
  7. Browse Repository: <a href="http://websvn.kde.org/trunk
  8. Long" title="http://websvn.kde.org/trunk
  9. Long">http://websvn.kde.org/trunk
  10. Long</a> Description:
  11. A recipe to build the kde4 development branch. The core modules and some
  12. additional extragear and playground modules are provided.
  13.  
  14. Warning: This is the development branch for the next kde release. It is not
  15. necessarily stable!</pre>

And to install it.

  1. <pre>$ build-tool recipes install kde
  2.  
  3. Step 1)
  4. Add a symbolic link name 'kde-build' somewhere into your $PATH.
  5. Exactly one writeable directory found in your $PATH. Symbolic link will be
  6. created in : $HOME/bin
  7.  
  8. Step 2)
  9. Create a example configuration file. Please open the file in a editor and
  10. change it to your preferences. It is important to at least set LIB_SUFFIX and
  11. MAKEFLAGS to values your system needs or can handle.
  12.  
  13. LIB_SUFFIX is either '64', '32' or ''. Issue 'gcc -v' and search for
  14. --libdir=lib(64|32|). Set LIB_SUFFIX accordingly. If you can't see --libdir
  15. set LIB_SUFFIX to "". Those information is only correct if you not use the
  16. -m32 Generate 32bit i386 code
  17. -m64 Generate 64bit x86-64 code
  18. gcc options.
  19.  
  20. MAKEFLAGS can be used provide flags to the make command. The '-jN' options is
  21. used to parallelize the compiling. Set N to your the number of cpu cores+1 for
  22. a start.
  23.  
  24. You will find the file at /home/mjansen/.build-tool/kde.yaml.
  25.  
  26. chmod 100644
  27.  
  28. Step 3)
  29. Creating a local configuration file you can use to change very aspect from the
  30. global configuration file, You will find it at
  31. > /home/mjansen/.build-tool/kde/recipe
  32.  
  33. chmod 100644
  34.  
  35. Step 4)
  36. You now can start to use your recipe. The first command to look at are:
  37. # Show the configuration
  38. > kde-build info
  39. # Show all modules
  40. > kde-build module list
  41. # Show detailed info for a module
  42. > kde-build module info &lt;module>
  43. # Build a module (-u = enable updating)
  44. > kde-build build -u &lt;module>
  45. </pre>

Read the text carefully to understand what happened and adjust the configuration file. If you don't have a writable directory in your PATH variable you have to either change that and run the command again (it will not override anything) or create a symlink yourself. The command will tell you how to do that.

Use the command lsmods which is a shorthand for modules list to get a list of the available modules.

  1. <pre>$ kde-build lsmods
  2. kdesupport/automoc : no description
  3. kdesupport/polkit-qt : no description
  4. kdesupport/soprano : no description
  5. kdesupport/akonadi : no description
  6. kdesupport/phonon : no description
  7. kdesupport/dbusmenu-qt : no description
  8. kdesupport/strigi : no description
  9. kdesupport/attica : no description
  10. kdesupport/oscaf : no description
  11. kdesupport/taglib : no description
  12. kdesupport/taglib-extras : no description
  13. kdesupport/oxygen-icons : no description
  14. KDE/kdelibs : no description
  15. KDE/kdepimlibs : no description
  16. KDE/kdebase/runtime : no description
  17. KDE/kdebase/workspace : no description
  18. KDE/kdebase/apps : no description
  19. KDE/kdepim : no description
  20. kdeedu : no description
  21. kdegames : no description
  22. </pre>

Those - currently useless - descriptions are the forebringers of a feature which is not yet implemented. Let's have a more detailed look at the KDE/kdelibs module.

  1. <pre>$ kde-build module info KDE/kdelibs
  2.  
  3. #### Module KDE/kdelibs
  4. Active: true
  5. Repository: svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs
  6. Local Checkout: /home/mjansen/kde/trunk/src/KDE/kdelibs (EXISTS)
  7. Build Directory /home/mjansen/kde/trunk/bld/KDE/kdelibs (CONFIGURED)
  8. Prefix: /kde/trunk/kde
  9. Environment:
  10. CMAKE_PREFIX_PATH: /kde/trunk/support:/kde4/qt/4.6
  11. KDEDIRS: /kde/trunk/support
  12. LD_LIBRARY_PATH: /kde/trunk/support/lib64
  13. MAKEFLAGS: -j8
  14. MANPATH:
  15. PATH: /kde/trunk/support/bin:/usr/X11R6/bin:/usr/bin:/bin
  16. PKG_CONFIG_PATH: /kde/trunk/support/lib64/pkgconfig
  17. PYTHONPATH:
  18. QTDIR:
  19. STRIGI_PLUGIN_PATH: /kde/trunk/support/lib64/strigi
  20. XDG_DATA_DIRS: /kde/trunk/support:/usr/share:/share
  21. VCS: git-svn
  22. Remote: git-svn -> svn://anonsvn.kde.org/home/kde/trunk/KDE
  23. Build System: cmake
  24. Out Of Source Build true
  25. CMAKE_BUILD_TYPE: Debug
  26. CMAKE_CXXFLAGS: -Wall -pipe -O0
  27. CMAKE_VERBOSE_MAKEFILE: 1
  28. LIB_SUFFIX: 64
  29. #### Module KDE/kdelibs finished
  30. </pre>

If you want to change any of these settings you can do that in the files ~/.build-tool/kde.yaml or ~/.build-tool/kde/recipe. The information where that file is is available with the info command.

  1. <pre>$ kde-build info
  2. Recipe
  3. ------
  4. Name: kde
  5. Short: Build the kde 4.x development branch.
  6. Long: A recipe to build the kde4 development branch. The core modules and some
  7. additional extragear and playground modules are provided.
  8.  
  9. Warning: This is the development branch for the next kde release. It is not
  10. necessarily stable!
  11.  
  12. Full Path: /usr/lib64/ruby/gems/1.8/gems/build-tool-0.2/recipes/kde/recipe
  13.  
  14. Configuration
  15. -------------
  16. Settings: /home/mjansen/.build-tool/kde.yaml
  17. Overrides: /home/mjansen/.build-tool/kde/recipe </pre>

Have a look at the recipe specified after Full Pathabove to see how to write a recipe. I hope to get a tutorial up during the next week. After you tried changing some of the setting reissue the module infocommand to see if your change had the desired effect.

You now could start building kde. Just issue kde-build build kdesupport/. The kdesupport/ part specifies the modules to build as all modules that start with kdesupport/ in the order they are listed with the lsmods command.

Using Environments

Compiling stuff for the first time means problems. Missing dependencies or not found already installed dependencies are the usual trouble makers. To have a better shot at debugging those problems it is possible to open a shell with the exact environment the script uses to compile the module. There are two possibilities to do that kde-build module shell [module] or kde-build environment set [environment].

Features

The modules listed above are not the end of the recipe. They are just a sane starting point. If you want to enable more modules you have to look at features.

  1. <pre>$ kde-build lsfeatures
  2. Feature | A | Description
  3. ===========================================================
  4. bindings | N | KDE Language Bindings
  5. devel | N | KDE Development Tools (SDK)
  6. devel/icecream | N | Icecream
  7. finance | N | KDE Finance Applications
  8. graphics | N | KDE Graphics Applications
  9. kdeqt | N | KDE Qt Repository
  10. kdevelop | N | KDevelop (IDE)
  11. kdevelop/plugins | N | KDevelop plugins
  12. l10n | N | KDE Localization
  13. multimedia | N | KDE Multimedia Applications
  14. network | N | KDE Network Applications
  15. office | N | KDE Office Suite
  16. plasma | N | KDE Plasma
  17. scripting/python | N | KDE Python scripting support
  18. support | Y | KDE Support Modules
  19. utils | N | KDE Utils
  20. webdev | N | KDE Web Development (Quanta + KDevelop Plugins)
  21. webkit | N | WebKit related modules</pre>

As you can see most of the features are disabled by default. If you want to know more about a feature do

  1. <pre>$ kde-build lsfeature kdeqt
  2. Name : kdeqt
  3. Modules
  4. ====================================================
  5. qt/qt : no description
  6. qt/qimageblitz : no description
  7. qt/qca2 : no description
  8. qt/qtscriptgenerator: no description
  9. qt/poppler : no description
  10. qt/qjson : no description</pre>

It is recommended to use a distro build qt for kde development. But i usually fail to do that. So if you want a self compiled qt from the kdeqt gitorious clone enable the feature in $HOME/.build-tool/kde/recipe. Search for the disable feature "kdeqt" line and comment it out.

If you don't need all the modules above you can disable them selectively with

  1. disable
  2. module "qt/qjson".

Running a full kde session

If you successfully compiled at least kdesupport/ and KDE/ you probably wonder how to run the stuff. There are some possibilities.

First there is a description "Launching KDE 4 Sessions" on techbase

Or you use the supplied tools

Method one

build-tool provides a custom xsession script. Together with your login manager you should be able to use a session type custom or something like which look for a ~/.xsession file in you $HOME directory.

  1. <pre>$ kde-build files
  2. xsession
  3. finish_installation.sh
  4. kde4.desktop
  5.  
  6. $ kde-build files xsession > ~/.xsession
  7. </pre>

Method two

Inform your system there is a new session type in town.

  1. $ kde-build files xsession > $KDEDIR/bin/mystartkde
  2. $ chmod a+x $KDEDIR/bin/mystartkde
  3. $ kde-build files kde4.desktop > /usr/share/xsession/kde4trunk.desktop

Recent comments