diff --git a/pkgs/development/python-modules/cairocffi/default.nix b/pkgs/development/python-modules/cairocffi/default.nix index 0779eae1c92d..bbcdbfb5fff8 100644 --- a/pkgs/development/python-modules/cairocffi/default.nix +++ b/pkgs/development/python-modules/cairocffi/default.nix @@ -56,6 +56,10 @@ buildPythonPackage rec { pythonImportsCheck = [ "cairocffi" ]; + # Cairo tries to load system fonts by default. + # It's surfaced as a Cairo "out of memory" error in tests. + __impureHostDeps = [ "/System/Library/Fonts" ]; + meta = with lib; { changelog = "https://github.com/Kozea/cairocffi/blob/v${version}/NEWS.rst"; homepage = "https://github.com/SimonSapin/cairocffi"; diff --git a/pkgs/development/python-modules/pycairo/default.nix b/pkgs/development/python-modules/pycairo/default.nix index b1f0e5eba83e..883a879d3b1f 100644 --- a/pkgs/development/python-modules/pycairo/default.nix +++ b/pkgs/development/python-modules/pycairo/default.nix @@ -37,6 +37,10 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; + # Cairo tries to load system fonts by default. + # It's surfaced as a Cairo "out of memory" error in tests. + __impureHostDeps = [ "/System/Library/Fonts" ]; + mesonFlags = [ # This is only used for figuring out what version of Python is in # use, and related stuff like figuring out what the install prefix diff --git a/pkgs/development/python-modules/pygal/default.nix b/pkgs/development/python-modules/pygal/default.nix index 52265c6ae970..2585c7dda9f5 100644 --- a/pkgs/development/python-modules/pygal/default.nix +++ b/pkgs/development/python-modules/pygal/default.nix @@ -56,6 +56,10 @@ buildPythonPackage rec { export LANG=en_US.UTF-8 ''; + # Cairo tries to load system fonts by default. + # It's surfaced as a Cairo "out of memory" error in tests. + __impureHostDeps = [ "/System/Library/Fonts" ]; + postCheck = '' export LANG=${if stdenv.isDarwin then "en_US.UTF-8" else "C.UTF-8"} '';