depot/third_party/nixpkgs/pkgs/development/tools/misc/planus/default.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

39 lines
1 KiB
Nix

{ lib
, rustPlatform
, fetchCrate
, installShellFiles
, stdenv
}:
rustPlatform.buildRustPackage rec {
pname = "planus";
version = "1.0.0";
src = fetchCrate {
pname = "planus-cli";
inherit version;
hash = "sha256-HbnuLu1yCpwouDVBH/vcFVLDMZWeqHH6qHFJoTbaS9Y=";
};
cargoHash = "sha256-AJtQrImQlxnp1RbbOZHAJsvlhm39OlC5WyvD5jybMAY=";
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; {
description = "Alternative compiler for flatbuffers";
mainProgram = "planus";
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 ];
};
}