1{ 2 lib, 3 buildPythonPackage, 4 fetchPypi, 5 pythonOlder, 6 pytestCheckHook, 7 meson-python, 8 ninja, 9 poppler, 10 pkg-config, 11 pybind11, 12}: 13 14buildPythonPackage rec { 15 pname = "python-poppler"; 16 version = "0.4.1"; 17 pyproject = true; 18 19 disabled = pythonOlder "3.6"; 20 21 src = fetchPypi { 22 inherit version; 23 pname = "python_poppler"; 24 hash = "sha256-5spcI+wCNQvyzvhaa/nxsmF5ZDbbR4F2+dJPsU7uzGo="; 25 }; 26 27 patches = [ 28 # Prevent Meson from downloading pybind11, use system version instead 29 ./use_system_pybind11.patch 30 # Fix build with Poppler 25.01+ 31 # See: https://github.com/cbrunet/python-poppler/pull/92 32 ./poppler-25.patch 33 ]; 34 35 build-system = [ meson-python ]; 36 37 buildInputs = [ pybind11 ]; 38 39 nativeBuildInputs = [ 40 ninja 41 pkg-config 42 ]; 43 44 propagatedBuildInputs = [ poppler ]; 45 46 nativeCheckInputs = [ pytestCheckHook ]; 47 48 pythonImportsCheck = [ "poppler" ]; 49 50 meta = { 51 description = "Python binding to poppler-cpp"; 52 homepage = "https://github.com/cbrunet/python-poppler"; 53 changelog = "https://cbrunet.net/python-poppler/changelog.html"; 54 # Contradictory license definition 55 # https://github.com/cbrunet/python-poppler/issues/90 56 license = lib.licenses.gpl2Plus; 57 maintainers = [ lib.maintainers.onny ]; 58 }; 59}