summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/python-poppler/default.nix
blob: f982bc6c818a87c5ee11127d2313f1fdcca82088 (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
  lib,
  buildPythonPackage,
  fetchPypi,
  pytestCheckHook,
  meson-python,
  ninja,
  poppler,
  pkg-config,
  pybind11,
}:

buildPythonPackage rec {
  pname = "python-poppler";
  version = "0.4.1";
  pyproject = true;

  src = fetchPypi {
    inherit version;
    pname = "python_poppler";
    hash = "sha256-5spcI+wCNQvyzvhaa/nxsmF5ZDbbR4F2+dJPsU7uzGo=";
  };

  patches = [
    # Prevent Meson from downloading pybind11, use system version instead
    ./use_system_pybind11.patch
    # Fix build with Poppler 25.01+
    # See: https://github.com/cbrunet/python-poppler/pull/92
    ./poppler-25.patch
  ];

  build-system = [ meson-python ];

  buildInputs = [ pybind11 ];

  nativeBuildInputs = [
    ninja
    pkg-config
  ];

  propagatedBuildInputs = [ poppler ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "poppler" ];

  meta = {
    description = "Python binding to poppler-cpp";
    homepage = "https://github.com/cbrunet/python-poppler";
    changelog = "https://cbrunet.net/python-poppler/changelog.html";
    # Contradictory license definition
    # https://github.com/cbrunet/python-poppler/issues/90
    license = lib.licenses.gpl2Plus;
    maintainers = [ lib.maintainers.onny ];
  };
}