2019-11-29 00:46:10 +00:00
|
|
|
{ stdenv, fetchurl, fetchpatch, python, pkgconfig, gtk2, pygobject2, pycairo, pango
|
2014-08-26 13:41:10 +01:00
|
|
|
, buildPythonPackage, libglade ? null, isPy3k }:
|
2005-04-22 19:26:04 +01:00
|
|
|
|
2013-01-11 16:45:26 +00:00
|
|
|
buildPythonPackage rec {
|
2017-11-09 11:26:09 +00:00
|
|
|
pname = "pygtk";
|
|
|
|
version = "2.24.0";
|
2016-12-23 21:20:30 +00:00
|
|
|
|
2014-08-26 13:41:10 +01:00
|
|
|
disabled = isPy3k;
|
2008-03-17 13:45:50 +00:00
|
|
|
|
2005-04-22 19:26:04 +01:00
|
|
|
src = fetchurl {
|
2019-04-25 07:46:07 +01:00
|
|
|
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
|
2014-05-07 13:53:07 +01:00
|
|
|
sha256 = "04k942gn8vl95kwf0qskkv6npclfm31d78ljkrkgyqxxcni1w76d";
|
2005-04-22 19:26:04 +01:00
|
|
|
};
|
2010-08-17 11:18:17 +01:00
|
|
|
|
2019-11-29 00:46:10 +00:00
|
|
|
patches = [
|
|
|
|
# https://bugzilla.gnome.org/show_bug.cgi?id=660216 - fixes some memory leaks
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://gitlab.gnome.org/Archive/pygtk/commit/eca72baa5616fbe4dbebea43c7e5940847dc5ab8.diff";
|
|
|
|
sha256 = "031px4w5cshcx1sns430sdbr2i007b9zyb2carb3z65nzr77dpdd";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://gitlab.gnome.org/Archive/pygtk/commit/4aaa48eb80c6802aec6d03e5695d2a0ff20e0fc2.patch";
|
|
|
|
sha256 = "0z8cg7nr3qki8gg8alasdzzyxcihfjlxn518glq5ajglk3q5pzsn";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2017-09-05 22:26:13 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2019-10-23 10:41:56 +01:00
|
|
|
buildInputs = [
|
|
|
|
pango
|
|
|
|
] ++ stdenv.lib.optional (libglade != null) libglade;
|
2007-05-13 22:15:41 +01:00
|
|
|
|
2016-09-11 22:24:51 +01:00
|
|
|
propagatedBuildInputs = [ gtk2 pygobject2 pycairo ];
|
2010-05-18 21:13:39 +01:00
|
|
|
|
2014-01-06 22:35:39 +00:00
|
|
|
configurePhase = "configurePhase";
|
|
|
|
|
|
|
|
buildPhase = "buildPhase";
|
|
|
|
|
2016-12-23 21:20:30 +00:00
|
|
|
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-ObjC";
|
|
|
|
|
2014-01-06 22:35:39 +00:00
|
|
|
installPhase = "installPhase";
|
|
|
|
|
2013-01-11 16:45:26 +00:00
|
|
|
checkPhase = stdenv.lib.optionalString (libglade == null)
|
|
|
|
''
|
|
|
|
sed -i -e "s/glade = importModule('gtk.glade', buildDir)//" \
|
|
|
|
tests/common.py
|
|
|
|
sed -i -e "s/, glade$//" \
|
|
|
|
-e "s/.*testGlade.*//" \
|
|
|
|
-e "s/.*(glade.*//" \
|
|
|
|
tests/test_api.py
|
|
|
|
'' + ''
|
|
|
|
sed -i -e "s/sys.path.insert(0, os.path.join(buildDir, 'gtk'))//" \
|
|
|
|
-e "s/sys.path.insert(0, buildDir)//" \
|
|
|
|
tests/common.py
|
|
|
|
make check
|
|
|
|
'';
|
|
|
|
# XXX: TypeError: Unsupported type: <class 'gtk._gtk.WindowType'>
|
|
|
|
# The check phase was not executed in the previous
|
|
|
|
# non-buildPythonPackage setup - not sure why not.
|
|
|
|
doCheck = false;
|
|
|
|
|
2010-05-18 21:13:39 +01:00
|
|
|
postInstall = ''
|
|
|
|
rm $out/bin/pygtk-codegen-2.0
|
2016-09-11 22:24:51 +01:00
|
|
|
ln -s ${pygobject2}/bin/pygobject-codegen-2.0 $out/bin/pygtk-codegen-2.0
|
|
|
|
ln -s ${pygobject2}/lib/${python.libPrefix}/site-packages/pygobject-${pygobject2.version}.pth \
|
2019-04-25 07:46:07 +01:00
|
|
|
$out/lib/${python.libPrefix}/site-packages/${pname}-${version}.pth
|
2010-05-18 21:13:39 +01:00
|
|
|
'';
|
2019-04-25 07:46:07 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2019-09-03 23:49:40 +01:00
|
|
|
description = "GTK 2 Python bindings";
|
2019-04-25 07:46:07 +01:00
|
|
|
homepage = "https://gitlab.gnome.org/Archive/pygtk";
|
|
|
|
platforms = platforms.all;
|
|
|
|
license = with licenses; [ lgpl21Plus ];
|
|
|
|
};
|
2005-04-22 19:26:04 +01:00
|
|
|
}
|