From 8446cd9c3202f7016d14af25ea4a3a6e58ce32b4 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 31 Mar 2018 17:02:32 +0200 Subject: [PATCH] pythonPackages.poppler-qt5: init at 0.24.2 related to #32883 --- .../python-modules/poppler-qt5/default.nix | 42 +++++++++++++++++++ .../poppler-qt5/poppler-include-dir.patch | 12 ++++++ pkgs/top-level/python-packages.nix | 5 +++ 3 files changed, 59 insertions(+) create mode 100644 pkgs/development/python-modules/poppler-qt5/default.nix create mode 100644 pkgs/development/python-modules/poppler-qt5/poppler-include-dir.patch diff --git a/pkgs/development/python-modules/poppler-qt5/default.nix b/pkgs/development/python-modules/poppler-qt5/default.nix new file mode 100644 index 000000000000..0ae689034a3a --- /dev/null +++ b/pkgs/development/python-modules/poppler-qt5/default.nix @@ -0,0 +1,42 @@ +{ buildPythonPackage, fetchPypi, stdenv, sip, qtbase, pyqt5, poppler, pkgconfig, fetchpatch +, python, substituteAll +}: + +buildPythonPackage rec { + pname = "python-poppler-qt5"; + version = "0.24.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "0l69llw1fzwz8y90q0qp9q5pifbrqjjbwii7di54dwghw5fc6w1r"; + }; + + patches = [ + (substituteAll { + src = ./poppler-include-dir.patch; + poppler_include_dir = "${poppler.dev}/include/poppler"; + }) + (fetchpatch { + url = "https://github.com/wbsoft/python-poppler-qt5/commit/faf4d1308f89560b0d849671226e3080dfc72e79.patch"; + sha256 = "18krhh6wzsnpxzlzv02nginb1vralla8ai24zqk10nc4mj6fkj86"; + }) + ]; + + setupPyBuildFlags = [ + "--pyqt-sip-dir ${pyqt5}/share/sip/PyQt5" + "--qt-include-dir ${qtbase.dev}/include" + ]; + + buildInputs = [ qtbase.dev poppler ]; + nativeBuildInputs = [ pkgconfig ]; + propagatedBuildInputs = [ sip pyqt5.dev ]; + + # no tests, just bindings for `poppler_qt5` + doCheck = false; + + meta = with stdenv.lib; { + homepage = https://github.com/wbsoft/python-poppler-qt5; + license = licenses.gpl2; + maintainers = with maintainers; [ ma27 ]; + }; +} diff --git a/pkgs/development/python-modules/poppler-qt5/poppler-include-dir.patch b/pkgs/development/python-modules/poppler-qt5/poppler-include-dir.patch new file mode 100644 index 000000000000..7106c1d6352c --- /dev/null +++ b/pkgs/development/python-modules/poppler-qt5/poppler-include-dir.patch @@ -0,0 +1,12 @@ +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 9d61c58b072a..1b9ddc902015 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5700,6 +5700,11 @@ in { }; }; + poppler-qt5 = callPackage ../development/python-modules/poppler-qt5 { + inherit (pkgs.qt5) qtbase; + inherit (pkgs.libsForQt5) poppler; + }; + poyo = buildPythonPackage rec { version = "0.4.0"; name = "poyo-${version}";