diff options
Diffstat (limited to 'pkgs/development/python-modules/weasyprint/default.nix')
-rw-r--r-- | pkgs/development/python-modules/weasyprint/default.nix | 63 |
1 files changed, 38 insertions, 25 deletions
diff --git a/pkgs/development/python-modules/weasyprint/default.nix b/pkgs/development/python-modules/weasyprint/default.nix index f43fd2d5462b6..e19ed16d48a7f 100644 --- a/pkgs/development/python-modules/weasyprint/default.nix +++ b/pkgs/development/python-modules/weasyprint/default.nix @@ -4,6 +4,7 @@ , pytestCheckHook , brotli , cairosvg +, flit-core , fonttools , pydyf , pyphen @@ -26,32 +27,33 @@ buildPythonPackage rec { pname = "weasyprint"; - version = "53.4"; + version = "54.0"; disabled = !isPy3k; + format = "pyproject"; + src = fetchPypi { inherit version; pname = "weasyprint"; - sha256 = "sha256-EMyxfVXHMJa98e3T7+WMuFWwfkwwfZutTryaPxP/RYA="; + sha256 = "0aeda9a045c7881289420cac917cc57115b1243e476187338e66d593dd000853"; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "--isort --flake8 --cov --no-cov-on-fail" "" - ''; - - disabledTests = [ - # needs the Ahem font (fails on macOS) - "test_font_stretch" + 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}"; + harfbuzz = "${harfbuzz.out}/lib/libharfbuzz${stdenv.hostPlatform.extensions.sharedLibrary}"; + }) ]; - checkInputs = [ - pytestCheckHook - ghostscript + nativeBuildInputs = [ + flit-core ]; - FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf"; - propagatedBuildInputs = [ brotli cairosvg @@ -60,24 +62,35 @@ buildPythonPackage rec { fonttools html5lib lxml + flit-core pydyf pyphen tinycss zopfli ]; - 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}"; - harfbuzz = "${harfbuzz.out}/lib/libharfbuzz${stdenv.hostPlatform.extensions.sharedLibrary}"; - }) + checkInputs = [ + pytestCheckHook + ghostscript ]; + disabledTests = [ + # needs the Ahem font (fails on macOS) + "test_font_stretch" + ]; + + FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf"; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace "--isort --flake8 --cov --no-cov-on-fail" "" + ''; + + preCheck = '' + # Fontconfig wants to create a cache. + export HOME=$TMPDIR + ''; + meta = with lib; { homepage = "https://weasyprint.org/"; description = "Converts web documents to PDF"; |