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 for f in {build-aux/ltmain.sh,configure,m4/libtool.m4}; do
26 substituteInPlace $f\
27 --replace /usr/bin/file ${file}/bin/file
28 done
29 '';
30
31 configureFlags = [
32 "CFLAGS=-Wno-error"
33 "--sysconfdir=/etc"
34 "--localstatedir=/var"
35 "--with-gtk=${gtkVersion}"
36 ];
37
38 installFlags = [
39 "sysconfdir=\${out}/etc"
40 "localstatedir=\${TMPDIR}"
41 ];
42
43 meta = {
44 description = "A set of symbols and convenience functions for Ayatana indicators";
45 homepage = https://launchpad.net/libindicator;
46 license = licenses.gpl3;
47 platforms = platforms.linux;
48 maintainers = [ maintainers.msteen ];
49 };
50}