2022-09-09 14:08:57 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2023-10-09 19:29:22 +00:00
|
|
|
, cmake
|
2023-03-04 12:14:45 +00:00
|
|
|
, zlib
|
2022-09-09 14:08:57 +00:00
|
|
|
, stdenv
|
2022-12-28 21:21:41 +00:00
|
|
|
, darwin
|
2023-03-04 12:14:45 +00:00
|
|
|
, git
|
2022-09-09 14:08:57 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-semver-checks";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.24.0";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "obi1kenobi";
|
2022-12-28 21:21:41 +00:00
|
|
|
repo = pname;
|
2022-09-09 14:08:57 +00:00
|
|
|
rev = "v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-K6csc/jJ0iDegK9ZSOy1aNb0GSxSXHMSOVUtFEYUBhc=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
cargoHash = "sha256-9tWzJ64UlMHQ61SRbEXACNDA+4hTPjQTBzSjEO+0rik=";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
buildInputs = [
|
|
|
|
zlib
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2023-10-09 19:29:22 +00:00
|
|
|
darwin.apple_sdk.frameworks.SystemConfiguration
|
2022-09-09 14:08:57 +00:00
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
git
|
|
|
|
];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
checkFlags = [
|
|
|
|
# requires nightly version of cargo-rustdoc
|
2023-03-04 12:14:45 +00:00
|
|
|
"--skip=both_passing_manifest_path_and_directory_works"
|
|
|
|
"--skip=verify_binary_contains_lints"
|
|
|
|
|
|
|
|
# requires internet access
|
|
|
|
"--skip=detects_target_dependencies"
|
2022-09-09 14:08:57 +00:00
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
preCheck = ''
|
|
|
|
patchShebangs scripts/regenerate_test_rustdocs.sh
|
|
|
|
git init
|
|
|
|
scripts/regenerate_test_rustdocs.sh
|
|
|
|
'';
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A tool to scan your Rust crate for semver violations";
|
2022-12-28 21:21:41 +00:00
|
|
|
homepage = "https://github.com/obi1kenobi/cargo-semver-checks";
|
2023-03-04 12:14:45 +00:00
|
|
|
changelog = "https://github.com/obi1kenobi/cargo-semver-checks/releases/tag/v${version}";
|
2022-12-28 21:21:41 +00:00
|
|
|
license = with licenses; [ mit /* or */ asl20 ];
|
2022-09-30 11:47:45 +00:00
|
|
|
maintainers = with maintainers; [ figsoda matthiasbeyer ];
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
}
|