2023-11-07 23:52:31 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2023-11-30 06:46:08 +00:00
|
|
|
, asciidoctor
|
2023-11-30 17:11:31 +00:00
|
|
|
, installShellFiles
|
2023-11-30 21:51:05 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "qrtool";
|
2024-04-16 11:10:55 +00:00
|
|
|
version = "0.10.8";
|
2023-11-07 23:52:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sorairolake";
|
2023-11-30 21:51:05 +00:00
|
|
|
repo = "qrtool";
|
2023-11-07 23:52:31 +00:00
|
|
|
rev = "v${version}";
|
2024-04-16 11:10:55 +00:00
|
|
|
sha256 = "sha256-YNA8LdqkgScBAoLyWsr4JIeFcU4KfNAYByXSvaccOoU=";
|
2023-11-07 23:52:31 +00:00
|
|
|
};
|
|
|
|
|
2024-04-16 11:10:55 +00:00
|
|
|
cargoHash = "sha256-6yQVH15oW8dCjNKwL2Gb6IQKilVYokBs2j+M4fWLm+4=";
|
2023-11-30 06:46:08 +00:00
|
|
|
|
2023-11-30 17:11:31 +00:00
|
|
|
nativeBuildInputs = [ asciidoctor installShellFiles ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Built by ./build.rs using `asciidoctor`
|
2023-11-30 21:51:05 +00:00
|
|
|
installManPage ./target/*/release/build/qrtool*/out/*.?
|
2023-11-30 17:11:31 +00:00
|
|
|
|
2023-11-30 21:51:05 +00:00
|
|
|
installShellCompletion --cmd qrtool \
|
|
|
|
--bash <($out/bin/qrtool --generate-completion bash) \
|
|
|
|
--fish <($out/bin/qrtool --generate-completion fish) \
|
|
|
|
--zsh <($out/bin/qrtool --generate-completion zsh)
|
2023-11-30 17:11:31 +00:00
|
|
|
'';
|
2023-11-07 23:52:31 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
maintainers = with maintainers; [ philiptaron ];
|
2023-11-30 21:51:05 +00:00
|
|
|
description = "A utility for encoding and decoding QR code images";
|
2023-11-07 23:52:31 +00:00
|
|
|
license = licenses.asl20;
|
2023-11-30 21:51:05 +00:00
|
|
|
homepage = "https://sorairolake.github.io/qrtool/book/index.html";
|
|
|
|
changelog = "https://sorairolake.github.io/qrtool/book/changelog.html";
|
|
|
|
mainProgram = "qrtool";
|
2023-11-07 23:52:31 +00:00
|
|
|
};
|
|
|
|
}
|