From a7a6173a3f77df4faa6cc9b7e082f37537f459c7 Mon Sep 17 00:00:00 2001 From: Florian Friesdorf Date: Fri, 11 Jan 2013 17:45:26 +0100 Subject: pygtk in pythonPackages, checks disabled, demo works, relates #223 Previously the checkPhase was not executed. It is now and a couple of issues with it are seded away. --- pkgs/development/python-modules/pygtk/default.nix | 43 ++++++++++++++--------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'pkgs/development/python-modules/pygtk') diff --git a/pkgs/development/python-modules/pygtk/default.nix b/pkgs/development/python-modules/pygtk/default.nix index 81147fff17dc..07d57591f1ac 100644 --- a/pkgs/development/python-modules/pygtk/default.nix +++ b/pkgs/development/python-modules/pygtk/default.nix @@ -1,7 +1,7 @@ -{ stdenv, fetchurl, makeWrapper, python, pkgconfig, glib, gtk, pygobject, pycairo -, libglade ? null }: +{ stdenv, fetchurl, python, pkgconfig, glib, gtk, pygobject, pycairo +, buildPythonPackage, libglade ? null }: -stdenv.mkDerivation rec { +buildPythonPackage rec { name = "pygtk-2.22.0"; src = fetchurl { @@ -10,26 +10,35 @@ stdenv.mkDerivation rec { }; buildInputs = - [ makeWrapper python pkgconfig glib gtk ] + [ pkgconfig glib gtk ] ++ stdenv.lib.optional (libglade != null) libglade; propagatedBuildInputs = [ pygobject pycairo ]; + 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: + # The check phase was not executed in the previous + # non-buildPythonPackage setup - not sure why not. + doCheck = false; + postInstall = '' rm $out/bin/pygtk-codegen-2.0 ln -s ${pygobject}/bin/pygobject-codegen-2.0 $out/bin/pygtk-codegen-2.0 - - # All python code is installed into a "gtk-2.0" sub-directory. That - # sub-directory may be useful on systems which share several library - # versions in the same prefix, i.e. /usr/local, but on Nix that directory - # is useless. Furthermore, its existence makes it very hard to guess a - # proper $PYTHONPATH that allows "import gtk" to succeed. - cd $(toPythonPath $out)/gtk-2.0 - for n in *; do - ln -s "gtk-2.0/$n" "../$n" - done - - wrapProgram $out/bin/pygtk-demo --prefix PYTHONPATH ":" \ - $(toPythonPath "${pygobject} ${pycairo} $out") + ln -s ${pygobject}/lib/${python.libPrefix}/site-packages/${pygobject.name}.pth \ + $out/lib/${python.libPrefix}/site-packages/${name}.pth ''; } -- cgit 1.4.1