From 72cb0293675896fc52d29afcdb3d3cda33480bf5 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 10 Apr 2021 05:08:13 -0400 Subject: [PATCH 1/4] python{2,3}Packages.matplotlib: use lib.generators.toINI to generate setup.cfg --- pkgs/development/python-modules/matplotlib/2.nix | 10 ++++++++-- .../python-modules/matplotlib/default.nix | 13 +++++++++++-- .../python-modules/matplotlib/setup-darwin.cfg | 7 ------- .../development/python-modules/matplotlib/setup.cfg | 5 ----- 4 files changed, 19 insertions(+), 16 deletions(-) delete mode 100644 pkgs/development/python-modules/matplotlib/setup-darwin.cfg delete mode 100644 pkgs/development/python-modules/matplotlib/setup.cfg diff --git a/pkgs/development/python-modules/matplotlib/2.nix b/pkgs/development/python-modules/matplotlib/2.nix index 2c929d9a694e0..63254e8f5f3f6 100644 --- a/pkgs/development/python-modules/matplotlib/2.nix +++ b/pkgs/development/python-modules/matplotlib/2.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchPypi, python, buildPythonPackage, pycairo, backports_functools_lru_cache +{ lib, stdenv, fetchPypi, writeText, python, buildPythonPackage, pycairo, backports_functools_lru_cache , which, cycler, dateutil, nose, numpy, pyparsing, sphinx, tornado, kiwisolver , freetype, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection, functools32, subprocess32 , fetchpatch @@ -54,7 +54,13 @@ buildPythonPackage rec { ++ lib.optionals enableQt [ pyqt4 ] ++ lib.optionals python.isPy2 [ functools32 subprocess32 ]; - setup_cfg = ./setup.cfg; + passthru.config = { + directories = { basedirlist = "."; }; + libs = { + system_freetype = true; + }; + }; + setup_cfg = writeText "setup.cfg" (lib.generators.toINI {} passthru.config); preBuild = '' cp "$setup_cfg" ./setup.cfg ''; diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index 4be4189f8c7ad..70076847c0dbb 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchPypi, python, buildPythonPackage, isPy3k, pycairo, backports_functools_lru_cache +{ lib, stdenv, fetchPypi, writeText, python, buildPythonPackage, isPy3k, pycairo, backports_functools_lru_cache , which, cycler, dateutil, nose, numpy, pyparsing, sphinx, tornado, kiwisolver , freetype, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection , certifi, pillow @@ -45,7 +45,16 @@ buildPythonPackage rec { ++ lib.optionals enableTk [ tcl tk tkinter libX11 ] ++ lib.optionals enableQt [ pyqt5 ]; - setup_cfg = if stdenv.isDarwin then ./setup-darwin.cfg else ./setup.cfg; + passthru.config = { + directories = { basedirlist = "."; }; + libs = { + system_freetype = true; + } // lib.optionalAttrs stdenv.isDarwin { + # LTO not working in darwin stdenv, see #19312 + enable_lto = false; + }; + }; + setup_cfg = writeText "setup.cfg" (lib.generators.toINI {} passthru.config); preBuild = '' cp "$setup_cfg" ./setup.cfg ''; diff --git a/pkgs/development/python-modules/matplotlib/setup-darwin.cfg b/pkgs/development/python-modules/matplotlib/setup-darwin.cfg deleted file mode 100644 index f6463d9c574a5..0000000000000 --- a/pkgs/development/python-modules/matplotlib/setup-darwin.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[directories] -basedirlist = . - -[libs] -system_freetype = true -# LTO not working in darwin stdenv, see #19312 -enable_lto = false diff --git a/pkgs/development/python-modules/matplotlib/setup.cfg b/pkgs/development/python-modules/matplotlib/setup.cfg deleted file mode 100644 index 6a77386276512..0000000000000 --- a/pkgs/development/python-modules/matplotlib/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[directories] -basedirlist = . - -[libs] -system_freetype = true From e6d9e58289fa6b97f8b7f843d7be6e21f8a96fa2 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 10 Apr 2021 05:18:11 -0400 Subject: [PATCH 2/4] python3Packages.matplotlib: 3.3.4 -> 3.4.1 --- .../development/python-modules/matplotlib/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index 70076847c0dbb..e6e8183e999e6 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchPypi, writeText, python, buildPythonPackage, isPy3k, pycairo, backports_functools_lru_cache , which, cycler, dateutil, nose, numpy, pyparsing, sphinx, tornado, kiwisolver -, freetype, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection +, freetype, qhull, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection , certifi, pillow , enableGhostscript ? true, ghostscript ? null, gtk3 , enableGtk3 ? false, cairo @@ -20,14 +20,14 @@ assert enableTk -> (tcl != null) assert enableQt -> pyqt5 != null; buildPythonPackage rec { - version = "3.3.4"; + version = "3.4.1"; pname = "matplotlib"; disabled = !isPy3k; src = fetchPypi { inherit pname version; - sha256 = "3e477db76c22929e4c6876c44f88d790aacdf3c3f8f3a90cb1975c0bf37825b0"; + sha256 = "84d4c4f650f356678a5d658a43ca21a41fca13f9b8b00169c0b76e6a6a948908"; }; XDG_RUNTIME_DIR = "/tmp"; @@ -39,8 +39,8 @@ buildPythonPackage rec { ++ lib.optional stdenv.isDarwin [ Cocoa ]; propagatedBuildInputs = - [ cycler dateutil numpy pyparsing tornado freetype kiwisolver - certifi libpng mock pytz pillow ] + [ cycler dateutil numpy pyparsing tornado freetype qhull + kiwisolver certifi libpng mock pytz pillow ] ++ lib.optionals enableGtk3 [ cairo pycairo gtk3 gobject-introspection pygobject3 ] ++ lib.optionals enableTk [ tcl tk tkinter libX11 ] ++ lib.optionals enableQt [ pyqt5 ]; @@ -49,6 +49,7 @@ buildPythonPackage rec { directories = { basedirlist = "."; }; libs = { system_freetype = true; + system_qhull = true; } // lib.optionalAttrs stdenv.isDarwin { # LTO not working in darwin stdenv, see #19312 enable_lto = false; From de797ef97e107b967e3283f4096a46e7b9b0b00d Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 10 Apr 2021 06:43:47 -0400 Subject: [PATCH 3/4] python2Packages.matplotlib: remove invalid libs.system_freetype setup option --- pkgs/development/python-modules/matplotlib/2.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/development/python-modules/matplotlib/2.nix b/pkgs/development/python-modules/matplotlib/2.nix index 63254e8f5f3f6..e0879050704da 100644 --- a/pkgs/development/python-modules/matplotlib/2.nix +++ b/pkgs/development/python-modules/matplotlib/2.nix @@ -56,9 +56,6 @@ buildPythonPackage rec { passthru.config = { directories = { basedirlist = "."; }; - libs = { - system_freetype = true; - }; }; setup_cfg = writeText "setup.cfg" (lib.generators.toINI {} passthru.config); preBuild = '' From 72a1c0cbc46acbb1e5f2678373a19373de924ac3 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 11 Apr 2021 01:39:38 -0400 Subject: [PATCH 4/4] python{2,3}Packages.matplotlib: remove pointless asserts --- pkgs/development/python-modules/matplotlib/2.nix | 12 ++---------- .../python-modules/matplotlib/default.nix | 14 +++----------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/pkgs/development/python-modules/matplotlib/2.nix b/pkgs/development/python-modules/matplotlib/2.nix index e0879050704da..a6ee1a3bade77 100644 --- a/pkgs/development/python-modules/matplotlib/2.nix +++ b/pkgs/development/python-modules/matplotlib/2.nix @@ -2,23 +2,15 @@ , which, cycler, dateutil, nose, numpy, pyparsing, sphinx, tornado, kiwisolver , freetype, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection, functools32, subprocess32 , fetchpatch -, enableGhostscript ? false, ghostscript ? null, gtk3 +, enableGhostscript ? false, ghostscript, gtk3 , enableGtk3 ? false, cairo # darwin has its own "MacOSX" backend -, enableTk ? !stdenv.isDarwin, tcl ? null, tk ? null, tkinter ? null, libX11 ? null +, enableTk ? !stdenv.isDarwin, tcl, tk, tkinter, libX11 , enableQt ? false, pyqt4 , Cocoa , pythonOlder }: -assert enableGhostscript -> ghostscript != null; -assert enableTk -> (tcl != null) - && (tk != null) - && (tkinter != null) - && (libX11 != null) - ; -assert enableQt -> pyqt4 != null; - buildPythonPackage rec { version = "2.2.3"; pname = "matplotlib"; diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index e6e8183e999e6..7364920cba22c 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -2,23 +2,15 @@ , which, cycler, dateutil, nose, numpy, pyparsing, sphinx, tornado, kiwisolver , freetype, qhull, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection , certifi, pillow -, enableGhostscript ? true, ghostscript ? null, gtk3 +, enableGhostscript ? true, ghostscript, gtk3 , enableGtk3 ? false, cairo # darwin has its own "MacOSX" backend -, enableTk ? !stdenv.isDarwin, tcl ? null, tk ? null, tkinter ? null, libX11 ? null -, enableQt ? false, pyqt5 ? null +, enableTk ? !stdenv.isDarwin, tcl, tk, tkinter, libX11 +, enableQt ? false, pyqt5 , Cocoa , pythonOlder }: -assert enableGhostscript -> ghostscript != null; -assert enableTk -> (tcl != null) - && (tk != null) - && (tkinter != null) - && (libX11 != null) - ; -assert enableQt -> pyqt5 != null; - buildPythonPackage rec { version = "3.4.1"; pname = "matplotlib";