depot/third_party/nixpkgs/pkgs/by-name/qr/qrtool/package.nix
Default email 23b612e36f Project import generated by Copybara.
GitOrigin-RevId: ae5c332cbb5827f6b1f02572496b141021de335f
2024-01-25 23:12:00 +09:00

42 lines
1.2 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, asciidoctor
, installShellFiles
}:
rustPlatform.buildRustPackage rec {
pname = "qrtool";
version = "0.10.4";
src = fetchFromGitHub {
owner = "sorairolake";
repo = "qrtool";
rev = "v${version}";
sha256 = "sha256-b1dNGEdjmY2RSZ3M7lwWVeookMij2rUsVtevsYYNtw0=";
};
cargoHash = "sha256-9Zd4zETDy8iM/rrZI55NOybpa4Sn9AzYsNYmLDzxL+Q=";
nativeBuildInputs = [ asciidoctor installShellFiles ];
postInstall = ''
# Built by ./build.rs using `asciidoctor`
installManPage ./target/*/release/build/qrtool*/out/*.?
installShellCompletion --cmd qrtool \
--bash <($out/bin/qrtool --generate-completion bash) \
--fish <($out/bin/qrtool --generate-completion fish) \
--zsh <($out/bin/qrtool --generate-completion zsh)
'';
meta = with lib; {
maintainers = with maintainers; [ philiptaron ];
description = "A utility for encoding and decoding QR code images";
license = licenses.asl20;
homepage = "https://sorairolake.github.io/qrtool/book/index.html";
changelog = "https://sorairolake.github.io/qrtool/book/changelog.html";
mainProgram = "qrtool";
};
}