From a04b6ba924b3160457caf24021c58cf011795844 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 7 Jan 2024 09:36:48 +0200 Subject: [PATCH 1/4] python310Packages.matplotlib: cleanup duplicate MPLSETUPCFG content --- pkgs/development/python-modules/matplotlib/default.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index 1100d1bdbc99..6070b32575c0 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -109,13 +109,6 @@ buildPythonPackage rec { substituteInPlace src/_c_internal_utils.c \ --replace libX11.so.6 ${libX11}/lib/libX11.so.6 \ --replace libwayland-client.so.0 ${wayland}/lib/libwayland-client.so.0 - '' + - # bring our own system libraries - # https://github.com/matplotlib/matplotlib/blob/main/doc/devel/dependencies.rst#c-libraries - '' - echo "[libs] - system_freetype=true - system_qhull=true" > mplsetup.cfg ''; nativeBuildInputs = [ From 0d9a06c96eec03d1ec02be02409636ade1f0fa14 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 7 Jan 2024 09:37:51 +0200 Subject: [PATCH 2/4] python310Packages.matplotlib: remove oldest-supported-numpy --- pkgs/development/python-modules/matplotlib/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index 6070b32575c0..ac47a507ba29 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -9,7 +9,6 @@ # https://github.com/matplotlib/matplotlib/blob/main/doc/devel/dependencies.rst # build-system , certifi -, oldest-supported-numpy , pkg-config , pybind11 , setuptools @@ -114,7 +113,6 @@ buildPythonPackage rec { nativeBuildInputs = [ certifi numpy - oldest-supported-numpy # TODO remove after updating to 3.8.0 pkg-config pybind11 setuptools From e68cf14d27fbebf87656762c02ab980b19d7796b Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 7 Jan 2024 09:38:05 +0200 Subject: [PATCH 3/4] python310Packages.matplotlib: enable_lto explicitly --- pkgs/development/python-modules/matplotlib/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index ac47a507ba29..bad385ee3ad9 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -175,9 +175,8 @@ buildPythonPackage rec { libs = { system_freetype = true; system_qhull = true; - } // lib.optionalAttrs stdenv.isDarwin { # LTO not working in darwin stdenv, see #19312 - enable_lto = false; + enable_lto = !stdenv.isDarwin; }; }; From eba8931d4c2cbe5b87c457a9e41eae8940ba62ee Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 7 Jan 2024 10:28:52 +0200 Subject: [PATCH 4/4] python310Packages.matplotlib: comments fixes The link to the build docs is outdated, and it doesn't have an updated direct alternative. While I tried to enable at least some of the tests, I encountered https://github.com/NixOS/nixpkgs/issues/255262 which is now linked in a comment. --- pkgs/development/python-modules/matplotlib/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index bad385ee3ad9..8fb5c7c292cf 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -6,7 +6,6 @@ , isPyPy , pythonOlder -# https://github.com/matplotlib/matplotlib/blob/main/doc/devel/dependencies.rst # build-system , certifi , pkg-config @@ -182,8 +181,10 @@ buildPythonPackage rec { env.MPLSETUPCFG = writeText "mplsetup.cfg" (lib.generators.toINI {} passthru.config); - # Matplotlib needs to be built against a specific version of freetype in - # order for all of the tests to pass. + # Encountering a ModuleNotFoundError, as describved and investigated at: + # https://github.com/NixOS/nixpkgs/issues/255262 . It could be that some of + # which may fail due to a freetype version that doesn't match the freetype + # version used by upstream. doCheck = false; meta = with lib; {