@@ -1,19 +1,18 @@
11# TODO: Resolve the issues with the Mono bindings.
22
3−{ stdenv, fetchurl, lib, file
3+{ stdenv, fetchurl, fetchpatch, lib, file
44, pkgconfig, autoconf
55, glib, dbus-glib, gtkVersion ? "3"
66, gtk2 ? null, libindicator-gtk2 ? null, libdbusmenu-gtk2 ? null
77, gtk3 ? null, libindicator-gtk3 ? null, libdbusmenu-gtk3 ? null
8−, python2Packages, gobject-introspection, vala
8+, vala, gobject-introspection
99, monoSupport ? false, mono ? null, gtk-sharp-2_0 ? null
1010 }:
1111
1212with lib;
1313
14−let
15− inherit (python2Packages) python pygobject2 pygtk;
16−in stdenv.mkDerivation rec {
14+
15+stdenv.mkDerivation rec {
1716 name = let postfix = if gtkVersion == "2" && monoSupport then "sharp" else "gtk${gtkVersion}";
1817 in "libappindicator-${postfix}-${version}";
1918 version = "${versionMajor}.${versionMinor}";
@@ -25,7 +24,7 @@ in stdenv.mkDerivation rec {
2524 sha256 = "17xlqd60v0zllrxp8bgq3k5a1jkj0svkqn8rzllcyjh8k0gpr46m";
2625 };
2726
28− nativeBuildInputs = [ pkgconfig autoconf ];
27+ nativeBuildInputs = [ pkgconfig autoconf vala gobject-introspection ];
2928
3029 propagatedBuildInputs =
3130 if gtkVersion == "2"
@@ -34,14 +33,20 @@ in stdenv.mkDerivation rec {
3433
3534 buildInputs = [
3635 glib dbus-glib
37− python pygobject2 pygtk gobject-introspection vala
3836 ] ++ (if gtkVersion == "2"
3937 then [ libindicator-gtk2 ] ++ optionals monoSupport [ mono gtk-sharp-2_0 ]
4038 else [ libindicator-gtk3 ]);
4139
40+ patches = [
41+ # Remove python2 from libappindicator.
42+ (fetchpatch {
43+ name = "no-python.patch";
44+ url = "https://src.fedoraproject.org/rpms/libappindicator/raw/8508f7a52437679fd95a79b4630373f08315f189/f/nopython.patch";
45+ sha256 = "18b1xzvwsbhhfpbzf5zragij4g79pa04y1dk6v5ci1wsjvii725s";
46+ })
47+ ];
48+
4249 postPatch = ''
43− substituteInPlace configure.ac \
44− --replace '=codegendir pygtk-2.0' '=codegendir pygobject-2.0'
4550 autoconf
4651 for f in {configure,ltmain.sh,m4/libtool.m4}; do
4752 substituteInPlace $f \
@@ -64,7 +69,7 @@ in stdenv.mkDerivation rec {
6469 doCheck = false; # generates shebangs in check phase, too lazy to fix
6570
6671 installFlags = [
67− "sysconfdir=\${out}/etc"
72+ "sysconfdir=${placeholder "out"}/etc"
6873 "localstatedir=\${TMPDIR}"
6974 ];
7075