wkhtmltopdf: use the -bin version

wkhtmltopdf is a bit cursed.

1. It needs a specially patched version of QT to work.
2. It doesn't build currently.
3. Upstream repos are archived.
4. It depends on insecure dependencies.

In the mid term this dependency should be removed, but it's still a hard
dependency for:

* bookstack
* monica
* odoo (ref https://github.com/odoo/odoo/issues/86501)
* snipe-it

Instead of spending time to fix the build issues, use the -bin version
in the meantime.
This commit is contained in:
zimbatm 2024-07-16 14:24:24 +02:00
parent 9023e58169
commit 569d5e544a
3 changed files with 1 additions and 59 deletions

View File

@ -1,57 +0,0 @@
{ stdenv, lib, fetchFromGitHub, qtwebkit, qtsvg, qtxmlpatterns
, fontconfig, freetype, libpng, zlib, libjpeg, wrapQtAppsHook
, openssl, libX11, libXext, libXrender }:
stdenv.mkDerivation rec {
version = "0.12.6";
pname = "wkhtmltopdf";
src = fetchFromGitHub {
owner = "wkhtmltopdf";
repo = "wkhtmltopdf";
rev = version;
sha256 = "0m2zy986kzcpg0g3bvvm815ap9n5ann5f6bdy7pfj6jv482bm5mg";
};
nativeBuildInputs = [
wrapQtAppsHook
];
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
'';
# 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
'';
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 = platforms.unix;
};
}

View File

@ -1471,6 +1471,7 @@ mapAliases ({
waypoint = throw "waypoint has been removed from nixpkgs as the upstream project was archived"; # Added 2024-04-24
wcm = throw "'wcm' has been renamed to/replaced by 'wayfirePlugins.wcm'"; # Add 2023-07-29
webkitgtk_5_0 = throw "'webkitgtk_5_0' has been superseded by 'webkitgtk_6_0'"; # Added 2023-02-25
wkhtmltopdf = wkhtmltopdf-bin;
wineWayland = wine-wayland;
win-qemu = throw "'win-qemu' has been replaced by 'virtio-win'"; # Added 2023-08-16
win-virtio = virtio-win; # Added 2023-10-17

View File

@ -14432,8 +14432,6 @@ with pkgs;
wireguard-go = callPackage ../tools/networking/wireguard-go { };
wkhtmltopdf = libsForQt5.callPackage ../tools/graphics/wkhtmltopdf { };
wkhtmltopdf-bin = callPackage ../tools/graphics/wkhtmltopdf-bin {
openssl = openssl_1_1;
};