diff --git a/pkgs/development/python-modules/poppler-qt5/default.nix b/pkgs/development/python-modules/poppler-qt5/default.nix index 345f092a80fa..94d86f7b7133 100644 --- a/pkgs/development/python-modules/poppler-qt5/default.nix +++ b/pkgs/development/python-modules/poppler-qt5/default.nix @@ -1,44 +1,64 @@ -{ 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 <> 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; meta = with lib; { - homepage = "https://github.com/wbsoft/python-poppler-qt5"; - license = licenses.gpl2; - maintainers = with maintainers; [ ]; + homepage = "https://github.com/frescobaldi/python-poppler-qt5"; + license = licenses.lgpl21Plus; + maintainers = with maintainers; [ eduardosm ]; }; } diff --git a/pkgs/development/python-modules/poppler-qt5/poppler-include-dir.patch b/pkgs/development/python-modules/poppler-qt5/poppler-include-dir.patch deleted file mode 100644 index 7106c1d6352c..000000000000 --- a/pkgs/development/python-modules/poppler-qt5/poppler-include-dir.patch +++ /dev/null @@ -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')) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b0e7729140ad..330f93703e88 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5077,7 +5077,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; };