2021-12-06 16:07:01 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, fetchpatch
|
|
|
|
, pytestCheckHook
|
|
|
|
, brotli
|
|
|
|
, cairosvg
|
|
|
|
, fonttools
|
|
|
|
, pydyf
|
|
|
|
, pyphen
|
|
|
|
, cffi
|
|
|
|
, cssselect
|
|
|
|
, lxml
|
|
|
|
, html5lib
|
|
|
|
, tinycss
|
|
|
|
, zopfli
|
|
|
|
, glib
|
|
|
|
, harfbuzz
|
|
|
|
, pango
|
|
|
|
, fontconfig
|
|
|
|
, lib
|
|
|
|
, stdenv
|
|
|
|
, ghostscript
|
|
|
|
, isPy3k
|
|
|
|
, substituteAll
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "weasyprint";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "53.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
disabled = !isPy3k;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit version;
|
|
|
|
pname = "weasyprint";
|
|
|
|
sha256 = "sha256-EMyxfVXHMJa98e3T7+WMuFWwfkwwfZutTryaPxP/RYA=";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "--isort --flake8 --cov --no-cov-on-fail" ""
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
disabledTests = [
|
|
|
|
# needs the Ahem font (fails on macOS)
|
|
|
|
"test_font_stretch"
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
ghostscript
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf";
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
brotli
|
|
|
|
cairosvg
|
|
|
|
cffi
|
|
|
|
cssselect
|
|
|
|
fonttools
|
|
|
|
html5lib
|
|
|
|
lxml
|
|
|
|
pydyf
|
|
|
|
pyphen
|
|
|
|
tinycss
|
|
|
|
zopfli
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./library-paths.patch;
|
|
|
|
fontconfig = "${fontconfig.lib}/lib/libfontconfig${stdenv.hostPlatform.extensions.sharedLibrary}";
|
|
|
|
pangoft2 = "${pango.out}/lib/libpangoft2-1.0${stdenv.hostPlatform.extensions.sharedLibrary}";
|
|
|
|
gobject = "${glib.out}/lib/libgobject-2.0${stdenv.hostPlatform.extensions.sharedLibrary}";
|
|
|
|
pango = "${pango.out}/lib/libpango-1.0${stdenv.hostPlatform.extensions.sharedLibrary}";
|
|
|
|
pangocairo = "${pango.out}/lib/libpangocairo-1.0${stdenv.hostPlatform.extensions.sharedLibrary}";
|
2021-12-06 16:07:01 +00:00
|
|
|
harfbuzz = "${harfbuzz.out}/lib/libharfbuzz${stdenv.hostPlatform.extensions.sharedLibrary}";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://weasyprint.org/";
|
|
|
|
description = "Converts web documents to PDF";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ elohmeier ];
|
|
|
|
};
|
|
|
|
}
|