KOffice
From KDevelop
Contents |
[edit] Introduction
This is a summary of the steps to take if someone happens to be running Debian and wants to debug KOffice with KDevelop 3.0.
While I'm using Debian Unstable and certain parts of this guide are
very specific to that, the general points should be the same for other
distributions including other Debian versions. The primary items seem
to be --enable-debug=full in ./configure setting KDEDIR=/usr/local/kde, and running the kbuildsycoca executable afterward.
[edit] Requirements
First off, uninstall Debian's KOffice if you have them installed. I'm
not sure if this is strictly required, but when it finally worked, they
were uninstalled. If someone wiser than I can respond and confirm or
deny that this needs to be done, then please do so.
Also, if you are using the latest libxrender library then the .la file has moved and you'll most likely need to make a symlink:
ln -s /usr/lib/libXrender.la to /usr/X11R6/lib
Failure to do so will break the build (or at least so I'm told) until
configure scripts and Makefiles get used to the change in location....
[edit] Getting latest CVS version
Now you can follow the anonymous CVS instructions accessible from the
website. You'll need to checkout the koffice module. There are no
modules for just one app in the tree.
If you do not want to work with any particular app you can set the DO_NOT_COMPILE environment variable to exclude it. Since I wanted to work only on kword I set mine using:
export DO_NOT_COMPILE="karbon kchart kexi kivio koshell kpresenter krita kspread kugar"
Next cd into the koffice dir and execute:
./configure --enable-debug=full
Next execute:
make
When that's done, do a make install (as root). This can be done from a
CLI or within KDevelop. I did it from the CLI first, and then KDevelop
later.
The final steps to getting the CVS version to run are:
- set the environment variable KDEDIR=/usr/local/kde/
- rerun the command kbuildsycoca
Failure to do either of these resulted in an error about being unable
to find native MimeType in kword's desktop file. You can probably
replace kword with any application name. In my case the problem was
that instead of looking in /usr/local/kde/share/applnk/Office it only looked in /usr/share/applnk/Office.
I suggest you go to bed, or do something interesting while that initial
make compiles... It takes a while... I went on with installing kdevelop
and came back to do the kbuildsycoca thing later on in the process. :)
While installing KDevelop 3 it did not automatically uninstall kdevelop 2, I had to uninstall kdevelop-data, and one other kdevelop 2 related package that
didn't get automatically removed. Essentially they were having upgrade
problems which I used removal to reconcile. This won't be an issue if
you don't have KDevelop 2 installed first.
[edit] Working with KDevelop
Fire up KDevelop and use Project -> Import Existing Project.
Don't worry about all the CVS settings (though I'm sure someone can
make them work quite nicely) just name the project koffice, point it at
the top level CVS checkout directory that you compiled from and choose
"KDE C++ Application (Automake based)" as project type. When you hit ok
it will take a while to load the directory hierarchy.
After it's loaded, go to Project -> Project Options -> Run Options and add the environment variable KDEDIR and set it to /usr/local/kde/ or whatever you set the prefix to with configure in the above steps.
And lastly, assuming you want to work on a specific project you need to make that subproject active. In my case this was KWord.
On the right hand side in KDevelop open the Automake Manager tab. Find and select "kword" in the top half, then find and select kword (program in bin) from the bottom half. The kword (program in bin) entry in the bottom half is all the way at the bottom and has on subentry dummy.cc. Using the Right Mouse Button on the bottom "kword (program in bin)" entry select Make Target Active.
From here you can Build, Run, Debug, set breakpoints, navigate the
source as you see fit. As I mentioned earlier, it took me two days to
get all those steps completed but I think the results are well worth
it. It's important to do a make install after you change sometig and rebuild to get the newly updated items into the /usr/local/kde/ hierarchy, fortunately from this point on it's just focusing on updating the subproject and not all of KOffice.
Using "make install-exec" instead of "make install" only updates the
binaries, so it's faster as it doesn't copy the icons, documentation,
etc.
[edit] Thanks to
I'd like to thank dfaure, rwlbuis from #koffice, that guy from
- kdevelop, and an extra special thanks to calc and others on
- debian-kde for helping me get through all this. I'm posting this here
in the hopes that it will be useful to people and be memorialized
somewhere would-be developers on Debian can get to, or at least live in
the minds of those here so when someone else asks they can be pointed
in the right direction.