python3Packages.tree-sitter-grammars: fix dynamic linker cannot find parser on darwin

closes #402677

need to make `DYLD_LIBRARY_PATH` available
This commit is contained in:
Yifei Sun 2025-04-29 13:48:15 -04:00 committed by Valentin Gagarin
parent aba39ed83f
commit 590411b8b3

View File

@ -1,5 +1,6 @@
{
lib,
stdenv,
buildPythonPackage,
pytestCheckHook,
tree-sitter,
@ -132,6 +133,10 @@ buildPythonPackage {
];
};
preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
export DYLD_LIBRARY_PATH="${grammarDrv}"
'';
preCheck = ''
# https://github.com/NixOS/nixpkgs/issues/255262
rm -r ${snakeCaseName}