Merge: zmap: 4.2.0 -> 4.3.1 (#364578)
[NixPkgs.git] / pkgs / by-name / pr / preserves-tools / package.nix
blob9ea3dfb2de903d9f6ec6b4e5f610e34f5ab5a95b
2   lib,
3   stdenv,
4   rustPlatform,
5   fetchCrate,
6   installShellFiles,
7 }:
9 rustPlatform.buildRustPackage rec {
10   pname = "preserves-tools";
11   version = "4.996.1";
13   src = fetchCrate {
14     inherit pname version;
15     hash = "sha256-Uyh5mXCypX3TDxxJtnTe6lBoVI8aqdG56ywn7htDGUY=";
16   };
18   cargoHash = "sha256-rDo/jA4b+GV90SKM82JcGTX1pcAQUeBrLvGwU/geGOw=";
20   nativeBuildInputs = [ installShellFiles ];
21   postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
22     installShellCompletion --cmd preserves-tool \
23       --bash <($out/bin/preserves-tool completions bash) \
24       --fish <($out/bin/preserves-tool completions fish) \
25       --zsh <($out/bin/preserves-tool completions zsh)
26   '';
28   meta = {
29     description = "Command-line utilities for working with Preserves documents";
30     homepage = "https://preserves.dev/doc/preserves-tool.html";
31     license = lib.licenses.asl20;
32     maintainers = with lib.maintainers; [ ehmry ];
33     mainProgram = "preserves-tool";
34   };