qrtool: use rustPlatform.buildRustPackage rec {

Rather than `let ... in` syntax per feedback from @atalii
This commit is contained in:
Philip Taron 2023-11-30 13:51:05 -08:00
parent 3da9fa3ad3
commit f5100278df
No known key found for this signature in database

View File

@ -4,16 +4,15 @@
, rustPlatform , rustPlatform
, asciidoctor , asciidoctor
, installShellFiles , installShellFiles
}: let }:
name = "qrtool";
rustPlatform.buildRustPackage rec {
pname = "qrtool";
version = "0.8.5"; version = "0.8.5";
in rustPlatform.buildRustPackage {
pname = name;
inherit version;
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "sorairolake"; owner = "sorairolake";
repo = name; repo = "qrtool";
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-jrvNZGO1VIDo6Mz3NKda1C7qZUtF9T00CAFK8yoGWjc="; sha256 = "sha256-jrvNZGO1VIDo6Mz3NKda1C7qZUtF9T00CAFK8yoGWjc=";
}; };
@ -24,20 +23,20 @@ in rustPlatform.buildRustPackage {
postInstall = '' postInstall = ''
# Built by ./build.rs using `asciidoctor` # Built by ./build.rs using `asciidoctor`
installManPage ./target/*/release/build/${name}*/out/*.? installManPage ./target/*/release/build/qrtool*/out/*.?
installShellCompletion --cmd ${name} \ installShellCompletion --cmd qrtool \
--bash <($out/bin/${name} --generate-completion bash) \ --bash <($out/bin/qrtool --generate-completion bash) \
--fish <($out/bin/${name} --generate-completion fish) \ --fish <($out/bin/qrtool --generate-completion fish) \
--zsh <($out/bin/${name} --generate-completion zsh) --zsh <($out/bin/qrtool --generate-completion zsh)
''; '';
meta = with lib; { meta = with lib; {
maintainers = with maintainers; [ philiptaron ]; maintainers = with maintainers; [ philiptaron ];
description = "An utility for encoding or decoding QR code"; description = "A utility for encoding and decoding QR code images";
license = licenses.asl20; license = licenses.asl20;
homepage = "https://sorairolake.github.io/${name}/book/index.html"; homepage = "https://sorairolake.github.io/qrtool/book/index.html";
changelog = "https://sorairolake.github.io/${name}/book/changelog.html"; changelog = "https://sorairolake.github.io/qrtool/book/changelog.html";
mainProgram = name; mainProgram = "qrtool";
}; };
} }