diff --git a/pkgs/development/python-modules/matplotlib/2.nix b/pkgs/development/python-modules/matplotlib/2.nix index 2c929d9a694..63254e8f5f3 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 4be4189f8c7..70076847c0d 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 f6463d9c574..00000000000 --- 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 6a773862765..00000000000 --- a/pkgs/development/python-modules/matplotlib/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[directories] -basedirlist = . - -[libs] -system_freetype = true