summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/matplotlib
diff options
context:
space:
mode:
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>2021-04-10 05:08:13 -0400
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-04-20 19:47:47 +0000
commit72cb0293675896fc52d29afcdb3d3cda33480bf5 (patch)
tree2305c87d0e8fb82914d762e4e4e65a36a83dac80 /pkgs/development/python-modules/matplotlib
parent30b7492d9bcb6bf66f065c37754fa47b9e179e28 (diff)
python{2,3}Packages.matplotlib: use lib.generators.toINI to generate setup.cfg
Diffstat (limited to 'pkgs/development/python-modules/matplotlib')
-rw-r--r--pkgs/development/python-modules/matplotlib/2.nix10
-rw-r--r--pkgs/development/python-modules/matplotlib/default.nix13
-rw-r--r--pkgs/development/python-modules/matplotlib/setup-darwin.cfg7
-rw-r--r--pkgs/development/python-modules/matplotlib/setup.cfg5
4 files changed, 19 insertions, 16 deletions
diff --git a/pkgs/development/python-modules/matplotlib/2.nix b/pkgs/development/python-modules/matplotlib/2.nix
index 2c929d9a694e..63254e8f5f3f 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 4be4189f8c7a..70076847c0db 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 f6463d9c574a..000000000000
--- 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 6a7738627651..000000000000
--- a/pkgs/development/python-modules/matplotlib/setup.cfg
+++ /dev/null
@@ -1,5 +0,0 @@
-[directories]
-basedirlist = .
-
-[libs]
-system_freetype = true