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.

67 lines
1.5 KiB
Nix
Raw Normal View History

2022-08-30 18:34:43 +00:00
{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, libgit2
, openssl
, 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";
version = "0.18.3";
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}";
sha256 = "sha256-PR8+4SK0Bb7+0fDwdvJBYERvhjWLXRGswNoEdRo5JiM=";
2022-08-30 18:34:43 +00:00
};
cargoSha256 = "sha256-wZR5ylhtdAUvpJ0raTM5IrbdmaHLPAYrAKU31oE8Bbg=";
2022-08-30 18:34:43 +00:00
nativeBuildInputs = [ pkg-config ];
buildInputs = [
libgit2
openssl
zlib
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
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=rustdoc_cmd::tests"
"--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
'';
# use system openssl
OPENSSL_NO_VENDOR = true;
2022-08-30 18:34:43 +00:00
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 ];
2022-08-30 18:34:43 +00:00
};
}