From 5c3eafa97fca3923da5ca1f750fb139e6573f4b5 Mon Sep 17 00:00:00 2001 From: Stefan Visser Date: Wed, 20 May 2026 10:44:30 +0200 Subject: [PATCH] python3Packages.weasyprint: 68.0 -> 68.1-unstable-2026-05-18 Changelog: https://github.com/Kozea/WeasyPrint/compare/v68.0...2cb9b3d2378c67e2bfde646344ca4c2cb7c0f25f Pin to upstream main to pick up Ghostscript 10.07-compatible rasterization test expectations. --- .../python-modules/weasyprint/default.nix | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/weasyprint/default.nix b/pkgs/development/python-modules/weasyprint/default.nix index 40c26569dc1d..db4e7b8d5b46 100644 --- a/pkgs/development/python-modules/weasyprint/default.nix +++ b/pkgs/development/python-modules/weasyprint/default.nix @@ -7,7 +7,9 @@ fontconfig, glib, harfbuzz, + makeFontsConf, pango, + twemoji-color-font, # build-system flit-core, @@ -32,7 +34,7 @@ buildPythonPackage (finalAttrs: { pname = "weasyprint"; - version = "68.0"; + version = "68.1-unstable-2026-05-18"; pyproject = true; __darwinAllowLocalNetworking = true; @@ -40,8 +42,10 @@ buildPythonPackage (finalAttrs: { src = fetchFromGitHub { owner = "Kozea"; repo = "WeasyPrint"; - tag = "v${finalAttrs.version}"; - hash = "sha256-kAJgSQz1RKrPwzO7I5xHXyXcXYJtvca9izjrAgTy3ek="; + # Includes upstream's Ghostscript 10.07-compatible rasterization tests. + # Drop the pin when the next WeasyPrint release is packaged. + rev = "2cb9b3d2378c67e2bfde646344ca4c2cb7c0f25f"; + hash = "sha256-zQ8gvYy72ROMwprT5dWA3N1vC7y+6ZKNwKESwtPS21w="; }; patches = [ @@ -99,19 +103,28 @@ buildPythonPackage (finalAttrs: { "test_woff_simple" # AssertionError "test_2d_transform" - # Reported upstream: https://github.com/Kozea/WeasyPrint/issues/2666 - "test_text_stroke" ]; env.FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf"; + # Test include some emoji characters that require a custom fontconfig configuration to be found. + preCheck = '' + export FONTCONFIG_FILE=${makeFontsConf { fontDirectories = [ twemoji-color-font ]; }} + ''; + # Set env variable explicitly for Darwin, but allow overriding when invoking directly makeWrapperArgs = [ "--set-default FONTCONFIG_FILE ${finalAttrs.env.FONTCONFIG_FILE}" ]; + # Upstream still reports the last release version from weasyprint.__version__. + # Remove when the next release is packaged. + preVersionCheck = '' + version=68.1 + ''; + pythonImportsCheck = [ "weasyprint" ]; meta = { - changelog = "https://github.com/Kozea/WeasyPrint/releases/tag/${finalAttrs.src.tag}"; + changelog = "https://github.com/Kozea/WeasyPrint/commits/${finalAttrs.src.rev}"; description = "Converts web documents to PDF"; homepage = "https://weasyprint.org/"; license = lib.licenses.bsd3;