summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/li/libappindicator/package.nix
blob: d4b6059d6b085305c6987bd6dbb5f8d893c49920 (plain)
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
{
  stdenv,
  fetchgit,
  lib,
  pkg-config,
  autoreconfHook,
  glib,
  dbus-glib,
  gtk3,
  libindicator,
  libdbusmenu-gtk3,
  gtk-doc,
  vala,
  gobject-introspection,
  monoSupport ? false,
  mono,
  gtk-sharp-3_0,
  testers,
}:

stdenv.mkDerivation (finalAttrs: {
  pname =
    let
      postfix = if monoSupport then "sharp" else "gtk3";
    in
    "libappindicator-${postfix}";
  version = "12.10.1+20.10.20200706.1";

  outputs = [
    "out"
    "dev"
  ];

  src = fetchgit {
    url = "https://git.launchpad.net/ubuntu/+source/libappindicator";
    rev = "fe25e53bc7e39cd59ad6b3270cd7a6a9c78c4f44";
    sha256 = "0xjvbl4gn7ra2fs6gn2g9s787kzb5cg9hv79iqsz949rxh4iw32d";
  };

  nativeBuildInputs = [
    pkg-config
    autoreconfHook
    vala
    gobject-introspection
    gtk-doc
  ];

  propagatedBuildInputs = [
    gtk3
    libdbusmenu-gtk3
  ];

  buildInputs = [
    glib
    dbus-glib
    libindicator
  ]
  ++ lib.optionals monoSupport [
    mono
    gtk-sharp-3_0
  ];

  preAutoreconf = ''
    gtkdocize
  '';

  configureFlags = [
    "CFLAGS=-Wno-error"
    "--sysconfdir=/etc"
    "--localstatedir=/var"
    "--with-gtk=3"
  ];

  doCheck = false; # generates shebangs in check phase, too lazy to fix

  installFlags = [
    "sysconfdir=${placeholder "out"}/etc"
    "localstatedir=\${TMPDIR}"
  ];

  passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;

  meta = {
    description = "Library to allow applications to export a menu into the Unity Menu bar";
    homepage = "https://launchpad.net/libappindicator";
    license = with lib.licenses; [
      lgpl21
      lgpl3
    ];
    pkgConfigModules = [ "appindicator3-0.1" ];

    platforms = lib.platforms.linux;
    maintainers = [ lib.maintainers.msteen ];
    # TODO: Resolve the issues with the Mono bindings.
    broken = monoSupport;
  };
})