Merge pull request #74359 from worldofpeace/libappindicator-no-python2

libappindicator: remove python2
This commit is contained in:
Jan Tojnar 2019-11-28 13:14:25 +01:00 committed by GitHub
commit 60779d004e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,19 +1,18 @@
# TODO: Resolve the issues with the Mono bindings. # TODO: Resolve the issues with the Mono bindings.
{ stdenv, fetchurl, lib, file { stdenv, fetchurl, fetchpatch, lib, file
, pkgconfig, autoconf , pkgconfig, autoconf
, glib, dbus-glib, gtkVersion ? "3" , glib, dbus-glib, gtkVersion ? "3"
, gtk2 ? null, libindicator-gtk2 ? null, libdbusmenu-gtk2 ? null , gtk2 ? null, libindicator-gtk2 ? null, libdbusmenu-gtk2 ? null
, gtk3 ? null, libindicator-gtk3 ? null, libdbusmenu-gtk3 ? null , gtk3 ? null, libindicator-gtk3 ? null, libdbusmenu-gtk3 ? null
, python2Packages, gobject-introspection, vala , vala, gobject-introspection
, monoSupport ? false, mono ? null, gtk-sharp-2_0 ? null , monoSupport ? false, mono ? null, gtk-sharp-2_0 ? null
}: }:
with lib; with lib;
let
inherit (python2Packages) python pygobject2 pygtk; stdenv.mkDerivation rec {
in stdenv.mkDerivation rec {
name = let postfix = if gtkVersion == "2" && monoSupport then "sharp" else "gtk${gtkVersion}"; name = let postfix = if gtkVersion == "2" && monoSupport then "sharp" else "gtk${gtkVersion}";
in "libappindicator-${postfix}-${version}"; in "libappindicator-${postfix}-${version}";
version = "${versionMajor}.${versionMinor}"; version = "${versionMajor}.${versionMinor}";
@ -25,7 +24,7 @@ in stdenv.mkDerivation rec {
sha256 = "17xlqd60v0zllrxp8bgq3k5a1jkj0svkqn8rzllcyjh8k0gpr46m"; sha256 = "17xlqd60v0zllrxp8bgq3k5a1jkj0svkqn8rzllcyjh8k0gpr46m";
}; };
nativeBuildInputs = [ pkgconfig autoconf ]; nativeBuildInputs = [ pkgconfig autoconf vala gobject-introspection ];
propagatedBuildInputs = propagatedBuildInputs =
if gtkVersion == "2" if gtkVersion == "2"
@ -34,14 +33,20 @@ in stdenv.mkDerivation rec {
buildInputs = [ buildInputs = [
glib dbus-glib glib dbus-glib
python pygobject2 pygtk gobject-introspection vala
] ++ (if gtkVersion == "2" ] ++ (if gtkVersion == "2"
then [ libindicator-gtk2 ] ++ optionals monoSupport [ mono gtk-sharp-2_0 ] then [ libindicator-gtk2 ] ++ optionals monoSupport [ mono gtk-sharp-2_0 ]
else [ libindicator-gtk3 ]); else [ libindicator-gtk3 ]);
patches = [
# Remove python2 from libappindicator.
(fetchpatch {
name = "no-python.patch";
url = "https://src.fedoraproject.org/rpms/libappindicator/raw/8508f7a52437679fd95a79b4630373f08315f189/f/nopython.patch";
sha256 = "18b1xzvwsbhhfpbzf5zragij4g79pa04y1dk6v5ci1wsjvii725s";
})
];
postPatch = '' postPatch = ''
substituteInPlace configure.ac \
--replace '=codegendir pygtk-2.0' '=codegendir pygobject-2.0'
autoconf autoconf
for f in {configure,ltmain.sh,m4/libtool.m4}; do for f in {configure,ltmain.sh,m4/libtool.m4}; do
substituteInPlace $f \ substituteInPlace $f \
@ -64,7 +69,7 @@ in stdenv.mkDerivation rec {
doCheck = false; # generates shebangs in check phase, too lazy to fix doCheck = false; # generates shebangs in check phase, too lazy to fix
installFlags = [ installFlags = [
"sysconfdir=\${out}/etc" "sysconfdir=${placeholder "out"}/etc"
"localstatedir=\${TMPDIR}" "localstatedir=\${TMPDIR}"
]; ];