2021-04-27 23:42:47 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
2021-11-16 15:32:10 +00:00
|
|
|
, rustup
|
2021-04-27 23:42:47 +00:00
|
|
|
, openssl
|
2021-05-11 08:33:52 +00:00
|
|
|
, stdenv
|
|
|
|
, libiconv
|
|
|
|
, Security
|
2021-11-16 15:32:10 +00:00
|
|
|
, makeWrapper
|
2023-05-31 23:00:23 +00:00
|
|
|
, gitUpdater
|
2021-04-27 23:42:47 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-msrv";
|
2022-02-28 02:21:23 +00:00
|
|
|
version = "0.15.1";
|
2021-04-27 23:42:47 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "foresterre";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-02-28 02:21:23 +00:00
|
|
|
sha256 = "sha256-rmWPkxxrpVamYHII0xkZq62ubL3/jrcqXUvFH9VuNtg=";
|
2021-04-27 23:42:47 +00:00
|
|
|
};
|
|
|
|
|
2022-02-28 02:21:23 +00:00
|
|
|
cargoSha256 = "sha256-/Bspy94uIP/e4uJY8qo+UPK1tnPjglxiMWeYWx2qoHk=";
|
2021-04-27 23:42:47 +00:00
|
|
|
|
|
|
|
passthru = {
|
2023-05-31 23:00:23 +00:00
|
|
|
updateScript = gitUpdater {
|
|
|
|
rev-prefix = "v";
|
|
|
|
ignoredVersions = ".(rc|beta).*";
|
|
|
|
};
|
2021-04-27 23:42:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Integration tests fail
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-05-11 08:33:52 +00:00
|
|
|
buildInputs = if stdenv.isDarwin
|
|
|
|
then [ libiconv Security ]
|
|
|
|
else [ openssl ];
|
2021-04-27 23:42:47 +00:00
|
|
|
|
2021-11-16 15:32:10 +00:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper ];
|
|
|
|
|
|
|
|
# Depends at run-time on having rustup in PATH
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/cargo-msrv --prefix PATH : ${lib.makeBinPath [ rustup ]};
|
|
|
|
'';
|
2021-04-27 23:42:47 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Cargo subcommand \"msrv\": assists with finding your minimum supported Rust version (MSRV)";
|
|
|
|
homepage = "https://github.com/foresterre/cargo-msrv";
|
|
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
2023-08-11 22:41:21 +00:00
|
|
|
maintainers = with maintainers; [ otavio matthiasbeyer ];
|
2021-04-27 23:42:47 +00:00
|
|
|
};
|
|
|
|
}
|