From 097d5c78f5886ab6323892f516503b6b036eb777 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 12 Jun 2026 10:34:10 +0300 Subject: [PATCH 1/4] freetype: simplify src's fetchurl --- pkgs/by-name/fr/freetype/package.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/fr/freetype/package.nix b/pkgs/by-name/fr/freetype/package.nix index 1eb213ab71f1..1bcb6b83642c 100644 --- a/pkgs/by-name/fr/freetype/package.nix +++ b/pkgs/by-name/fr/freetype/package.nix @@ -41,14 +41,10 @@ stdenv.mkDerivation (finalAttrs: { pname = "freetype"; version = "2.14.3"; - src = - let - inherit (finalAttrs) pname version; - in - fetchurl { - url = "mirror://savannah/freetype/freetype-${version}.tar.xz"; - sha256 = "sha256-NrxPHMQTM1No7mVsQq/KZcWjmH6HaMwozxG6d154Wl8="; - }; + src = fetchurl { + url = "mirror://savannah/freetype/freetype-${finalAttrs.version}.tar.xz"; + hash = "sha256-NrxPHMQTM1No7mVsQq/KZcWjmH6HaMwozxG6d154Wl8="; + }; propagatedBuildInputs = [ zlib From c6bebdf2efefdd9ce086de61d352fc674f3933a3 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 12 Jun 2026 10:03:51 +0300 Subject: [PATCH 2/4] python3Packages.matplotlib: add doronbehar to maintainers --- pkgs/development/python-modules/matplotlib/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index 2311afef7a39..969219e1b5e7 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -206,6 +206,7 @@ buildPythonPackage rec { ]; maintainers = with lib.maintainers; [ veprbl + doronbehar ]; }; } From cb9baef75053d218e66640fd140e9b40644e5b93 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 12 Jun 2026 10:22:20 +0300 Subject: [PATCH 3/4] python3Packages.matplotlib: use finalAttrs pattern --- pkgs/development/python-modules/matplotlib/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index 969219e1b5e7..3d49760d3cd8 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -75,13 +75,13 @@ let interactive = enableTk || enableGtk3 || enableQt; in -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { version = "3.10.9"; pname = "matplotlib"; pyproject = true; src = fetchPypi { - inherit pname version; + inherit (finalAttrs) pname version; hash = "sha256-/WZQjoxod9mOWGZUtgigRW241+ilRuseJgDv2VcwI1g="; }; @@ -199,7 +199,7 @@ buildPythonPackage rec { meta = { description = "Python plotting library, making publication quality plots"; homepage = "https://matplotlib.org/"; - changelog = "https://github.com/matplotlib/matplotlib/releases/tag/v${version}"; + changelog = "https://github.com/matplotlib/matplotlib/releases/tag/v${finalAttrs.version}"; license = with lib.licenses; [ psfl bsd0 @@ -209,4 +209,4 @@ buildPythonPackage rec { doronbehar ]; }; -} +}) From c4a9aae5c70072807d7a9baee32dbbcab4ebea4b Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 12 Jun 2026 10:03:26 +0300 Subject: [PATCH 4/4] python3Packages.matplotlib: 3.10.9 -> 3.11.0 Changelog: https://github.com/matplotlib/matplotlib/releases/tag/v3.11.0 Disable withOutdatedFreetype passthru test, comment explains why. --- .../python-modules/matplotlib/default.nix | 33 ++++++------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index 3d49760d3cd8..eed032805c76 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -19,13 +19,8 @@ # native libraries ffmpeg-headless, freetype, - # By default, almost all tests fail due to the fact we use our version of - # freetype. We still use this argument to define the overridden - # derivation `matplotlib.passthru.tests.withoutOutdatedFreetype` - which - # builds matplotlib with the freetype version they default to, with which all - # tests should pass. - doCheck ? false, qhull, + libraqm, # propagates contourpy, @@ -76,13 +71,13 @@ let in buildPythonPackage (finalAttrs: { - version = "3.10.9"; + version = "3.11.0"; pname = "matplotlib"; pyproject = true; src = fetchPypi { inherit (finalAttrs) pname version; - hash = "sha256-/WZQjoxod9mOWGZUtgigRW241+ilRuseJgDv2VcwI1g="; + hash = "sha256-aMDHvgGzDcyjY4k09/WR33NAEjXL2/DRqxxx59t/i1c="; }; env.XDG_RUNTIME_DIR = "/tmp"; @@ -99,10 +94,6 @@ buildPythonPackage (finalAttrs: { --replace-fail "/usr/bin/env python3" "/usr/bin/env pypy3" '' + '' - substituteInPlace pyproject.toml \ - --replace-fail "meson-python>=0.13.1,<0.17.0" meson-python \ - --replace-fail "setuptools_scm>=7,<10" setuptools_scm - patchShebangs tools '' + lib.optionalString (stdenv.hostPlatform.isLinux && interactive) '' @@ -118,6 +109,7 @@ buildPythonPackage (finalAttrs: { ffmpeg-headless freetype qhull + libraqm ] ++ lib.optionals enableGtk3 [ cairo @@ -159,6 +151,7 @@ buildPythonPackage (finalAttrs: { mesonFlags = lib.mapAttrsToList lib.mesonBool { system-freetype = true; system-qhull = true; + system-libraqm = true; # Otherwise GNU's `ar` binary fails to put symbols from libagg into the # matplotlib shared objects. See: # -https://github.com/matplotlib/matplotlib/issues/28260#issuecomment-2146243663 @@ -168,20 +161,14 @@ buildPythonPackage (finalAttrs: { passthru.tests = { inherit sage; - withOutdatedFreetype = matplotlib.override { - doCheck = true; - freetype = freetype.overrideAttrs (_: { - src = fetchurl { - url = "mirror://savannah/freetype/freetype-old/freetype-2.6.1.tar.gz"; - hash = "sha256-Cjx9+9ptoej84pIy6OltmHq6u79x68jHVlnkEyw2cBQ="; - }; - patches = [ ]; - }); - }; }; pythonImportsCheck = [ "matplotlib" ]; - inherit doCheck; + # Running the tests requires a specific freetype version, so pixel-to-pixel + # comparisons will pass. Since matplotlib depends directly & indirectly on + # freetype, this would be too expensive to even test this (correctly) in + # `passthru.tests`. + doCheck = false; nativeCheckInputs = [ pytestCheckHook ]; preCheck = '' # https://matplotlib.org/devdocs/devel/testing.html#obtain-the-reference-images