1{
2 mkDerivation, lib, fetchgit, fetchpatch,
3 extra-cmake-modules, kdoctools, wrapGAppsHook,
4 kcrash, kconfig, kinit, kparts
5}:
6
7mkDerivation rec {
8 name = "kdiff3-${version}";
9 version = "1.7.0-2017-02-19";
10
11 src = fetchgit {
12 # gitlab is outdated
13 url = https://anongit.kde.org/scratch/thomasfischer/kdiff3.git;
14 sha256 = "0znlk9m844a6qsskbd898w4yk48dkg5bkqlkd5abvyrk1jipzyy8";
15 rev = "0d2ac328164e3cbe2db35875d3df3a86187ae84f";
16 };
17
18 setSourceRoot = ''sourceRoot="$(echo */kdiff3/)"'';
19
20 patches = [
21 (fetchpatch {
22 name = "git-mergetool.diff"; # see https://gitlab.com/tfischer/kdiff3/merge_requests/2
23 url = "https://gitlab.com/vcunat/kdiff3/commit/6106126216.patch";
24 sha256 = "16xqc24y8bg8gzkdbwapiwi68rzqnkpz4hgn586mi01ngig2fd7y";
25 })
26 ];
27 patchFlags = "-p 2";
28
29 postPatch = ''
30 sed -re "s/(p\\[[^]]+] *== *)('([^']|\\\\')+')/\\1QChar(\\2)/g" -i src/diff.cpp
31 '';
32
33 nativeBuildInputs = [ extra-cmake-modules kdoctools wrapGAppsHook ];
34
35 propagatedBuildInputs = [ kconfig kcrash kinit kparts ];
36
37 meta = with lib; {
38 homepage = http://kdiff3.sourceforge.net/;
39 license = licenses.gpl2Plus;
40 description = "Compares and merges 2 or 3 files or directories";
41 maintainers = with maintainers; [ viric peterhoeg ];
42 platforms = with platforms; linux;
43 };
44}