depot/third_party/nixpkgs/pkgs/development/tools/rust/cargo-semver-checks/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

60 lines
1.3 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, cmake
, zlib
, stdenv
, darwin
, git
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-semver-checks";
version = "0.27.0";
src = fetchFromGitHub {
owner = "obi1kenobi";
repo = pname;
rev = "v${version}";
hash = "sha256-DN50syZ965MWXKg3lhEhvINeqZUtZgJNjusevf4EIUw=";
};
cargoHash = "sha256-ulsU/QSSNqyZTjM77PQnr3HVUg2dS8SxHv2y6Lsvths=";
nativeBuildInputs = [
cmake
];
buildInputs = [
zlib
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.SystemConfiguration
];
nativeCheckInputs = [
git
];
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"
];
preCheck = ''
patchShebangs scripts/regenerate_test_rustdocs.sh
git init
scripts/regenerate_test_rustdocs.sh
'';
meta = with lib; {
description = "A tool to scan your Rust crate for semver violations";
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 ];
};
}