mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-19 10:34:54 +00:00
python312Packages.matplotlib: fix running in the Darwin sandbox
This commit is contained in:
parent
7b8429bbc4
commit
dcfcc10af5
@ -0,0 +1,14 @@
|
||||
--- a/lib/matplotlib/font_manager.py
|
||||
+++ b/lib/matplotlib/font_manager.py
|
||||
@@ -266,8 +266,11 @@ def _get_fontconfig_fonts():
|
||||
@lru_cache
|
||||
def _get_macos_fonts():
|
||||
"""Cache and list the font paths known to ``system_profiler SPFontsDataType``."""
|
||||
- d, = plistlib.loads(
|
||||
- subprocess.check_output(["system_profiler", "-xml", "SPFontsDataType"]))
|
||||
+ try:
|
||||
+ d, = plistlib.loads(
|
||||
+ subprocess.check_output(["system_profiler", "-xml", "SPFontsDataType"]))
|
||||
+ except (OSError, subprocess.CalledProcessError, plistlib.InvalidFileException):
|
||||
+ return []
|
||||
return [Path(entry["path"]) for entry in d["_items"]]
|
@ -100,6 +100,12 @@ buildPythonPackage rec {
|
||||
hash = "sha256-5tKepsGeNLMPt9iLcIH4aaAwFPZv4G1izHfVpuqI7Xo=";
|
||||
};
|
||||
|
||||
patches = lib.optionals stdenv.isDarwin [
|
||||
# Don't crash when running in Darwin sandbox
|
||||
# Submitted upstream: https://github.com/matplotlib/matplotlib/pull/28498
|
||||
./darwin-sandbox-crash.patch
|
||||
];
|
||||
|
||||
env.XDG_RUNTIME_DIR = "/tmp";
|
||||
|
||||
# Matplotlib tries to find Tcl/Tk by opening a Tk window and asking the
|
||||
|
Loading…
Reference in New Issue
Block a user