2016-09-11 23:24:51 +02:00
|
|
|
{ stdenv, fetchurl, python, pkgconfig, gtk2, pygobject2, pycairo
|
2014-08-26 14:41:10 +02:00
|
|
|
, buildPythonPackage, libglade ? null, isPy3k }:
|
2005-04-22 20:26:04 +02:00
|
|
|
|
2013-01-11 17:45:26 +01:00
|
|
|
buildPythonPackage rec {
|
2014-05-07 14:53:07 +02:00
|
|
|
name = "pygtk-2.24.0";
|
2014-08-26 14:41:10 +02:00
|
|
|
|
|
|
|
disabled = isPy3k;
|
2008-03-17 14:45:50 +01:00
|
|
|
|
2005-04-22 20:26:04 +02:00
|
|
|
src = fetchurl {
|
2014-05-07 14:53:07 +02:00
|
|
|
url = "mirror://gnome/sources/pygtk/2.24/${name}.tar.bz2";
|
|
|
|
sha256 = "04k942gn8vl95kwf0qskkv6npclfm31d78ljkrkgyqxxcni1w76d";
|
2005-04-22 20:26:04 +02:00
|
|
|
};
|
2010-08-17 12:18:17 +02:00
|
|
|
|
2013-06-13 12:59:13 +02:00
|
|
|
buildInputs = [ pkgconfig ]
|
2010-10-19 00:55:20 +02:00
|
|
|
++ stdenv.lib.optional (libglade != null) libglade;
|
2007-05-13 23:15:41 +02:00
|
|
|
|
2016-09-11 23:24:51 +02:00
|
|
|
propagatedBuildInputs = [ gtk2 pygobject2 pycairo ];
|
2010-05-18 22:13:39 +02:00
|
|
|
|
2014-01-06 23:35:39 +01:00
|
|
|
configurePhase = "configurePhase";
|
|
|
|
|
|
|
|
buildPhase = "buildPhase";
|
|
|
|
|
|
|
|
installPhase = "installPhase";
|
|
|
|
|
2013-01-11 17:45:26 +01: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 22:13:39 +02:00
|
|
|
postInstall = ''
|
|
|
|
rm $out/bin/pygtk-codegen-2.0
|
2016-09-11 23:24:51 +02: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 \
|
2013-01-11 17:45:26 +01:00
|
|
|
$out/lib/${python.libPrefix}/site-packages/${name}.pth
|
2010-05-18 22:13:39 +02:00
|
|
|
'';
|
2005-04-22 20:26:04 +02:00
|
|
|
}
|