Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / compilers / rust / cargo-auditable.nix
blobb86ed5d7d4e16b909604db82f489ee4bd8966eb8
1 { lib, buildPackages, fetchFromGitHub, makeRustPlatform, installShellFiles, stdenv }:
3 let
4   args = rec {
5     pname = "cargo-auditable";
6     version = "0.6.1";
8     src = fetchFromGitHub {
9       owner = "rust-secure-code";
10       repo = pname;
11       rev = "v${version}";
12       sha256 = "sha256-MKMPLv8jeST0l4tq+MMPC18qfZMmBixdj6Ng19YKepU=";
13     };
15     cargoSha256 = "sha256-6/f7pNaTL+U6bI6jMakU/lfwYYxN/EM3WkKZcydsyLk=";
17     # Cargo.lock is outdated
18     preConfigure = ''
19       cargo update --offline
20     '';
22     meta = with lib; {
23       description = "A tool to make production Rust binaries auditable";
24       homepage = "https://github.com/rust-secure-code/cargo-auditable";
25       changelog = "https://github.com/rust-secure-code/cargo-auditable/blob/v${version}/cargo-auditable/CHANGELOG.md";
26       license = with licenses; [ mit /* or */ asl20 ];
27       maintainers = with maintainers; [ figsoda ];
28       broken = stdenv.hostPlatform != stdenv.buildPlatform;
29     };
30   };
32   rustPlatform = makeRustPlatform {
33     inherit (buildPackages) rustc;
34     cargo = buildPackages.cargo.override {
35       auditable = false;
36     };
37   };
39   bootstrap = rustPlatform.buildRustPackage (args // {
40     auditable = false;
41   });
44 rustPlatform.buildRustPackage.override { cargo-auditable = bootstrap; } (args // {
45   nativeBuildInputs = [
46     installShellFiles
47   ];
49   postInstall = ''
50     installManPage cargo-auditable/cargo-auditable.1
51   '';
53   passthru = {
54     inherit bootstrap;
55   };