building kompare from svn

Yngve Inntjore Levinsen yngve.levinsen at gmail.com
Mon Oct 25 09:39:53 CEST 2010


Dear Kevin,

Thank you for a very in depth answer. Terrible to hear that Kompare almost didn't make it into KDE4, it is quite a nice tool! I apologize my late answer, I tried to see how far I could get myself before I got properly stuck.

I seem to have several problems with the CMakeLists.txt file(-s).

The first one is a missing "cmake_minimum_required(VERSION 2.6)" (or whichever version is required) on top of the file. This is just a warning though.

The next (error) is "Unknown CMake command "kde4_add_library"." This can be fixed with the following four lines:
find_package(KDE4 REQUIRED)
find_package(Qt4 REQUIRED)
include(KDE4Defaults)
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})

The next is that komparesaveoptionsbase.cpp is not in the komparepart subfolder anymore. I remove this file from the list in komparepart/CMakeLists.txt and then cmake runs without errors. 

Make crashes immediately because it doesn't find qglobal.h (which I have in /usr/include/Qt/ and several other places). I also had issues with the forms of e.g. "include <KUrl>" which I changed to "include <kurl.h>" and then it worked. No idea why, perhaps you know?

Make then could not find diff2export.h, which is not in the source directories in this branch. I copied this file from trunk. Then I got to "libdiff2/kompareprocess.cpp" which didn't find diffsettings.h. This was because in this CMakeLists.txt file it was assumed that the project were in a kompare subfolder. I removed this and then I got stuck with the following error:

[...]/3_way_kompare/interfaces/kompareinterface.h:91:86: error: no matching function for call to ‘QObject::QObject(QObject*&, const char [24])’
/usr/include/QtCore/qobject.h:309:5: note: candidates are: QObject::QObject(const QObject&)
/usr/include/QtCore/qobject.h:293:5: note:                 QObject::QObject(QObjectPrivate&, QObject*)
/usr/include/QtCore/qobject.h:128:26: note:                 QObject::QObject(QObject*)
make[2]: *** [interfaces/CMakeFiles/kompareinterface.dir/kompareinterface.o] Error 1
make[1]: *** [interfaces/CMakeFiles/kompareinterface.dir/all] Error 2
make: *** [all] Error 2

Please find attached the diff file of the changes I made to get this far. You probably know which of them should be used and which not to use... And please let me know where I go wrong! :)

Cheers
Yngve


On Friday 22 October 2010 00:10:39 Kevin Kofler wrote:
> On Tuesday 19 October 2010, Yngve Inntjore Levinsen wrote:
> > I am trying to build kompare from svn, but I am not succeeding. I do not
> > find installation instructions on your web page (
> > http://www.caffeinated.me.uk/kompare/ ), only where to find your svn
> > repository. I tried to download this and use cmake (which I am fairly used
> > to), but it does not build.
> 
> Well, the web page you found does not tell the whole story about Kompare.
> 
> So what happens is that there are 2 main branches of Kompare:
> 
> 1. the kdesdk trunk, from which KDE release branches are cut (and releases are 
> then tagged from those branches). This is basically a straight KDE 4 port of 
> the same old codebase we shipped in 3.x, I did this in a rush to keep Kompare 
> from getting dropped for 4.0.0, seeing how 3_way_kompare (see below) wasn't 
> getting ready in time. Doing the port is what earned me the status of 
> maintainer for Kompare, though admittedly I'm not doing as good a job at it as 
> I'd like to. I'm keeping the trunk in shape, basically fixing bugs (or at least 
> trying to), Otto Bruggeman (a former maintainer of Kompare) has also recently 
> fixed a bunch of bugs, but none of us has time to develop new features.
> 
> 2. the 3_way_kompare branch, which is pointed to by the web page you found. 
> That branch is basically a one-man show by Jeff Snyder (je4d in KDE SVN), the 
> person who put up that web page, who is semi-actively maintaining it. At the 
> time Kompare was to be dropped from the first KDE 4 release (which is when I 
> stepped in to resurrect the original codebase in the trunk), this branch was 
> in a very sorry state and didn't even compile. When I resurrected the trunk, I 
> also fixed 3_way_kompare to at least build (but keep in mind that that was in 
> 4.0.0 era, so there might be some new breakage from newer Qt and kdelibs), but 
> it needed a lot of work to get into shape, so I decided to focus on what 
> worked to get something running quickly (time was running really short for 
> 4.0.0 and nobody else was interested in saving Kompare from the impending 
> removal). In the meantime, Jeff Snyder made some improvements, so I'm not sure 
> of the current status. (There may or may not still be significant regressions 
> from the trunk.) If you're interested in this branch, I'd suggest contacting 
> Jeff Snyder directly (I CCed him to this mail). Just be aware that, at least 
> last I checked, the branch does not actually have 3-way functionality yet.
> 
> As for which branch to focus on, that's a tough question. The trunk is what 
> currently ends up in the releases, but the long-term goal of 3_way_kompare is 
> to replace the current trunk. (Whether it'll actually achieve this is an open 
> question.) Not all changes from the trunk have been merged into the branch 
> (Jeff Snyder merged some changes, but I'm not sure he caught all of them; in 
> any case, the most recent ones are definitely missing), nor have all the branch 
> changes been merged into the trunk (I merged some of them: a clean 
> implementation of the splitter using the new features of the Qt 4 QSplitter 
> instead of the old hack of the Qt 3 QSplitter, a "refresh diff" menu entry and 
> one or two bugfixes). If we want 3_way_kompare to become the new trunk, we need 
> to make sure that all the improvements done on the trunk land in the branch. 
> If on the other hand we want to just cherry-pick improvements from 
> 3_way_kompare into the current trunk, there is probably more stuff in 
> 3_way_kompare worth merging. The problem is that not all of the improvements 
> in 3_way_kompare are finished.
> 
> > Could someone point me to installation instructions? Thanks!
> 
> So in short, you need to have kdelibs installed, along with the files needed 
> for software development (which are often in a separate package, e.g. kdelibs-
> devel on Fedora). Then, for the 3_way_kompare branch, you should only need to 
> build it like any other CMake-using package? What errors do you get? The 
> trunk, on the other hand, is part of kdesdk, and so you'll want to run cmake 
> on the whole kdesdk directory. You can then run make only for the kompare 
> subdirectory if you don't want to build all of kdesdk.
> 
>         Kevin Kofler
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: changes.diff
Type: text/x-patch
Size: 4211 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kompare-devel/attachments/20101025/31e3d120/attachment.diff 


More information about the Kompare-devel mailing list