1{ lib
2, rustPlatform
3, fetchFromGitHub
4, pkg-config
5, stdenv
6, curl
7, openssl
8, darwin
9, libgit2_1_3_0
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "cargo-dephell";
14 version = "0.5.1";
15
16 src = fetchFromGitHub {
17 owner = "mimoo";
18 repo = pname;
19 rev = "v${version}";
20 hash = "sha256-NOjkKttA+mwPCpl4uiRIYD58DlMomVFpwnM9KGfWd+w=";
21 };
22
23 cargoLock = {
24 lockFile = ./Cargo.lock;
25 };
26
27 nativeBuildInputs = [
28 pkg-config
29 ] ++ lib.optionals stdenv.isDarwin [
30 curl
31 ];
32
33 buildInputs = [
34 openssl
35 ] ++ lib.optionals stdenv.isDarwin [
36 curl
37 darwin.apple_sdk.frameworks.Security
38 libgit2_1_3_0
39 ];
40
41 # update Cargo.lock to work with openssl 3
42 postPatch = ''
43 ln -sf ${./Cargo.lock} Cargo.lock
44 '';
45
46 meta = with lib; {
47 description = "A tool to analyze the third-party dependencies imported by a rust crate or rust workspace";
48 homepage = "https://github.com/mimoo/cargo-dephell";
49 license = with licenses; [ mit /* or */ asl20 ];
50 maintainers = with maintainers; [ figsoda matthiasbeyer ];
51 };
52}