2024-06-10 13:51:31 +03:00
|
|
|
{
|
|
|
|
lib,
|
2024-07-25 17:37:49 +02:00
|
|
|
stdenv,
|
2024-06-10 13:51:31 +03:00
|
|
|
rustPlatform,
|
|
|
|
fetchFromGitHub,
|
|
|
|
protobuf,
|
|
|
|
pkg-config,
|
2024-07-25 17:37:49 +02:00
|
|
|
rustc,
|
2024-06-10 13:51:31 +03:00
|
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "kclvm";
|
2025-04-06 14:10:53 +00:00
|
|
|
version = "0.11.1";
|
2024-06-10 13:51:31 +03:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kcl-lang";
|
|
|
|
repo = "kcl";
|
|
|
|
rev = "v${version}";
|
2025-04-06 14:10:53 +00:00
|
|
|
hash = "sha256-14yFGa8y8w3wbCmx0JOSN0TShXLZZpTdVynEfUKkjuE=";
|
2024-06-10 13:51:31 +03:00
|
|
|
};
|
|
|
|
|
2024-08-02 14:53:11 +02:00
|
|
|
sourceRoot = "${src.name}/kclvm";
|
2025-03-24 12:40:48 +01:00
|
|
|
|
|
|
|
useFetchCargoVendor = true;
|
2025-04-06 14:10:53 +00:00
|
|
|
cargoHash = "sha256-o7YFyqRWAMjq23mcAqDrcN4infdBgp1KNvviYOLR35s=";
|
2024-06-10 13:51:31 +03:00
|
|
|
|
2025-04-14 09:29:14 -04:00
|
|
|
buildInputs = [ rustc ];
|
2024-07-25 17:37:49 +02:00
|
|
|
|
|
|
|
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
|
|
install_name_tool -id $out/lib/libkclvm_cli_cdylib.dylib $out/lib/libkclvm_cli_cdylib.dylib
|
|
|
|
'';
|
|
|
|
|
2024-06-10 13:51:31 +03:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
protobuf
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [ ./enable_protoc_env.patch ];
|
|
|
|
|
|
|
|
PROTOC = "${protobuf}/bin/protoc";
|
|
|
|
PROTOC_INCLUDE = "${protobuf}/include";
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A high-performance implementation of KCL written in Rust that uses LLVM as the compiler backend";
|
|
|
|
homepage = "https://github.com/kcl-lang/kcl";
|
|
|
|
license = licenses.asl20;
|
2024-07-25 17:37:49 +02:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2024-06-10 13:51:31 +03:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
selfuryon
|
|
|
|
peefy
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|