about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/graphics/wkhtmltopdf/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/graphics/wkhtmltopdf/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/graphics/wkhtmltopdf/default.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/graphics/wkhtmltopdf/default.nix b/nixpkgs/pkgs/tools/graphics/wkhtmltopdf/default.nix
new file mode 100644
index 000000000000..093ab9ad5c43
--- /dev/null
+++ b/nixpkgs/pkgs/tools/graphics/wkhtmltopdf/default.nix
@@ -0,0 +1,47 @@
+{ mkDerivation, lib, fetchFromGitHub, qtwebkit, qtsvg, qtxmlpatterns
+, fontconfig, freetype, libpng, zlib, libjpeg
+, openssl, libX11, libXext, libXrender }:
+
+mkDerivation rec {
+  version = "0.12.6";
+  pname = "wkhtmltopdf";
+
+  src = fetchFromGitHub {
+    owner  = "wkhtmltopdf";
+    repo   = "wkhtmltopdf";
+    rev    = version;
+    sha256 = "0m2zy986kzcpg0g3bvvm815ap9n5ann5f6bdy7pfj6jv482bm5mg";
+  };
+
+  buildInputs = [
+    fontconfig freetype libpng zlib libjpeg openssl
+    libX11 libXext libXrender
+    qtwebkit qtsvg qtxmlpatterns
+  ];
+
+  prePatch = ''
+    for f in src/image/image.pro src/pdf/pdf.pro ; do
+      substituteInPlace $f --replace '$(INSTALL_ROOT)' ""
+    done
+  '';
+
+  configurePhase = "qmake wkhtmltopdf.pro INSTALLBASE=$out";
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://wkhtmltopdf.org/";
+    description = "Tools for rendering web pages to PDF or images";
+    longDescription = ''
+      wkhtmltopdf and wkhtmltoimage are open source (LGPL) command line tools
+      to render HTML into PDF and various image formats using the QT Webkit
+      rendering engine. These run entirely "headless" and do not require a
+      display or display service.
+
+      There is also a C library, if you're into that kind of thing.
+    '';
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ jb55 ];
+    platforms = with platforms; linux;
+  };
+}