Merge pull request #124488 from rnhmjoj/mpl-21.05
[21.05] pythonPackages.matplotlib: fix headless detection
This commit is contained in:
commit
677fab12a9
@ -1,16 +1,21 @@
|
|||||||
{ lib, stdenv, fetchPypi, writeText, python, buildPythonPackage, isPy3k, pycairo, backports_functools_lru_cache
|
{ lib, stdenv, fetchPypi, writeText, buildPythonPackage, isPy3k, pycairo
|
||||||
, which, cycler, dateutil, nose, numpy, pyparsing, sphinx, tornado, kiwisolver
|
, which, cycler, dateutil, numpy, pyparsing, sphinx, tornado, kiwisolver
|
||||||
, freetype, qhull, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection
|
, freetype, qhull, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection
|
||||||
, certifi, pillow
|
, certifi, pillow
|
||||||
, enableGhostscript ? true, ghostscript, gtk3
|
, enableGhostscript ? true, ghostscript, gtk3
|
||||||
, enableGtk3 ? false, cairo
|
, enableGtk3 ? false, cairo
|
||||||
# darwin has its own "MacOSX" backend
|
# darwin has its own "MacOSX" backend
|
||||||
, enableTk ? !stdenv.isDarwin, tcl, tk, tkinter, libX11
|
, enableTk ? !stdenv.isDarwin, tcl, tk, tkinter
|
||||||
, enableQt ? false, pyqt5
|
, enableQt ? false, pyqt5
|
||||||
|
# required for headless detection
|
||||||
|
, libX11, wayland
|
||||||
, Cocoa
|
, Cocoa
|
||||||
, pythonOlder
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
interactive = enableTk || enableGtk3 || enableQt;
|
||||||
|
in
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
version = "3.4.1";
|
version = "3.4.1";
|
||||||
pname = "matplotlib";
|
pname = "matplotlib";
|
||||||
@ -62,8 +67,14 @@ buildPythonPackage rec {
|
|||||||
let
|
let
|
||||||
tcl_tk_cache = ''"${tk}/lib", "${tcl}/lib", "${lib.strings.substring 0 3 tk.version}"'';
|
tcl_tk_cache = ''"${tk}/lib", "${tcl}/lib", "${lib.strings.substring 0 3 tk.version}"'';
|
||||||
in
|
in
|
||||||
lib.optionalString enableTk
|
lib.optionalString enableTk ''
|
||||||
"sed -i '/self.tcl_tk_cache = None/s|None|${tcl_tk_cache}|' setupext.py";
|
sed -i '/self.tcl_tk_cache = None/s|None|${tcl_tk_cache}|' setupext.py
|
||||||
|
'' + lib.optionalString (stdenv.isLinux && interactive) ''
|
||||||
|
# fix paths to libraries in dlopen calls (headless detection)
|
||||||
|
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
|
||||||
|
'';
|
||||||
|
|
||||||
# Matplotlib needs to be built against a specific version of freetype in
|
# Matplotlib needs to be built against a specific version of freetype in
|
||||||
# order for all of the tests to pass.
|
# order for all of the tests to pass.
|
||||||
@ -72,6 +83,7 @@ buildPythonPackage rec {
|
|||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Python plotting library, making publication quality plots";
|
description = "Python plotting library, making publication quality plots";
|
||||||
homepage = "https://matplotlib.org/";
|
homepage = "https://matplotlib.org/";
|
||||||
|
license = with licenses; [ psfl bsd0 ];
|
||||||
maintainers = with maintainers; [ lovek323 veprbl ];
|
maintainers = with maintainers; [ lovek323 veprbl ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user