2019-03-11 12:27:40 +00:00
|
|
|
{ buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
cairosvg,
|
|
|
|
pyphen,
|
|
|
|
cffi,
|
|
|
|
cssselect,
|
|
|
|
lxml,
|
|
|
|
html5lib,
|
|
|
|
tinycss,
|
|
|
|
pygobject2,
|
|
|
|
glib,
|
|
|
|
pango,
|
|
|
|
fontconfig,
|
2021-01-11 07:54:33 +00:00
|
|
|
lib, stdenv,
|
2019-03-11 12:27:40 +00:00
|
|
|
pytest,
|
|
|
|
pytestrunner,
|
|
|
|
pytest-isort,
|
|
|
|
pytest-flake8,
|
|
|
|
pytestcov,
|
|
|
|
isPy3k,
|
|
|
|
substituteAll
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "weasyprint";
|
2020-12-30 16:08:17 +00:00
|
|
|
version = "52";
|
2019-03-11 12:27:40 +00:00
|
|
|
disabled = !isPy3k;
|
|
|
|
|
2019-09-25 10:44:09 +01:00
|
|
|
# excluded test needs the Ahem font
|
2019-09-25 08:08:06 +01:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
2019-09-25 10:44:09 +01:00
|
|
|
pytest -k 'not test_font_stretch'
|
2019-09-25 08:08:06 +01:00
|
|
|
runHook postCheck
|
|
|
|
'';
|
2019-03-11 12:27:40 +00:00
|
|
|
|
|
|
|
# ignore failing flake8-test
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace '[tool:pytest]' '[tool:pytest]\nflake8-ignore = E501'
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [ pytest pytestrunner pytest-isort pytest-flake8 pytestcov ];
|
|
|
|
|
|
|
|
FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf";
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ cairosvg pyphen cffi cssselect lxml html5lib tinycss pygobject2 ];
|
|
|
|
|
|
|
|
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}";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit version;
|
|
|
|
pname = "WeasyPrint";
|
2020-12-30 16:08:17 +00:00
|
|
|
sha256 = "0rwf43111ws74m8b1alkkxzz57g0np3vmd8as74adwnxslfcg4gs";
|
2019-03-11 12:27:40 +00:00
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://weasyprint.org/";
|
2019-03-11 12:27:40 +00:00
|
|
|
description = "Converts web documents to PDF";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ elohmeier ];
|
|
|
|
};
|
|
|
|
}
|