BuildingBibleTimeOnKDE4

From BibleTime

Jump to: navigation, search

This page describes how to build the BibleTime KDE4 port under any environment, not how to build any BibleTime version under KDE4. This is meant for those who want to develop BibleTime KDE4 version or just want to build it from source.

Contents

Prerequisites for building BibleTime for KDE4

It's important to have all prerequisites/dependencies installed before trying to build, otherwise you may get strange errors. The build tool doesn't always give informative messages.

Tools

  • g++ (gcc)
  • cmake
    • autotools are NOT needed! cmake takes care of everything.
  • make
  • gettext
  • svn client for getting the latest code
    • Probably we will release also some tarballs, svn is not necessary for those
  • Qt4 development tools (moc etc.) - should come with the Qt development package

Library dependencies

If you need to build something yourself remember the dependencies - most of the problems when building for example Sword come from lacking dependencies (clucene, icu...). The easiest way is to install the Sword and KDE4 binary and development packages with your system's package manager, that should take care of everything else including their tool and library dependencies.

  • sword binary and development libraries
  • clucene binary and development libraries
  • KDE4 binary and development libraries (kdelibs only, kde-base or desktop is not needed) and all their dependencies
    • If you want to compile KDE from source, there are directions here
    • ...but I have succeeded by just creating the build/ directory and running "cmake" and "make" there
  • Qt4 binary and development libraries, possibly bundled with kde4
  • Boost library

Again, for all libraries: remember that you have to have both binaries and development headers installed! Many distos have binary packages and -dev or -devel packages for them; for example libkde4 and libkde4-dev. And don't forget dependencies!

Building BibleTime for KDE4

Here's how to build the development version of BibleTime for KDE4:

Getting the code

The build script

  • run "./build*.sh" (build-debug.sh, build-release.sh)
  • build*.sh runs "make install" automatically.
    • For debug build there will be a bibletime binary in build/install/bin/, release build installs into /usr/local/. Debug build is recommended if you want a safe and easy install.

Manual cmake

If build*.sh fails or if you want to do it manually:

  • Create a build directory and cd into it
  • run "cmake -D MODE=DEBUG .." (see the build scripts for the MODE), or...
  • for interactive frontend: "ccmake -D MODE=DEBUG .."
    • Basic usage of ccmake: press c, check and possibly edit the variables. Press c again for another round until you see the option to 'generate and exit'. Press 'g'.
    • If there are errors: 'e' to exit help after the process errors, then on the list of variables move down to erroneous variable (for example in Kubuntu KDE4_INCLUDE_DIR was not found, it was /usr/lib/kde4/include), hit enter to input the correct value, then enter again.
  • If you need to hack further you can look at and edit CMakeCache.txt and run cmake again.
  • There will be makefiles in the ./build/ directory. Run "make" there to build BibleTime. Run "make install" to install it. Install location depends on the MODE (see above and read the build script).

If you will modify the sources and reinstall the application several times you can install only the binary without doc and message files. A feature by Martin: "You can run "cmake -D CMAKE_BUILD_TYPE=Debug_Binonly .." in build/. Then all subsequent "make install" calls will only install the binary. I hope this makes development easier for you and others."

After the first build

  • The source directory will not be touched or modified in any way. All the files made by the build process will be in the build/ directory. You can run "make" or "make install" there again.
  • The list of files to be build is in cmake/bibletime_source_list.cmake. New source files will be added there.
  • When something is changed or edited you have to run make or even cmake again:
    • If CMakeLists.txt file in bibletime dir has been changed, running make should be enough; it re-runs cmake automatically.
    • If files have been added/removed to/from the source tree and bibletime_source_list.cmake, running make should be enough.
    • If the underlying system (libraries, tools etc.) has been radically changed you have to delete CMakeCache.txt file from build dir and run cmake or the build script again.
    • Sometimes it may be useful to delete the whole build directory and start from scratch.
  • After running cmake once you can build the project with KDevelop (Build->Build Project and/or Build->Install)
    • There is a kdevelop project file in the base directory.

Troubleshooting

  • Did you remember all prerequisites? Most of the build problems (with any project, not only BibleTime) come from lacking dependencies, either tools, binaries or development headers.
  • Distro packagers don't notice all bugs, there might be something wrong with cmake files of KDE or Qt so that all files are not found.
    • "No rule to make target `/usr/lib/libICE.so', needed by `bibletime'" is an example from real life for two previous items. There seemed to be some bug in some Kubuntu 8.04 package which caused some X11 related development libraries being installed automatically. The -dev libraries had to be installed manually. Additionally the make system error description is exceptionally misleading.
  • We have had problems ourselves and had to write some cmake hacks. KDE4 is a new thing for packagers, Cmake and KDE/Qt4 is new to us, our code is not well tested yet. Problems are likely.
  • KDE4 is a moving target right now, there have been problems (crashing bugs) with certain buggy KDE4 releases.
  • CMakeLists.txt file in bibletime directory includes some custom cmake files which are in cmake/ directory. Look at them if the build system doesn't find clucene or sword.
  • If the linking phase fails check if you have the requested library installed but having no .so link. For example if the linker complains about the missing -lphonon library, it's possible that you have libphonon.so.4 but not libphonon.so link (this is a real example from the Kubuntu 8.04).
  • You can ask help in bt-devel email list or possibly in the Discussion page of this page.
Personal tools