1# TODO: Resolve the issues with the Mono bindings.
2
3{ stdenv, fetchurl, lib, file
4, pkgconfig, autoconf
5, glib, dbus_glib, libdbusmenu-glib
6, gtkVersion, gtk2 ? null, gtk3 ? null
7, python, pygobject, pygtk, gobjectIntrospection, vala, gnome_doc_utils
8, monoSupport ? false, mono ? null, gtk-sharp ? null
9 }:
10
11with lib;
12
13stdenv.mkDerivation rec {
14 name = let postfix = if gtkVersion == "2" && monoSupport then "sharp" else "gtk${gtkVersion}";
15 in "libindicate-${postfix}-${version}";
16 version = "${versionMajor}.${versionMinor}";
17 versionMajor = "12.10";
18 versionMinor = "1";
19
20 src = fetchurl {
21 url = "${meta.homepage}/${versionMajor}/${version}/+download/libindicate-${version}.tar.gz";
22 sha256 = "10am0ymajx633b33anf6b79j37k61z30v9vaf5f9fwk1x5cw1q21";
23 };
24
25 nativeBuildInputs = [ pkgconfig autoconf ];
26
27 buildInputs = [
28 glib dbus_glib libdbusmenu-glib
29 python pygobject pygtk gobjectIntrospection vala gnome_doc_utils
30 ] ++ (if gtkVersion == "2"
31 then [ gtk2 ] ++ optionals monoSupport [ mono gtk-sharp ]
32 else [ gtk3 ]);
33
34 postPatch = ''
35 substituteInPlace configure.ac \
36 --replace '=codegendir pygtk-2.0' '=codegendir pygobject-2.0' \
37 --replace 'pyglib-2.0-python$PYTHON_VERSION' 'pyglib-2.0-python'
38 autoconf
39 substituteInPlace {configure,ltmain.sh,m4/libtool.m4} \
40 --replace /usr/bin/file ${file}/bin/file
41 '';
42
43 configureFlags = [
44 "CFLAGS=-Wno-error"
45 "--sysconfdir=/etc"
46 "--localstatedir=/var"
47 "--with-gtk=${gtkVersion}"
48 ];
49
50 installFlags = [
51 "sysconfdir=\${out}/etc"
52 "localstatedir=\${TMPDIR}"
53 ];
54
55 meta = {
56 description = "Library for raising indicators via DBus";
57 homepage = "https://launchpad.net/libindicate";
58 license = with licenses; [ lgpl21 lgpl3 ];
59 platforms = platforms.linux;
60 maintainers = [ maintainers.msteen ];
61 };
62}