linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / python-modules / pygobject / default.nix
blobbf42d17b4debf462fad5a35e63db12e03c392d0f
1 { lib, stdenv, fetchurl, python, buildPythonPackage, pkg-config, glib, isPy3k, pythonAtLeast }:
3 buildPythonPackage rec {
4   pname = "pygobject";
5   version = "2.28.7";
6   format = "other";
7   disabled = pythonAtLeast "3.9";
9   src = fetchurl {
10     url = "mirror://gnome/sources/pygobject/2.28/${pname}-${version}.tar.xz";
11     sha256 = "0nkam61rsn7y3wik3vw46wk5q2cjfh2iph57hl9m39rc8jijb7dv";
12   };
14   outputs = [ "out" "devdoc" ];
16   patches = lib.optionals stdenv.isDarwin [
17     ./pygobject-2.0-fix-darwin.patch
18   ];
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
35   '';
37   meta = with lib; {
38     homepage = "https://pygobject.readthedocs.io/";
39     description = "Python bindings for GLib";
40     platforms = platforms.unix;
41   };