2013-06-13 10:59:13 +00:00
|
|
|
{ stdenv, fetchurl, python, pkgconfig, gtk, pygobject, pycairo
|
2013-01-11 16:45:26 +00:00
|
|
|
, buildPythonPackage, libglade ? null }:
|
2005-04-22 18:26:04 +00:00
|
|
|
|
2013-01-11 16:45:26 +00:00
|
|
|
buildPythonPackage rec {
|
2010-10-18 22:55:20 +00:00
|
|
|
name = "pygtk-2.22.0";
|
2008-03-17 13:45:50 +00:00
|
|
|
|
2005-04-22 18:26:04 +00:00
|
|
|
src = fetchurl {
|
2013-07-14 02:23:06 +00:00
|
|
|
url = "mirror://gnome/sources/pygtk/2.22/${name}.tar.bz2";
|
2010-10-18 22:55:20 +00:00
|
|
|
sha256 = "4acf0ef2bde8574913c40ee4a43d9c4f43bb77b577b67147271b534501a54cc8";
|
2005-04-22 18:26:04 +00:00
|
|
|
};
|
2010-08-17 10:18:17 +00:00
|
|
|
|
2013-06-13 10:59:13 +00:00
|
|
|
buildInputs = [ pkgconfig ]
|
2010-10-18 22:55:20 +00:00
|
|
|
++ stdenv.lib.optional (libglade != null) libglade;
|
2007-05-13 21:15:41 +00:00
|
|
|
|
2013-06-13 10:59:13 +00:00
|
|
|
propagatedBuildInputs = [ gtk pygobject pycairo ];
|
2010-05-18 20:13:39 +00:00
|
|
|
|
2013-01-11 16:45:26 +00:00
|
|
|
installCommand = "make install";
|
|
|
|
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 20:13:39 +00:00
|
|
|
postInstall = ''
|
|
|
|
rm $out/bin/pygtk-codegen-2.0
|
|
|
|
ln -s ${pygobject}/bin/pygobject-codegen-2.0 $out/bin/pygtk-codegen-2.0
|
2013-01-11 16:45:26 +00:00
|
|
|
ln -s ${pygobject}/lib/${python.libPrefix}/site-packages/${pygobject.name}.pth \
|
|
|
|
$out/lib/${python.libPrefix}/site-packages/${name}.pth
|
2010-05-18 20:13:39 +00:00
|
|
|
'';
|
2005-04-22 18:26:04 +00:00
|
|
|
}
|