about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix
blob: 5c1c399ab49a75c572c695c47e10cb35c9a4e395 (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
{ stdenv, fetchurl, fetchgit, telepathy_qt, kdelibs, kde_workspace, gettext, dbus_libs
, pkgconfigUpstream , qt_gstreamer, telepathy_glib, telepathy_logger, qjson, flex, bison }:

let
  pkgconfig = pkgconfigUpstream;
  version = "0.4.0";
  manifest = import (./. + "/${version}.nix");

  overrides = {
    telepathy_logger_qt = x : x // {
      NIX_CFLAGS_COMPILE = "-I${dbus_libs}/include/dbus-1.0";
    };
  };

  extraBuildInputs = {
    auth_handler = [ qjson ];
    call_ui = [ qt_gstreamer telepathy_glib ];
    contact_applet = [ kde_workspace ];
    telepathy_logger_qt = [ telepathy_logger qt_gstreamer ];
    text_ui = [ ktp.telepathy_logger_qt qt_gstreamer telepathy_logger ];
  };

  extraNativeBuildInputs = {
    telepathy_logger_qt = [ flex bison ];
  };

  ktpFun = { name, key, sha256 }:
  {
    name = key;
    value = stdenv.mkDerivation (
      (stdenv.lib.attrByPath [ key ] (x : x) overrides)
      {
        name = "${name}-${version}";

        src = fetchurl {
          url = "mirror://kde/unstable/kde-telepathy/${version}/src/${name}-${version}.tar.bz2";
          inherit sha256;
        };

        nativeBuildInputs = [ gettext pkgconfig ] ++ (stdenv.lib.attrByPath [ key ] [] extraNativeBuildInputs);
        buildInputs = [ kdelibs telepathy_qt ]
          ++ stdenv.lib.optional (name != "ktp-common-internals") ktp.common_internals
          ++ (stdenv.lib.attrByPath [ key ] [] extraBuildInputs);

        meta = {
          inherit (kdelibs.meta) platforms;
          maintainers = [ stdenv.lib.maintainers.urkud ];
        };
      }
    );
  };

  ktp = builtins.listToAttrs (map ktpFun manifest);
in
ktp // {
  inherit version;
  recurseForDerivations = true;
  full = stdenv.lib.attrValues ktp;
}