1 { lib, stdenv, fetchurl, python, buildPythonPackage, pkg-config, glib, isPy3k, pythonAtLeast }:
3 buildPythonPackage rec {
7 disabled = pythonAtLeast "3.9";
10 url = "mirror://gnome/sources/pygobject/2.28/${pname}-${version}.tar.xz";
11 sha256 = "0nkam61rsn7y3wik3vw46wk5q2cjfh2iph57hl9m39rc8jijb7dv";
14 outputs = [ "out" "devdoc" ];
16 patches = lib.optionals stdenv.isDarwin [
17 ./pygobject-2.0-fix-darwin.patch
20 configureFlags = [ "--disable-introspection" ];
22 nativeBuildInputs = [ pkg-config ];
23 buildInputs = [ glib ];
25 # in a "normal" setup, pygobject and pygtk are installed into the
26 # same site-packages: we need a pth file for both. pygtk.py would be
27 # used to select a specific version, in our setup it should have no
28 # effect, but we leave it in case somebody expects and calls it.
29 postInstall = lib.optionalString (!isPy3k) ''
30 mv $out/lib/${python.libPrefix}/site-packages/{pygtk.pth,${pname}-${version}.pth}
32 # Prevent wrapping of codegen files as these are meant to be
33 # executed by the python program
34 chmod a-x $out/share/pygobject/*/codegen/*.py
38 homepage = "https://pygobject.readthedocs.io/";
39 description = "Python bindings for GLib";
40 platforms = platforms.unix;