1{ lib 2, stdenv 3, fetchurl 4, buildPythonPackage 5, pkg-config 6, glib 7, gobject-introspection 8, pycairo 9, cairo 10, ncurses 11, meson 12, ninja 13, isPy3k 14, gnome 15, python 16}: 17 18buildPythonPackage rec { 19 pname = "pygobject"; 20 version = "3.44.1"; 21 22 outputs = [ "out" "dev" ]; 23 24 disabled = !isPy3k; 25 26 format = "other"; 27 28 src = fetchurl { 29 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; 30 sha256 = "PGgF0TIb6QzDLmSCFaViQw4NPW7c2o9MXnqdr/ytVxA="; 31 }; 32 33 depsBuildBuild = [ 34 pkg-config 35 ]; 36 37 nativeBuildInputs = [ 38 pkg-config 39 meson 40 ninja 41 gobject-introspection 42 ]; 43 44 buildInputs = [ 45 # # .so files link to this 46 glib 47 ] ++ lib.optionals stdenv.isDarwin [ 48 ncurses 49 ]; 50 51 propagatedBuildInputs = [ 52 pycairo 53 cairo 54 ]; 55 56 mesonFlags = [ 57 # This is only used for figuring out what version of Python is in 58 # use, and related stuff like figuring out what the install prefix 59 # should be, but it does need to be able to execute Python code. 60 "-Dpython=${python.pythonOnBuildForHost.interpreter}" 61 ]; 62 63 passthru = { 64 updateScript = gnome.updateScript { 65 packageName = pname; 66 attrPath = "python3.pkgs.${pname}3"; 67 versionPolicy = "odd-unstable"; 68 }; 69 }; 70 71 meta = with lib; { 72 homepage = "https://pygobject.readthedocs.io/"; 73 description = "Python bindings for Glib"; 74 license = licenses.lgpl21Plus; 75 maintainers = with maintainers; [ jtojnar ]; 76 platforms = platforms.unix; 77 }; 78}