nix-home/packages/common/kak-tree-sitter/default.nix

45 lines
1.3 KiB
Nix
Raw Normal View History

2024-07-17 14:53:19 +00:00
{ lib, rustPlatform, fetchFromSourcehut, symlinkJoin, clang, git, writeText, ... }:
let
2024-07-17 14:53:19 +00:00
src = fetchFromSourcehut {
owner = "~hadronized";
repo = "kak-tree-sitter";
2024-07-17 14:53:19 +00:00
rev = "kak-tree-sitter-v1.1.2";
hash = "sha256-wBWfSyR8LGtug/mCD0bJ4lbdN3trIA/03AnCxZoEOSA=";
};
2024-07-17 14:53:19 +00:00
kak-tree-sitter = rustPlatform.buildRustPackage {
inherit src;
pname = "kak-tree-sitter";
2024-07-17 14:53:19 +00:00
version = "1.1.2";
cargoHash = "sha256-OQPUWqJAts8DbFNSsC/CmMCbuZ9TVxRTR05O7oiodKI=";
2023-09-29 15:48:01 +00:00
cargoBuildOptions = [ "--package" "kak-tree-sitter" "--package" "ktsctl" ];
2023-09-29 15:48:01 +00:00
nativeBuildInputs = [ clang git ];
2024-07-17 14:53:19 +00:00
patches = [
# Allow absolute-path style repos
(writeText "resources.patch" ''
diff --git a/ktsctl/src/resources.rs b/ktsctl/src/resources.rs
index f1da3ff..ac89345 100644
--- a/ktsctl/src/resources.rs
+++ b/ktsctl/src/resources.rs
@@ -48,7 +48,8 @@ impl Resources {
url
.trim_start_matches("http")
.trim_start_matches('s')
- .trim_start_matches("://"),
+ .trim_start_matches(":/")
+ .trim_start_matches("/"),
);
self.runtime_dir.join("sources").join(url_dir)
'')
2024-10-07 19:11:48 +00:00
./user_config.patch
2024-07-17 14:53:19 +00:00
];
2024-10-07 14:31:33 +00:00
meta.mainProgram = "kak-tree-sitter";
};
in
2023-09-29 15:48:01 +00:00
kak-tree-sitter
2024-07-17 14:53:19 +00:00