1{ lib
2, rustPlatform
3, fetchFromGitHub
4, pkg-config
5, libgit2_1_5
6, openssl
7, zlib
8, zstd
9, stdenv
10, curl
11, darwin
12}:
13
14rustPlatform.buildRustPackage rec {
15 pname = "cargo-deny";
16 version = "0.13.9";
17
18 src = fetchFromGitHub {
19 owner = "EmbarkStudios";
20 repo = pname;
21 rev = version;
22 hash = "sha256-fkbYPn7GmnOgLvJqbizVKKLBnzVn0Ji6jQc23DimIX4=";
23 };
24
25 cargoHash = "sha256-WHr2Ky0LlK/EVOrSK3MF9Yt/Qe/6o7Ftx7X8iECj6pM=";
26
27 nativeBuildInputs = [ pkg-config ];
28
29 buildInputs = [
30 libgit2_1_5
31 openssl
32 zlib
33 zstd
34 ] ++ lib.optionals stdenv.isDarwin [
35 curl
36 darwin.apple_sdk.frameworks.Security
37 ];
38
39 buildNoDefaultFeatures = true;
40
41 env = {
42 ZSTD_SYS_USE_PKG_CONFIG = true;
43 };
44
45 # tests require internet access
46 doCheck = false;
47
48 meta = with lib; {
49 description = "Cargo plugin to generate list of all licenses for a crate";
50 homepage = "https://github.com/EmbarkStudios/cargo-deny";
51 changelog = "https://github.com/EmbarkStudios/cargo-deny/blob/${version}/CHANGELOG.md";
52 license = with licenses; [ asl20 /* or */ mit ];
53 maintainers = with maintainers; [ figsoda matthiasbeyer jk ];
54 };
55}