Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 19.09 60 lines 2.0 kB view raw
1{ stdenv, fetchurl, python, pkgconfig, gtk2, pygobject2, pycairo 2, buildPythonPackage, libglade ? null, isPy3k }: 3 4buildPythonPackage rec { 5 pname = "pygtk"; 6 version = "2.24.0"; 7 8 disabled = isPy3k; 9 10 src = fetchurl { 11 url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.bz2"; 12 sha256 = "04k942gn8vl95kwf0qskkv6npclfm31d78ljkrkgyqxxcni1w76d"; 13 }; 14 15 nativeBuildInputs = [ pkgconfig ]; 16 buildInputs = stdenv.lib.optional (libglade != null) libglade; 17 18 propagatedBuildInputs = [ gtk2 pygobject2 pycairo ]; 19 20 configurePhase = "configurePhase"; 21 22 buildPhase = "buildPhase"; 23 24 NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-ObjC"; 25 26 installPhase = "installPhase"; 27 28 checkPhase = stdenv.lib.optionalString (libglade == null) 29 '' 30 sed -i -e "s/glade = importModule('gtk.glade', buildDir)//" \ 31 tests/common.py 32 sed -i -e "s/, glade$//" \ 33 -e "s/.*testGlade.*//" \ 34 -e "s/.*(glade.*//" \ 35 tests/test_api.py 36 '' + '' 37 sed -i -e "s/sys.path.insert(0, os.path.join(buildDir, 'gtk'))//" \ 38 -e "s/sys.path.insert(0, buildDir)//" \ 39 tests/common.py 40 make check 41 ''; 42 # XXX: TypeError: Unsupported type: <class 'gtk._gtk.WindowType'> 43 # The check phase was not executed in the previous 44 # non-buildPythonPackage setup - not sure why not. 45 doCheck = false; 46 47 postInstall = '' 48 rm $out/bin/pygtk-codegen-2.0 49 ln -s ${pygobject2}/bin/pygobject-codegen-2.0 $out/bin/pygtk-codegen-2.0 50 ln -s ${pygobject2}/lib/${python.libPrefix}/site-packages/pygobject-${pygobject2.version}.pth \ 51 $out/lib/${python.libPrefix}/site-packages/${pname}-${version}.pth 52 ''; 53 54 meta = with stdenv.lib; { 55 description = "GTK 2 Python bindings"; 56 homepage = "https://gitlab.gnome.org/Archive/pygtk"; 57 platforms = platforms.all; 58 license = with licenses; [ lgpl21Plus ]; 59 }; 60}