tree-sitter: macOS compatibility

This commit is contained in:
Nick Hu 2020-11-09 18:41:51 +00:00
parent aea7f1b540
commit a63c72212c
No known key found for this signature in database
GPG Key ID: 9E35DDA3DF631330
2 changed files with 7 additions and 3 deletions

View File

@ -5,6 +5,7 @@
, callPackage
, enableShared ? true
, enableStatic ? false
, Security
}:
# TODO: move to carnix or https://github.com/kolloch/crate2nix
@ -51,6 +52,8 @@ in rustPlatform.buildRustPackage {
pname = "tree-sitter";
inherit src version cargoSha256;
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
nativeBuildInputs = [ emscripten which ];
postPatch = ''
@ -103,9 +106,8 @@ in rustPlatform.buildRustPackage {
'';
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ Profpatsch ];
# Darwin needs some more work with default libraries
# Aarch has test failures with how tree-sitter compiles the generated C files
broken = stdenv.isDarwin || stdenv.isAarch64;
broken = stdenv.isAarch64;
};
}

View File

@ -11885,7 +11885,9 @@ in
travis = callPackage ../development/tools/misc/travis { };
tree-sitter = callPackage ../development/tools/parsing/tree-sitter { };
tree-sitter = callPackage ../development/tools/parsing/tree-sitter {
inherit (darwin.apple_sdk.frameworks) Security;
};
trellis = callPackage ../development/tools/trellis { };