pythonPackages.poppler-qt5: 0.24.2 -> 21.1.0

Builds using sip 5
This commit is contained in:
Eduardo Sánchez Muñoz 2021-04-26 19:08:14 +02:00
parent f7dccd8e25
commit 9e9f6f02a3
3 changed files with 38 additions and 30 deletions

View File

@ -1,38 +1,58 @@
{ buildPythonPackage, fetchPypi, lib, sip, qtbase, pyqt5, poppler, pkg-config, fetchpatch
, substituteAll
{ stdenv
, lib
, buildPythonPackage
, isPy3k
, fetchPypi
, pythonPackages
, sip_5
, qtbase
, qmake
, pyqt5
, pyqt-builder
, poppler
, pkg-config
, fetchpatch
}:
buildPythonPackage rec {
pname = "python-poppler-qt5";
version = "0.24.2";
version = "21.1.0";
disabled = !isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "0l69llw1fzwz8y90q0qp9q5pifbrqjjbwii7di54dwghw5fc6w1r";
sha256 = "0b82gm4i75q5v19kfbq0h4y0b2vcwr2213zkhxh6l0h45kdndmxd";
};
patches = [
(substituteAll {
src = ./poppler-include-dir.patch;
poppler_include_dir = "${poppler.dev}/include/poppler";
})
# Fix for https://github.com/frescobaldi/python-poppler-qt5/issues/43 (from PR #45)
(fetchpatch {
url = "https://github.com/wbsoft/python-poppler-qt5/commit/faf4d1308f89560b0d849671226e3080dfc72e79.patch";
sha256 = "18krhh6wzsnpxzlzv02nginb1vralla8ai24zqk10nc4mj6fkj86";
url = "https://github.com/frescobaldi/python-poppler-qt5/commit/40e71ad88173d02648bceb2438bc0567e60dacd5.patch";
sha256 = "0c93d0k7b1n2s2njl8g92x6vw3z96da1fczah9qx07x08iw8dzi5";
})
];
setupPyBuildFlags = [
"--pyqt-sip-dir ${pyqt5}/share/sip/PyQt5"
"--qt-include-dir ${qtbase.dev}/include"
];
buildInputs = [ qtbase.dev poppler pyqt-builder ];
nativeBuildInputs = [ pkg-config qmake sip_5 ];
propagatedBuildInputs = [ pyqt5.dev ];
buildInputs = [ qtbase.dev poppler ];
nativeBuildInputs = [ pkg-config ];
propagatedBuildInputs = [ sip pyqt5.dev ];
format = "pyproject";
dontConfigure = true;
postPatch = ''
cat <<EOF >> pyproject.toml
sip-include-dirs = ["${pyqt5}/share/sip/PyQt5"]
[tool.sip.bindings.Poppler-Qt5]
include-dirs = ["${poppler.dev}/include/poppler"]
tags = ["${sip_5.platform_tag}"]
EOF
'';
# no tests, just bindings for `poppler_qt5`
doCheck = false;
pythonImportsCheck = [ "popplerqt5" ];
dontWrapQtApps = true;

View File

@ -1,12 +0,0 @@
diff --git a/setup.py b/setup.py
index 59a75b0..0a73268 100644
--- a/setup.py
+++ b/setup.py
@@ -169,6 +169,7 @@ class build_ext(build_ext_base):
'Please specify via --pyqt-sip-flags=')
self.include_dirs += (self.qt_include_dir,
+ '@poppler_include_dir@',
os.path.join(self.qt_include_dir, 'QtCore'),
os.path.join(self.qt_include_dir, 'QtGui'),
os.path.join(self.qt_include_dir, 'QtXml'))

View File

@ -5067,7 +5067,7 @@ in {
poolsense = callPackage ../development/python-modules/poolsense { };
poppler-qt5 = callPackage ../development/python-modules/poppler-qt5 {
inherit (pkgs.qt5) qtbase;
inherit (pkgs.qt5) qtbase qmake;
inherit (pkgs.libsForQt5) poppler;
};