From 38eed40687b5b4ee4852d5e1b686e8bebfc90977 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 19 Jan 2025 21:19:09 +0100 Subject: [PATCH] python3Packages.weasyprint: 62.3 -> 63.1 --- .../python-modules/weasyprint/default.nix | 23 +++++++------ .../weasyprint/library-paths.patch | 34 +++++++++++-------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/pkgs/development/python-modules/weasyprint/default.nix b/pkgs/development/python-modules/weasyprint/default.nix index bc6c57e94083..871ccc7c48de 100644 --- a/pkgs/development/python-modules/weasyprint/default.nix +++ b/pkgs/development/python-modules/weasyprint/default.nix @@ -11,20 +11,21 @@ ghostscript, glib, harfbuzz, - html5lib, pango, pillow, pydyf, pyphen, + pytest-cov-stub, pytestCheckHook, pythonOlder, substituteAll, tinycss2, + tinyhtml5, }: buildPythonPackage rec { pname = "weasyprint"; - version = "62.3"; + version = "63.1"; format = "pyproject"; disabled = pythonOlder "3.9"; @@ -32,7 +33,7 @@ buildPythonPackage rec { src = fetchPypi { inherit version; pname = "weasyprint"; - hash = "sha256-jYaA1zL3+g/LxYdpKlpcsJXDUlYnBmkY1uIDy/Qrf80="; + hash = "sha256-y0JOY+jdPxQZW/5fIDUnZGqkCi8ArIGfnTm4MEzsAEQ="; }; patches = [ @@ -44,23 +45,27 @@ buildPythonPackage rec { 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}"; + harfbuzz_subset = "${harfbuzz.out}/lib/libharfbuzz-subset${stdenv.hostPlatform.extensions.sharedLibrary}"; }) ]; - nativeBuildInputs = [ flit-core ]; + build-system = [ flit-core ]; - propagatedBuildInputs = [ + pythonRelaxDeps = [ "tinycss2" ]; + + dependencies = [ cffi cssselect2 fonttools - html5lib pillow pydyf pyphen tinycss2 + tinyhtml5 ] ++ fonttools.optional-dependencies.woff; nativeCheckInputs = [ + pytest-cov-stub pytestCheckHook ghostscript ]; @@ -80,11 +85,6 @@ buildPythonPackage rec { # Set env variable explicitly for Darwin, but allow overriding when invoking directly makeWrapperArgs = [ "--set-default FONTCONFIG_FILE ${FONTCONFIG_FILE}" ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "--isort --flake8 --cov --no-cov-on-fail" "" - ''; - preCheck = '' # Fontconfig wants to create a cache. export HOME=$TMPDIR @@ -93,6 +93,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "weasyprint" ]; meta = with lib; { + changelog = "https://github.com/Kozea/WeasyPrint/releases/tag/v${version}"; description = "Converts web documents to PDF"; mainProgram = "weasyprint"; homepage = "https://weasyprint.org/"; diff --git a/pkgs/development/python-modules/weasyprint/library-paths.patch b/pkgs/development/python-modules/weasyprint/library-paths.patch index e54561a4018a..dd2bbfe784e0 100644 --- a/pkgs/development/python-modules/weasyprint/library-paths.patch +++ b/pkgs/development/python-modules/weasyprint/library-paths.patch @@ -1,32 +1,36 @@ diff --git a/weasyprint/text/ffi.py b/weasyprint/text/ffi.py -index 3aba3e75..dde0e260 100644 +index b5a9cf2..9380a79 100644 --- a/weasyprint/text/ffi.py +++ b/weasyprint/text/ffi.py -@@ -429,22 +429,11 @@ if hasattr(os, 'add_dll_directory'): # pragma: no cover +@@ -444,25 +444,12 @@ if hasattr(os, 'add_dll_directory') and not hasattr(sys, 'frozen'): # pragma: n with suppress((OSError, FileNotFoundError)): os.add_dll_directory(dll_directory) -gobject = _dlopen( -- ffi, 'gobject-2.0-0', 'gobject-2.0', 'libgobject-2.0-0', +- ffi, 'libgobject-2.0-0', 'gobject-2.0-0', 'gobject-2.0', - 'libgobject-2.0.so.0', 'libgobject-2.0.dylib', 'libgobject-2.0-0.dll') -pango = _dlopen( -- ffi, 'pango-1.0-0', 'pango-1.0', 'libpango-1.0-0', 'libpango-1.0.so.0', +- ffi, 'libpango-1.0-0', 'pango-1.0-0', 'pango-1.0', 'libpango-1.0.so.0', - 'libpango-1.0.dylib', 'libpango-1.0-0.dll') -harfbuzz = _dlopen( -- ffi, 'harfbuzz', 'harfbuzz-0.0', 'libharfbuzz-0', -- 'libharfbuzz.so.0', 'libharfbuzz.so.0', 'libharfbuzz.0.dylib', -- 'libharfbuzz-0.dll') +- ffi, 'libharfbuzz-0', 'harfbuzz', 'harfbuzz-0.0', +- 'libharfbuzz.so.0', 'libharfbuzz.0.dylib', 'libharfbuzz-0.dll') +-harfbuzz_subset = _dlopen( +- ffi, 'libharfbuzz-subset-0', 'harfbuzz-subset', 'harfbuzz-subset-0.0', +- 'libharfbuzz-subset.so.0', 'libharfbuzz-subset.0.dylib', 'libharfbuzz-subset-0.dll', +- allow_fail=True) -fontconfig = _dlopen( -- ffi, 'fontconfig-1', 'fontconfig', 'libfontconfig', 'libfontconfig.so.1', -- 'libfontconfig.1.dylib', 'libfontconfig-1.dll') +- ffi, 'libfontconfig-1', 'fontconfig-1', 'fontconfig', +- 'libfontconfig.so.1', 'libfontconfig.1.dylib', 'libfontconfig-1.dll') -pangoft2 = _dlopen( -- ffi, 'pangoft2-1.0-0', 'pangoft2-1.0', 'libpangoft2-1.0-0', +- ffi, 'libpangoft2-1.0-0', 'pangoft2-1.0-0', 'pangoft2-1.0', - 'libpangoft2-1.0.so.0', 'libpangoft2-1.0.dylib', 'libpangoft2-1.0-0.dll') -+gobject = _dlopen(ffi, '@gobject@') -+pango = _dlopen(ffi, '@pango@') -+harfbuzz = _dlopen(ffi, '@harfbuzz@') -+fontconfig = _dlopen(ffi, '@fontconfig@') -+pangoft2 = _dlopen(ffi, '@pangoft2@') ++gobject = _dlopen(ffi, "@gobject@") ++pango = _dlopen(ffi, "@pango@") ++harfbuzz = _dlopen(ffi, "@harfbuzz@") ++harfbuzz_subset = _dlopen(ffi, "@harfbuzz_subset@", allow_fail=True) ++fontconfig = _dlopen(ffi, "@fontconfig@") ++pangoft2 = _dlopen(ffi, "@pangoft2@") gobject.g_type_init()