1{ stdenv, fetchurl, python, buildPythonPackage, pkgconfig, glib }:
2
3buildPythonPackage rec {
4 pname = "pygobject";
5 version = "2.28.6";
6 format = "other";
7 name = pname + "-" + version;
8
9 src = fetchurl {
10 url = "mirror://gnome/sources/pygobject/2.28/${name}.tar.xz";
11 sha256 = "1f5dfxjnil2glfwxnqr14d2cjfbkghsbsn8n04js2c2icr7iv2pv";
12 };
13
14 outputs = [ "out" "devdoc" ];
15
16 patches = [
17 # Fix warning spam
18 ./pygobject-2.28.6-set_qdata.patch
19 ./pygobject-2.28.6-gio-types-2.32.patch
20 ] ++ stdenv.lib.optionals stdenv.isDarwin [
21 ./pygobject-2.0-fix-darwin.patch
22 ];
23
24 configureFlags = [ "--disable-introspection" ];
25
26 nativeBuildInputs = [ pkgconfig ];
27 buildInputs = [ glib ];
28
29 # in a "normal" setup, pygobject and pygtk are installed into the
30 # same site-packages: we need a pth file for both. pygtk.py would be
31 # used to select a specific version, in our setup it should have no
32 # effect, but we leave it in case somebody expects and calls it.
33 postInstall = ''
34 mv $out/lib/${python.libPrefix}/site-packages/{pygtk.pth,${name}.pth}
35
36 # Prevent wrapping of codegen files as these are meant to be
37 # executed by the python program
38 chmod a-x $out/share/pygobject/*/codegen/*.py
39 '';
40
41 meta = {
42 homepage = http://live.gnome.org/PyGObject;
43 description = "Python bindings for Glib";
44 platforms = stdenv.lib.platforms.unix;
45 };
46}