nixpkgs/pkgs/development/tools/rust/cargo-semver-checks/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
1.4 KiB
Nix
Raw Normal View History

2022-08-30 18:34:43 +00:00
{ lib
, rustPlatform
, fetchFromGitHub
, cmake
, zlib
2022-08-30 18:34:43 +00:00
, stdenv
, darwin
, git
2022-08-30 18:34:43 +00:00
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-semver-checks";
2024-03-17 00:51:51 +00:00
version = "0.30.0";
2022-08-30 18:34:43 +00:00
src = fetchFromGitHub {
owner = "obi1kenobi";
repo = pname;
2022-08-30 18:34:43 +00:00
rev = "v${version}";
2024-03-17 00:51:51 +00:00
hash = "sha256-5+UE1Ka2pciuNrkrPDCJMp12+IUbgq7k3cKSP5pahw4=";
2022-08-30 18:34:43 +00:00
};
2024-03-17 00:51:51 +00:00
cargoHash = "sha256-GuajrFdPlgneL95eWT3n2MdzfsbuID/pI9ED8TlVOCo=";
2022-08-30 18:34:43 +00:00
nativeBuildInputs = [
cmake
];
2022-08-30 18:34:43 +00:00
buildInputs = [
zlib
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.SystemConfiguration
2022-08-30 18:34:43 +00:00
];
nativeCheckInputs = [
git
];
2022-08-30 18:34:43 +00:00
checkFlags = [
# requires nightly version of cargo-rustdoc
"--skip=both_passing_manifest_path_and_directory_works"
"--skip=verify_binary_contains_lints"
# requires internet access
"--skip=detects_target_dependencies"
2022-08-30 18:34:43 +00:00
];
preCheck = ''
patchShebangs scripts/regenerate_test_rustdocs.sh
git init
scripts/regenerate_test_rustdocs.sh
'';
2022-08-30 18:34:43 +00:00
meta = with lib; {
description = "A tool to scan your Rust crate for semver violations";
mainProgram = "cargo-semver-checks";
homepage = "https://github.com/obi1kenobi/cargo-semver-checks";
changelog = "https://github.com/obi1kenobi/cargo-semver-checks/releases/tag/v${version}";
license = with licenses; [ mit /* or */ asl20 ];
maintainers = with maintainers; [ figsoda matthiasbeyer ];
2022-08-30 18:34:43 +00:00
};
}