about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pymupdf/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pymupdf/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/pymupdf/default.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pymupdf/default.nix b/nixpkgs/pkgs/development/python-modules/pymupdf/default.nix
new file mode 100644
index 000000000000..501f829dc142
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pymupdf/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildPythonPackage, fetchPypi, mupdf, swig }:
+buildPythonPackage rec {
+  pname = "pymupdf";
+  version = "1.18.0";
+
+  src = fetchPypi {
+    pname = "PyMuPDF";
+    inherit version;
+    sha256 = "64ce58f92d9edd2631e447175fa13b4024ac3b6dce6e718e0b003c41de6f7952";
+  };
+
+  patchPhase = ''
+    substituteInPlace setup.py \
+        --replace '/usr/include/mupdf' ${mupdf.dev}/include/mupdf
+    '';
+  nativeBuildInputs = [ swig ];
+  buildInputs = [ mupdf ];
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Python bindings for MuPDF's rendering library.";
+    homepage = "https://github.com/pymupdf/PyMuPDF";
+    maintainers = with maintainers; [ teto ];
+    license =  licenses.agpl3;
+    platforms = platforms.linux;
+  };
+}