2024-07-17 14:53:19 +00:00
|
|
|
{ lib, rustPlatform, fetchFromSourcehut, symlinkJoin, clang, git, writeText, ... }:
|
2023-06-29 16:36:53 +00:00
|
|
|
let
|
2024-07-17 14:53:19 +00:00
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~hadronized";
|
2023-06-29 16:36:53 +00:00
|
|
|
repo = "kak-tree-sitter";
|
2024-07-17 14:53:19 +00:00
|
|
|
rev = "kak-tree-sitter-v1.1.2";
|
|
|
|
hash = "sha256-wBWfSyR8LGtug/mCD0bJ4lbdN3trIA/03AnCxZoEOSA=";
|
2023-06-29 16:36:53 +00:00
|
|
|
};
|
|
|
|
|
2024-07-17 14:53:19 +00:00
|
|
|
kak-tree-sitter = rustPlatform.buildRustPackage {
|
2023-06-29 16:36:53 +00:00
|
|
|
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-06-29 16:36:53 +00:00
|
|
|
|
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 14:31:33 +00:00
|
|
|
|
|
|
|
meta.mainProgram = "kak-tree-sitter";
|
2023-06-29 16:36:53 +00:00
|
|
|
};
|
|
|
|
in
|
2023-09-29 15:48:01 +00:00
|
|
|
kak-tree-sitter
|
2024-07-17 14:53:19 +00:00
|
|
|
|