1{ stdenv, fetchurl, lib, file
2, pkg-config, glib
3, gtkVersion ? "3", gtk2, gtk3 }:
4
5stdenv.mkDerivation rec {
6 pname = "libindicator-gtk${gtkVersion}";
7 version = "12.10.1";
8
9 src = fetchurl {
10 url = "https://launchpad.net/libindicator/${lib.versions.majorMinor version}/${version}/+download/libindicator-${version}.tar.gz";
11 sha256 = "b2d2e44c10313d5c9cd60db455d520f80b36dc39562df079a3f29495e8f9447f";
12 };
13
14 strictDeps = true;
15
16 nativeBuildInputs = [ pkg-config glib ];
17
18 buildInputs = [ (if gtkVersion == "2" then gtk2 else gtk3) ];
19
20 postPatch = ''
21 substituteInPlace configure \
22 --replace 'LIBINDICATOR_LIBS+="$LIBM"' 'LIBINDICATOR_LIBS+=" $LIBM"'
23 for f in {build-aux/ltmain.sh,configure,m4/libtool.m4}; do
24 substituteInPlace $f\
25 --replace /usr/bin/file ${file}/bin/file
26 done
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 doCheck = false; # fails 8 out of 8 tests
42
43 meta = with lib; {
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}