2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchCrate
|
|
|
|
, installShellFiles
|
|
|
|
, stdenv
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "planus";
|
|
|
|
version = "0.4.0";
|
|
|
|
|
|
|
|
src = fetchCrate {
|
|
|
|
pname = "planus-cli";
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256-KpX4KSA2MjfRS8M0WVYpY4hoSvOOB7MUz7YKZwEGqj8=";
|
|
|
|
};
|
|
|
|
|
|
|
|
cargoHash = "sha256-yT/ZK5GG0rXpiaCQlQclK2iY8BXhhmiW/UDX9aL8wBQ=";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
|
|
installShellCompletion --cmd planus \
|
|
|
|
--bash <($out/bin/planus generate-completions bash) \
|
|
|
|
--fish <($out/bin/planus generate-completions fish) \
|
|
|
|
--zsh <($out/bin/planus generate-completions zsh)
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Alternative compiler for flatbuffers";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "planus";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://github.com/planus-org/planus";
|
|
|
|
changelog = "https://github.com/planus-org/planus/blob/v${version}/CHANGELOG.md";
|
|
|
|
license = with licenses; [ asl20 mit ];
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
|
|
|
};
|
|
|
|
}
|