depot/third_party/nixpkgs/pkgs/by-name/qr/qrtool/package.nix
Luke Granger-Brown f92e137cfb
Some checks failed
/ combine-systems (push) Blocked by required conditions
/ build (x86_64-linux) (push) Failing after 11m44s
/ build (aarch64-linux) (push) Failing after 11m50s
/ build (push) Failing after 16m42s
Merge commit '1e2ed035f4bebc9adad02b365508ad96f7df87c1' into HEAD
2025-03-02 02:23:32 +00:00

50 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
asciidoctor,
installShellFiles,
}:
rustPlatform.buildRustPackage rec {
pname = "qrtool";
version = "0.11.7";
src = fetchFromGitHub {
owner = "sorairolake";
repo = "qrtool";
rev = "v${version}";
hash = "sha256-vgAkhEbU/Wm2rUEMqRx4WGSgLI7nZ5+OrGUc91l6+7M=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-6UeQ1Gs/jA7rHNGnPE5V9rebbsfOR5GrSNOO2FLSra8=";
nativeBuildInputs = [
asciidoctor
installShellFiles
];
postInstall =
''
# Built by ./build.rs using `asciidoctor`
installManPage ./target/*/release/build/qrtool*/out/*.?
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
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 = "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";
};
}