about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pycairo/default.nix
blob: ca6f72847158f442ce2e4bef112e26da819aa619 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ lib, fetchFromGitHub, meson, ninja, buildPythonPackage, pytest, pkgconfig, cairo, xlibsWrapper, isPy33, isPy3k }:

buildPythonPackage rec {
  pname = "pycairo";
  version = "1.18.1";

  format = "other";

  disabled = isPy33;

  src = fetchFromGitHub {
    owner = "pygobject";
    repo = "pycairo";
    rev = "v${version}";
    sha256 = "0f4l7d1ibkk8xdspyv5zx8fah9z3x775bd91zirnp37vlgqds7xj";
  };

  nativeBuildInputs = [
    meson
    ninja
    pkgconfig
  ];

  buildInputs = [
    cairo
    xlibsWrapper
  ];

  checkInputs = [ pytest ];

  mesonFlags = [ "-Dpython=${if isPy3k then "python3" else "python"}" ];

  meta = with lib; {
    description = "Python 2/3 bindings for cairo";
    homepage = https://pycairo.readthedocs.io/;
    license = with licenses; [ lgpl2 mpl11 ];
    platforms = lib.platforms.linux ++ lib.platforms.darwin;
  };
}