2021-05-03 20:48:10 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, isPy3k
|
|
|
|
, fetchPypi
|
|
|
|
, pythonPackages
|
|
|
|
, sip_5
|
|
|
|
, qtbase
|
|
|
|
, qmake
|
|
|
|
, pyqt5
|
|
|
|
, pyqt-builder
|
|
|
|
, poppler
|
|
|
|
, pkg-config
|
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-poppler-qt5";
|
2021-05-03 20:48:10 +00:00
|
|
|
version = "21.1.0";
|
|
|
|
|
|
|
|
disabled = !isPy3k;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-05-03 20:48:10 +00:00
|
|
|
sha256 = "0b82gm4i75q5v19kfbq0h4y0b2vcwr2213zkhxh6l0h45kdndmxd";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2021-05-03 20:48:10 +00:00
|
|
|
# Fix for https://github.com/frescobaldi/python-poppler-qt5/issues/43 (from PR #45)
|
2020-04-24 23:36:52 +00:00
|
|
|
(fetchpatch {
|
2021-05-03 20:48:10 +00:00
|
|
|
url = "https://github.com/frescobaldi/python-poppler-qt5/commit/40e71ad88173d02648bceb2438bc0567e60dacd5.patch";
|
|
|
|
sha256 = "0c93d0k7b1n2s2njl8g92x6vw3z96da1fczah9qx07x08iw8dzi5";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
buildInputs = [ qtbase.dev poppler pyqt-builder ];
|
|
|
|
nativeBuildInputs = [ pkg-config qmake sip_5 ];
|
|
|
|
propagatedBuildInputs = [ pyqt5.dev ];
|
|
|
|
|
|
|
|
format = "pyproject";
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
cat <<EOF >> pyproject.toml
|
|
|
|
sip-include-dirs = ["${pyqt5}/share/sip/PyQt5"]
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
[tool.sip.bindings.Poppler-Qt5]
|
|
|
|
include-dirs = ["${poppler.dev}/include/poppler"]
|
|
|
|
tags = ["${sip_5.platform_tag}"]
|
|
|
|
EOF
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# no tests, just bindings for `poppler_qt5`
|
|
|
|
doCheck = false;
|
2021-05-03 20:48:10 +00:00
|
|
|
pythonImportsCheck = [ "popplerqt5" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-05-03 20:48:10 +00:00
|
|
|
homepage = "https://github.com/frescobaldi/python-poppler-qt5";
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [ eduardosm ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|