Merge pull request #327641 from zimbatm/default-wkhtmktopdf-bin

wkhtmltopdf: unbreak package
This commit is contained in:
Jonas Chevalier
2024-07-16 21:53:49 +02:00
committed by GitHub
3 changed files with 20 additions and 71 deletions
@@ -5,8 +5,9 @@
, zlib
, openssl
, fetchurl
, dpkg
, gcc-unwrapped
, libjpeg8
, libjpeg
, libpng
, fontconfig
, stdenv
@@ -39,13 +40,13 @@ let
};
linuxAttrs = rec {
version = "0.12.6-3";
version = "0.12.6.1-3";
src = fetchurl {
url = "https://github.com/wkhtmltopdf/packaging/releases/download/${version}/wkhtmltox-${version}.archlinux-x86_64.pkg.tar.xz";
sha256 = "sha256-6Ewu8sPRbqvYWj27mBlQYpEN+mb+vKT46ljrdEUxckI=";
url = "https://github.com/wkhtmltopdf/packaging/releases/download/${version}/wkhtmltox_${version}.bookworm_amd64.deb";
hash = "sha256-mLoNFXtQ028jvQ3t9MCqKMewxQ/NzcVKpba7uoGjlB0=";
};
nativeBuildInputs = [ autoPatchelfHook ];
nativeBuildInputs = [ dpkg autoPatchelfHook ];
buildInputs = [
xorg.libXext
@@ -57,16 +58,24 @@ let
(lib.getLib fontconfig)
(lib.getLib gcc-unwrapped)
(lib.getLib libjpeg8)
(lib.getLib libjpeg)
(lib.getLib libpng)
];
unpackPhase = "tar -xf $src";
unpackPhase = ''
runHook preUnpack
mkdir pkg
dpkg-deb -x $src pkg
runHook postUnpack
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r usr/bin usr/include usr/lib usr/share $out/
cp -r pkg/usr/local $out
runHook postInstall
'';
};
@@ -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;
};
}
+2 -5
View File
@@ -14435,11 +14435,8 @@ 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;
};
wkhtmltopdf-bin = callPackage ../tools/graphics/wkhtmltopdf-bin { };
wkhtmltopdf = wkhtmltopdf-bin;
wml = callPackage ../development/web/wml { };