mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-14 08:34:50 +00:00
136c83c977
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.
42 lines
1.3 KiB
Nix
42 lines
1.3 KiB
Nix
{ stdenv, fetchurl, python, buildPythonPackage, pkgconfig, glib, isPy3k }:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pygobject";
|
|
version = "2.28.7";
|
|
format = "other";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://gnome/sources/pygobject/2.28/${pname}-${version}.tar.xz";
|
|
sha256 = "0nkam61rsn7y3wik3vw46wk5q2cjfh2iph57hl9m39rc8jijb7dv";
|
|
};
|
|
|
|
outputs = [ "out" "devdoc" ];
|
|
|
|
patches = stdenv.lib.optionals stdenv.isDarwin [
|
|
./pygobject-2.0-fix-darwin.patch
|
|
];
|
|
|
|
configureFlags = [ "--disable-introspection" ];
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
buildInputs = [ glib ];
|
|
|
|
# in a "normal" setup, pygobject and pygtk are installed into the
|
|
# 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 = 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
|
|
# executed by the python program
|
|
chmod a-x $out/share/pygobject/*/codegen/*.py
|
|
'';
|
|
|
|
meta = {
|
|
homepage = "https://pygobject.readthedocs.io/";
|
|
description = "Python bindings for GLib";
|
|
platforms = stdenv.lib.platforms.unix;
|
|
};
|
|
}
|