From 569d5e544acb22499debe1b6d2481b4d831a8cc8 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Tue, 16 Jul 2024 14:24:24 +0200 Subject: [PATCH] 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. --- pkgs/tools/graphics/wkhtmltopdf/default.nix | 57 --------------------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 - 3 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 pkgs/tools/graphics/wkhtmltopdf/default.nix diff --git a/pkgs/tools/graphics/wkhtmltopdf/default.nix b/pkgs/tools/graphics/wkhtmltopdf/default.nix deleted file mode 100644 index 7f1e40a695e4..000000000000 --- a/pkgs/tools/graphics/wkhtmltopdf/default.nix +++ /dev/null @@ -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; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 6c770b905b48..55df99bd5981 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5fbca08484c9..473de7c58b40 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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; };