python3.pkgs.pygobject2: fix build

2.28.7 no longer installs codegen for Python 3:

2940d0c45c

so our postInstall broke.

No need to rename the pth file either, as pygtk does not work on Python 3.
This commit is contained in:
Jan Tojnar 2019-12-20 22:52:19 +01:00
parent 7887a81193
commit 136c83c977
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, python, buildPythonPackage, pkgconfig, glib }:
{ stdenv, fetchurl, python, buildPythonPackage, pkgconfig, glib, isPy3k }:
buildPythonPackage rec {
pname = "pygobject";
@ -25,7 +25,7 @@ buildPythonPackage rec {
# same site-packages: we need a pth file for both. pygtk.py would be
# used to select a specific version, in our setup it should have no
# effect, but we leave it in case somebody expects and calls it.
postInstall = ''
postInstall = stdenv.lib.optionalString (!isPy3k) ''
mv $out/lib/${python.libPrefix}/site-packages/{pygtk.pth,${pname}-${version}.pth}
# Prevent wrapping of codegen files as these are meant to be