summary refs log tree commit diff
path: root/pkgs/applications/kde-apps-15.04/default.nix
blob: 213c70bfa23513450080dc4ba72a13b050fc038c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# Maintainer's Notes:
#
# Minor updates:
#  1. Edit ./manifest.sh to point to the updated URL. Upstream sometimes
#     releases updates that include only the changed packages; in this case,
#     multiple URLs can be provided and the results will be merged.
#  2. Run ./manifest.sh and ./dependencies.sh.
#  3. Build and enjoy.
#
# Major updates:
#  We prefer not to immediately overwrite older versions with major updates, so
#  make a copy of this directory first. After copying, be sure to delete ./tmp
#  if it exists. Then follow the minor update instructions.

{ autonix, symlinkJoin, kde4, kf5, pkgs, qt4, qt5, stdenv, callPackage, debug ? false }:

with stdenv.lib; with autonix;

let kf5Orig = kf5; in

let

  kf5 = kf5Orig.override { inherit debug qt5; };

  mirror = "mirror://kde";

  renames =
    (builtins.removeAttrs
      (import ./renames.nix {})
      ["Backend" "CTest"])
    // {
      "KDE4" = "kdelibs";
      "KF5KDEGames" = "libkdegames";
      "Kexiv2" = "libkexiv2";
      "Kdcraw" = "libkdcraw";
      "Kipi" = "libkipi";
      "LibKMahjongg" = "libkmahjongg";
      "LibKonq" = "kde-baseapps";
      "Marble" = "marble";
    };

  mkDerivation = drv: kf5.mkDerivation (drv // {
    preHook = (drv.preHook or "") + ''
      addQt4Plugins() {
        if [[ -d "$1/lib/qt4/plugins" ]]; then
            propagatedUserEnvPkgs+=" $1"
        fi

        if [[ -d "$1/lib/kde4/plugins" ]]; then
            propagatedUserEnvPkgs+=" $1"
        fi
      }

      envHooks+=(addQt4Plugins)
    '';
  });

  scope =
    # packages in this collection
    (mapAttrs (dep: name: kdeApps."${name}") renames) //
    # packages from KDE Frameworks 5
    kf5.scope //
    # packages from nixpkgs
    (with pkgs;
      {
        ACL = acl;
        Akonadi = kde4.akonadi;
        Alsa = alsaLib;
        Automoc4 = automoc4;
        Avahi = avahi;
        BISON = bison;
        Baloo = kde4.baloo;
        Boost = boost156;
        Canberra = libcanberra;
        Cdparanoia = cdparanoia;
        CUPS = cups;
        DBusMenuQt = libdbusmenu_qt;
        DjVuLibre = djvulibre;
        ENCHANT = enchant;
        EPub = ebook_tools;
        Eigen2 = eigen2;
        Eigen3 = eigen;
        Exiv2 = exiv2;
        FAM = fam;
        FFmpeg = ffmpeg;
        Flac = flac;
        FLEX = flex;
        Freetype = freetype;
        GMP = gmp;
        Gettext = gettext;
        Gpgme = gpgme;
        Gphoto2 = libgphoto2;
        Grantlee = grantlee;
        Grantlee5 = grantlee5;
        GSL = gsl;
        HUNSPELL = hunspell;
        HUpnp = herqq;
        Jasper = jasper;
        KActivities = kde4.kactivities;
        LCMS2 = lcms2;
        Ldap = openldap;
        LibAttica = attica;
        LibGcrypt = libgcrypt;
        LibSSH = libssh;
        LibSpectre = libspectre;
        LibVNCServer = libvncserver;
        Libical = libical;
        MusicBrainz3 = libmusicbrainz;
        NetworkManager = networkmanager;
        OggVorbis = libvorbis;
        OpenAL = openal;
        OpenEXR = openexr;
        Poppler = poppler_qt4;
        Prison = prison;
        PulseAudio = pulseaudio;
        PythonLibrary = python;
        Qalculate = libqalculate;
        QCA2 = qca2;
        QImageBlitz = qimageblitz;
        QJSON = qjson;
        Qt4 = qt4;
        Samba = samba;
        Sasl2 = cyrus_sasl;
        SharedDesktopOntologies = shared_desktop_ontologies;
        SndFile = libsndfile;
        Speechd = speechd;
        TIFF = libtiff;
        Taglib = taglib;
        TelepathyQt4 = telepathy_qt;
        TelepathyQt5 = telepathy_qt5;
        TunePimp = libtunepimp;
        UDev = udev;
        USB = libusb;
        Xscreensaver = xscreensaver;
        Xsltproc = libxslt;
      }
    );

  qt5Only = tgt:
    let qt4Deps = [ "KDE4" "Phonon" ];
    in mapAttrs (name: if name == tgt then removePkgDeps qt4Deps else id);

  preResolve = super:
    fold (f: x: f x) super
      [
        (qt5Only "kmix")
        (userEnvPkg "SharedMimeInfo")
        (userEnvPkg "SharedDesktopOntologies")
        (blacklist ["artikulate"]) # build failure, wrong boost?
        (blacklist ["kde-dev-scripts" "kde-dev-utils"]) # docbook errors
        (blacklist ["kdewebdev"]) # unknown build failure
      ];

  l10nPkgQt4 = orig:
    let drvName = builtins.parseDrvName orig.name; in
    mkDerivation {
      name = "${drvName.name}-qt4-${drvName.version}";
      inherit (orig) src;
      buildInputs = [ kdeApps.kdelibs ];
      nativeBuildInputs = with pkgs; [ cmake gettext perl ];
      preConfigure = ''
        cd 4/
      '';
    };

  l10nPkgQt5 = orig:
    let drvName = builtins.parseDrvName orig.name; in
    mkDerivation {
      name = "${drvName.name}-qt5-${drvName.version}";
      inherit (orig) src;
      buildInputs = with kf5; [ kdoctools ki18n ];
      nativeBuildInputs = with pkgs; [ cmake kf5.extra-cmake-modules gettext perl ];
      preConfigure = ''
        cd 5/
      '';
    };

  l10nPkg = name: orig: symlinkJoin orig.name [(l10nPkgQt4 orig) (l10nPkgQt5 orig)];

  removeL10nPkgs = filterAttrs (n: v: !(hasPrefix "kde-l10n") n);

  postResolve = super:
    (removeL10nPkgs super) // {

      ark = with pkgs; super.ark // {
        buildInputs = (super.ark.buildInputs or []) ++ [ makeWrapper ];
        postInstall = ''
          wrapProgram $out/bin/ark --prefix PATH : "${unzipNLS}/bin"
        '';
      };

      ffmpegthumbs = with pkgs; super.ffmpegthumbs // {
        nativeBuildInputs = super.ffmpegthumbs.nativeBuildInputs ++ [pkgconfig];
      };

      kaccounts-integration =
        let accounts-qt = pkgs.accounts-qt.override { inherit qt5; };
            signon = pkgs.signon.override { inherit qt5; };
        in super.kaccounts-integration // {
          buildInputs = super.kaccounts-integration.buildInputs
            ++ [ accounts-qt signon ];
        };

      kaccounts-providers = super.kaccounts-providers // {
        buildInputs = super.kaccounts-providers.buildInputs
          ++ (with pkgs; [ intltool libaccounts-glib ]);
        preConfigure = ''
          ${super.kaccounts-providers.preConfigure or ""}
          substituteInPlace webkit-options/CMakeLists.txt \
            --replace "/etc/signon-ui/webkit-options.d/" "$out/etc/signon-ui/webkit-options.d/"
        '';
      };

      kalzium = with pkgs; super.kalzium // {
        nativeBuildInputs = super.kalzium.nativeBuildInputs ++ [pkgconfig];
      };

      kate = super.kate // {
        buildInputs =
          super.kate.buildInputs
          ++ (with kf5; [ kconfig kguiaddons kiconthemes ki18n kinit kjobwidgets
                          kio kparts ktexteditor kwindowsystem kxmlgui ]);
        nativeBuildInputs = super.kate.nativeBuildInputs ++ (with kf5; [ kdoctools ]);
      };

      kde-runtime = with pkgs; super.kde-runtime // {
        buildInputs =
          super.kde-runtime.buildInputs ++ [libcanberra];
        nativeBuildInputs =
          super.kde-runtime.nativeBuildInputs ++ [pkgconfig];
        NIX_CFLAGS_COMPILE =
          (super.kde-runtime.NIX_CFLAGS_COMPILE or "")
          + " -I${ilmbase}/include/OpenEXR";
        meta = { priority = 10; };
      };

      kde-workspace = with pkgs; super.kde-workspace // {
        buildInputs = with xlibs;
          super.kde-workspace.buildInputs
          ++
          [
            libxkbfile libXcomposite xcbutilimage xcbutilkeysyms
            xcbutilrenderutil
          ];
        nativeBuildInputs =
          super.kde-workspace.nativeBuildInputs
          ++ [ pkgconfig ];
        meta = { priority = 10; };
      };

      kdelibs = with pkgs; super.kdelibs // {
        buildInputs =
          super.kdelibs.buildInputs ++ [ attr libxslt polkit_qt4 xz ];

        nativeBuildInputs =
          super.kdelibs.nativeBuildInputs ++ [ pkgconfig ];

        NIX_CFLAGS_COMPILE = "-I${ilmbase}/include/OpenEXR";

        propagatedBuildInputs =
          super.kdelibs.propagatedBuildInputs ++ [ qt4 soprano phonon strigi ];

        propagatedNativeBuildInputs =
          super.kdelibs.propagatedNativeBuildInputs
          ++ [ automoc4 cmake perl shared_mime_info ];

        patches = [ ./kdelibs/polkit-install.patch ];

        cmakeFlags = [
          "-DDOCBOOKXML_CURRENTDTD_DIR=${docbook_xml_dtd_42}/xml/dtd/docbook"
          "-DDOCBOOKXSL_DIR=${docbook_xsl}/xml/xsl/docbook"
          "-DHUPNP_ENABLED=ON"
          "-DWITH_SOLID_UDISKS2=ON"
          "-DKDE_DEFAULT_HOME=.kde"
        ];
      };

      kdenlive =
        let mlt = pkgs.mlt-qt5.override { inherit qt5; };
        in super.kdenlive // {
          buildInputs = super.kdenlive.buildInputs ++ [ mlt ];
        };

      kdepim = with pkgs; super.kdepim // {
        buildInputs =
          super.kdepim.buildInputs ++ [ gpgme libassuan ];
        nativeBuildInputs =
          super.kdepim.nativeBuildInputs ++ [ pkgconfig ];
      };

      kdepimlibs = with pkgs; super.kdepimlibs // {
        nativeBuildInputs =
          super.kdepimlibs.nativeBuildInputs ++ [ pkgconfig ];
      };

      kdesdk-thumbnailers = with pkgs; super.kdesdk-thumbnailers // {
        nativeBuildInputs =
          super.kdesdk-thumbnailers.nativeBuildInputs
          ++ [gettext];
      };

      kgpg = with pkgs; super.kgpg // {
        buildInputs = super.kgpg.buildInputs ++ [boost];
      };

      kmix = with pkgs; super.kmix // {
        nativeBuildInputs = super.kmix.nativeBuildInputs ++ [pkgconfig];
        cmakeFlags = [ "-DKMIX_KF5_BUILD=ON" ];
      };

      kmousetool = with pkgs; super.kmousetool // {
        buildInputs = with xlibs;
          super.kmousetool.buildInputs
          ++ [libXtst libXt];
      };

      kremotecontrol = with pkgs; super.kremotecontrol // {
        buildInputs = super.kremotecontrol.buildInputs ++ [xlibs.libXtst];
      };

      krfb = super.krfb // {
        buildInputs =
          super.krfb.buildInputs
          ++ [pkgs.xlibs.libXtst kde4.telepathy.common_internals];
      };

      libkdcraw = with pkgs; super.libkdcraw // {
        buildInputs = super.libkdcraw.buildInputs ++ [scope.KDE4 libraw];
        nativeBuildInputs = super.libkdcraw.nativeBuildInputs ++ [pkgconfig];
      };

      libkexiv2 = with pkgs; super.libkexiv2 // {
        buildInputs = super.libkexiv2.buildInputs ++ [exiv2 scope.KDE4];
      };

      libkface = with pkgs; super.libkface // {
        buildInputs = super.libkface.buildInputs ++ [scope.KDE4 opencv];
      };

      libkgeomap = super.libkgeomap // {
        cmakeFlags =
          (super.libkgeomap.cmakeFlags or [])
          ++ [
            "-DCMAKE_MODULE_PATH=${kdeApps.marble}/share/apps/cmake/modules"
          ];
      };

      libkipi = with pkgs; super.libkipi // {
        buildInputs = super.libkipi.buildInputs ++ [scope.KDE4];
      };

      libksane = with pkgs; super.libksane // {
        buildInputs = super.libksane.buildInputs ++ [scope.KDE4 saneBackends];
      };

      rocs = super.rocs // {
        buildInputs = super.rocs.buildInputs ++ (with kf5; [ kdelibs4support ]);
      };

      signon-kwallet-extension =
        let signon = pkgs.signon.override { inherit qt5; };
        in super.signon-kwallet-extension // {
          buildInputs = super.signon-kwallet-extension.buildInputs ++ [ signon ];
          preConfigure = ''
            ${super.signon-kwallet-extension.preConfigure or ""}
            sed -e "s,\''${SIGNONEXTENSION_PLUGINDIR},$out/lib/signon/extensions," \
                -i src/CMakeLists.txt
          '';
        };

    };

  l10nManifest =
    filterAttrs
      (n: v: hasPrefix "kde-l10n" n)
      (importManifest ./manifest.nix { inherit mirror; });

  kdeApps = generateCollection ./. {
    inherit mkDerivation;
    inherit mirror preResolve postResolve renames scope;
  };

in kdeApps // (mapAttrs l10nPkg l10nManifest)