summary refs log tree commit diff
path: root/pkgs/development/libraries/bamf/default.nix
blob: 1bce315878d078fd00e82c9fddbfee5b11a6116f (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
{ stdenv
, pantheon
, autoconf
, automake
, libtool
, gnome3
, which
, fetchgit
, libgtop
, libwnck3
, glib
, vala
, pkgconfig
, libstartup_notification
, gobject-introspection
, gtk-doc
, docbook_xsl
, xorgserver
, dbus
, python3
, wrapGAppsHook
}:

stdenv.mkDerivation rec {
  pname = "bamf";
  version = "0.5.4";

  outputs = [ "out" "dev" "devdoc" ];

  src = fetchgit {
    url = "https://git.launchpad.net/~unity-team/bamf";
    rev = version;
    sha256 = "1klvij1wyhdj5d8sr3b16pfixc1yk8ihglpjykg7zrr1f50jfgsz";
  };

  nativeBuildInputs = [
    (python3.withPackages (ps: with ps; [ lxml ])) # Tests
    autoconf
    automake
    dbus
    docbook_xsl
    gnome3.gnome-common
    gobject-introspection
    gtk-doc
    libtool
    pkgconfig
    vala
    which
    wrapGAppsHook
    xorgserver
  ];

  buildInputs = [
    glib
    libgtop
    libstartup_notification
    libwnck3
  ];

  patches = [
    # Port tests and checks to python3 lxml.
    ./gtester2xunit-python3.patch
  ];

  # Fix hard-coded path
  # https://bugs.launchpad.net/bamf/+bug/1780557
  postPatch = ''
    substituteInPlace data/Makefile.am \
      --replace '/usr/lib/systemd/user' '@prefix@/lib/systemd/user'
  '';

  configureFlags = [
    "--enable-gtk-doc"
    "--enable-headless-tests"
  ];

  # fix paths
  makeFlags = [
    "INTROSPECTION_GIRDIR=${placeholder "dev"}/share/gir-1.0/"
    "INTROSPECTION_TYPELIBDIR=${placeholder "out"}/lib/girepository-1.0"
  ];

  preConfigure = ''
    ./autogen.sh
  '';

  # TODO: Requires /etc/machine-id
  doCheck = false;

  # glib-2.62 deprecations
  NIX_CFLAGS_COMPILE = [
    "-DGLIB_DISABLE_DEPRECATION_WARNINGS"
  ];

  meta = with stdenv.lib; {
    description = "Application matching framework";
    longDescription = ''
      Removes the headache of applications matching
      into a simple DBus daemon and c wrapper library.
    '';
    homepage = https://launchpad.net/bamf;
    license = licenses.lgpl3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ davidak ] ++ pantheon.maintainers;
  };
}