Merge pull request #309531 from uncenter/refactor/cargo-shear-cleanup

cargo-shear: cleanup and set build env var
This commit is contained in:
Matthias Beyer 2024-05-08 08:19:39 +02:00 committed by GitHub
commit d64f56c77b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,24 +1,38 @@
{ fetchFromGitHub, lib, rustPlatform }:
rustPlatform.buildRustPackage rec {
pname = "cargo-shear";
{
fetchFromGitHub,
lib,
rustPlatform,
testers,
cargo-shear,
}:
let
version = "0.0.25";
in
rustPlatform.buildRustPackage {
pname = "cargo-shear";
inherit version;
src = fetchFromGitHub {
owner = "Boshen";
repo = "cargo-shear";
rev = "v${version}";
sha256 = "sha256-4NnCUe4DrnSeveicxvvDF49hrc4NdRx/N10PH7Q0k8k=";
hash = "sha256-4NnCUe4DrnSeveicxvvDF49hrc4NdRx/N10PH7Q0k8k=";
};
cargoHash = "sha256-gHXJz3Xw9vC04q001kd6AgEKKaRtAK3oGMn7JJh+Neo=";
meta = with lib; {
# https://github.com/Boshen/cargo-shear/blob/a0535415a3ea94c86642f39f343f91af5cdc3829/src/lib.rs#L20-L23
SHEAR_VERSION = version;
passthru.tests.version = testers.testVersion {
package = cargo-shear;
};
meta = {
description = "Detect and remove unused dependencies from Cargo.toml";
mainProgram = "cargo-shear";
homepage = "https://github.com/Boshen/cargo-shear";
changelog = "https://github.com/Boshen/cargo-shear/blob/${src.rev}/CHANGELOG.md";
license = with licenses; [ mit ];
maintainers = with maintainers; [ uncenter ];
changelog = "https://github.com/Boshen/cargo-shear/blob/v${version}/CHANGELOG.md";
license = [ lib.licenses.mit ];
maintainers = with lib.maintainers; [ uncenter ];
};
}