1{ stdenv, fetchurl, lib, file
2, pkgconfig
3, gtkVersion, gtk2 ? null, gtk3 ? null }:
4
5with lib;
6
7stdenv.mkDerivation rec {
8 name = "libindicator-gtk${gtkVersion}-${version}";
9 version = "${versionMajor}.${versionMinor}";
10 versionMajor = "12.10";
11 versionMinor = "1";
12
13 src = fetchurl {
14 url = "${meta.homepage}/${versionMajor}/${version}/+download/libindicator-${version}.tar.gz";
15 sha256 = "b2d2e44c10313d5c9cd60db455d520f80b36dc39562df079a3f29495e8f9447f";
16 };
17
18 nativeBuildInputs = [ pkgconfig ];
19
20 buildInputs = [ (if gtkVersion == "2" then gtk2 else gtk3) ];
21
22 postPatch = ''
23 substituteInPlace configure \
24 --replace 'LIBINDICATOR_LIBS+="$LIBM"' 'LIBINDICATOR_LIBS+=" $LIBM"'
25 substituteInPlace {build-aux/ltmain.sh,configure,m4/libtool.m4} \
26 --replace /usr/bin/file ${file}/bin/file
27 '';
28
29 configureFlags = [
30 "CFLAGS=-Wno-error"
31 "--sysconfdir=/etc"
32 "--localstatedir=/var"
33 "--with-gtk=${gtkVersion}"
34 ];
35
36 installFlags = [
37 "sysconfdir=\${out}/etc"
38 "localstatedir=\${TMPDIR}"
39 ];
40
41 meta = {
42 description = "A set of symbols and convenience functions for Ayatana indicators";
43 homepage = "https://launchpad.net/libindicator";
44 license = licenses.gpl3;
45 platforms = platforms.linux;
46 maintainers = [ maintainers.msteen ];
47 };
48}