wkhtmltopdf: unbreak on darwin

Unbreak wkhtmltopdf on darwin by changing dylib paths.

Fixes issue #11861.
This commit is contained in:
Jiajie Chen 2022-07-08 17:00:10 +08:00
parent 1ba4ca5995
commit e7575622c0

View File

@ -1,8 +1,8 @@
{ mkDerivation, lib, fetchFromGitHub, qtwebkit, qtsvg, qtxmlpatterns
, fontconfig, freetype, libpng, zlib, libjpeg
{ stdenv, lib, fetchFromGitHub, qtwebkit, qtsvg, qtxmlpatterns
, fontconfig, freetype, libpng, zlib, libjpeg, wrapQtAppsHook
, openssl, libX11, libXext, libXrender }:
mkDerivation rec {
stdenv.mkDerivation rec {
version = "0.12.6";
pname = "wkhtmltopdf";
@ -13,6 +13,10 @@ mkDerivation rec {
sha256 = "0m2zy986kzcpg0g3bvvm815ap9n5ann5f6bdy7pfj6jv482bm5mg";
};
nativeBuildInputs = [
wrapQtAppsHook
];
buildInputs = [
fontconfig freetype libpng zlib libjpeg openssl
libX11 libXext libXrender
@ -25,6 +29,12 @@ mkDerivation rec {
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;
@ -42,6 +52,6 @@ mkDerivation rec {
'';
license = licenses.gpl3Plus;
maintainers = with maintainers; [ jb55 ];
platforms = with platforms; linux;
platforms = platforms.unix;
};
}