summary refs log tree commit diff
path: root/pkgs/development/python-modules/xhtml2pdf/default.nix
diff options
context:
space:
mode:
authorAdam Washington <adam.washington@stfc.ac.uk>2018-03-21 13:46:17 +0000
committerAdam Washington <adam.washington@stfc.ac.uk>2018-03-21 13:46:17 +0000
commit01c1385deca520ead374afcbc7591aed9e4e6ce8 (patch)
tree214f9f30ae616e3362c77da6d573eff7208e55d0 /pkgs/development/python-modules/xhtml2pdf/default.nix
parent609374523c7dbb6c4a6d6834ade1a8ff90b1c354 (diff)
downloadnixlib-01c1385deca520ead374afcbc7591aed9e4e6ce8.tar
nixlib-01c1385deca520ead374afcbc7591aed9e4e6ce8.tar.gz
nixlib-01c1385deca520ead374afcbc7591aed9e4e6ce8.tar.bz2
nixlib-01c1385deca520ead374afcbc7591aed9e4e6ce8.tar.lz
nixlib-01c1385deca520ead374afcbc7591aed9e4e6ce8.tar.xz
nixlib-01c1385deca520ead374afcbc7591aed9e4e6ce8.tar.zst
nixlib-01c1385deca520ead374afcbc7591aed9e4e6ce8.zip
Make xhtml2pdf its own package in python-packages
xhtml2pdf now uses the main package html5lib with just an override to
pull the correct version number.
Diffstat (limited to 'pkgs/development/python-modules/xhtml2pdf/default.nix')
-rw-r--r--pkgs/development/python-modules/xhtml2pdf/default.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/xhtml2pdf/default.nix b/pkgs/development/python-modules/xhtml2pdf/default.nix
new file mode 100644
index 000000000000..2d1112fe02e4
--- /dev/null
+++ b/pkgs/development/python-modules/xhtml2pdf/default.nix
@@ -0,0 +1,33 @@
+{lib, fetchPypi, buildPythonPackage, html5lib, httplib2, nose, pillow, pypdf2, reportlab}:
+
+let
+  #xhtml2pdf specifically requires version "1.0b10" of html5lib
+  html5 = html5lib.overrideAttrs( oldAttrs: rec{
+    version = "1.0b10";
+    src = oldAttrs.src.override {
+      inherit version;
+      sha256 = "1yd068a5c00wd0ajq0hqimv7fd82lhrw0w3s01vbhy9bbd6xapqd";
+    };
+  });
+in
+
+buildPythonPackage rec {
+  name = "${pname}-${version}";
+  pname = "xhtml2pdf";
+  version = "0.2.1";
+
+  buildInputs = [html5];
+  propagatedBuildInputs = [httplib2 nose pillow pypdf2 reportlab html5];
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1n9r8zdk9gc2x539fq60bhszmd421ipj8g78zmsn3njvma1az9k1";
+  };
+
+  meta = {
+    description = "A pdf converter for the ReportLab Toolkit";
+    homepage = https://github.com/xhtml2pdf/xhtml2pdf;
+    license = lib.licenses.asl2;
+    maintainers = with lib.maintainers; [ rprospero ];
+  };
+}