2022-07-08 09:00:10 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, qtwebkit, qtsvg, qtxmlpatterns
|
|
|
|
, fontconfig, freetype, libpng, zlib, libjpeg, wrapQtAppsHook
|
2018-09-08 20:32:24 +00:00
|
|
|
, openssl, libX11, libXext, libXrender }:
|
2012-01-17 11:04:14 +00:00
|
|
|
|
2022-07-08 09:00:10 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-06-15 06:01:15 +00:00
|
|
|
version = "0.12.6";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "wkhtmltopdf";
|
2012-01-17 11:04:14 +00:00
|
|
|
|
2016-04-07 05:12:08 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wkhtmltopdf";
|
|
|
|
repo = "wkhtmltopdf";
|
2017-05-11 05:16:01 +00:00
|
|
|
rev = version;
|
2020-06-15 06:01:15 +00:00
|
|
|
sha256 = "0m2zy986kzcpg0g3bvvm815ap9n5ann5f6bdy7pfj6jv482bm5mg";
|
2012-01-17 11:04:14 +00:00
|
|
|
};
|
|
|
|
|
2022-07-08 09:00:10 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
2017-05-11 05:16:01 +00:00
|
|
|
buildInputs = [
|
2018-09-08 20:32:24 +00:00
|
|
|
fontconfig freetype libpng zlib libjpeg openssl
|
2017-05-11 05:16:01 +00:00
|
|
|
libX11 libXext libXrender
|
2019-08-18 20:02:04 +00:00
|
|
|
qtwebkit qtsvg qtxmlpatterns
|
2017-05-11 05:16:01 +00:00
|
|
|
];
|
2012-01-17 11:04:14 +00:00
|
|
|
|
2017-05-11 05:16:01 +00:00
|
|
|
prePatch = ''
|
|
|
|
for f in src/image/image.pro src/pdf/pdf.pro ; do
|
|
|
|
substituteInPlace $f --replace '$(INSTALL_ROOT)' ""
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2022-07-08 09:00:10 +00:00
|
|
|
# rewrite library path
|
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
|
|
|
install_name_tool -change libwkhtmltox.0.dylib $out/lib/libwkhtmltox.0.dylib $out/bin/wkhtmltopdf
|
|
|
|
install_name_tool -change libwkhtmltox.0.dylib $out/lib/libwkhtmltox.0.dylib $out/bin/wkhtmltoimage
|
|
|
|
'';
|
|
|
|
|
2017-05-11 05:16:01 +00:00
|
|
|
configurePhase = "qmake wkhtmltopdf.pro INSTALLBASE=$out";
|
2014-08-28 21:58:08 +00:00
|
|
|
|
2012-01-17 11:04:14 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2019-08-18 20:02:04 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://wkhtmltopdf.org/";
|
2012-01-17 11:04:14 +00:00
|
|
|
description = "Tools for rendering web pages to PDF or images";
|
2014-08-28 21:58:08 +00:00
|
|
|
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.
|
|
|
|
'';
|
2015-10-28 00:20:26 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ jb55 ];
|
2022-07-08 09:00:10 +00:00
|
|
|
platforms = platforms.unix;
|
2012-01-17 11:04:14 +00:00
|
|
|
};
|
|
|
|
}
|