From c48a125faae225aeb1dd6c6699241520a1ac39ca Mon Sep 17 00:00:00 2001 From: figsoda Date: Sat, 3 Jun 2023 09:57:06 -0400 Subject: [PATCH] planus: init at 0.4.0 https://github.com/planus-org/planus --- .../development/tools/misc/planus/default.nix | 38 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 40 insertions(+) create mode 100644 pkgs/development/tools/misc/planus/default.nix diff --git a/pkgs/development/tools/misc/planus/default.nix b/pkgs/development/tools/misc/planus/default.nix new file mode 100644 index 000000000000..9074debb2633 --- /dev/null +++ b/pkgs/development/tools/misc/planus/default.nix @@ -0,0 +1,38 @@ +{ 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; { + description = "An alternative compiler for flatbuffers"; + 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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 192662252060..756f86c371dc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19040,6 +19040,8 @@ with pkgs; picotool = callPackage ../development/tools/picotool { }; + planus = callPackage ../development/tools/misc/planus { }; + pmccabe = callPackage ../development/tools/misc/pmccabe { }; pkgconf-unwrapped = callPackage ../development/tools/misc/pkgconf { };