at master 1.7 kB view raw
1{ 2 lib, 3 buildPackages, 4 fetchFromGitHub, 5 makeRustPlatform, 6 installShellFiles, 7 stdenv, 8}: 9 10let 11 args = rec { 12 pname = "cargo-auditable"; 13 version = "0.6.5"; 14 15 src = fetchFromGitHub { 16 owner = "rust-secure-code"; 17 repo = "cargo-auditable"; 18 rev = "v${version}"; 19 sha256 = "sha256-zjv2/qZM0vRyz45DeKRtPHaamv2iLtjpSedVTEXeDr8="; 20 }; 21 22 cargoDeps = rustPlatform.fetchCargoVendor { 23 inherit pname version src; 24 hash = "sha256-oTPGmoGlNfPVZ6qha/oXyPJp94fT2cNlVggbIGHf2bc="; 25 }; 26 27 checkFlags = [ 28 # requires wasm32-unknown-unknown target 29 "--skip=test_wasm" 30 ]; 31 32 meta = with lib; { 33 description = "Tool to make production Rust binaries auditable"; 34 mainProgram = "cargo-auditable"; 35 homepage = "https://github.com/rust-secure-code/cargo-auditable"; 36 changelog = "https://github.com/rust-secure-code/cargo-auditable/blob/v${version}/cargo-auditable/CHANGELOG.md"; 37 license = with licenses; [ 38 mit # or 39 asl20 40 ]; 41 maintainers = with maintainers; [ figsoda ]; 42 broken = stdenv.hostPlatform != stdenv.buildPlatform; 43 }; 44 }; 45 46 rustPlatform = makeRustPlatform { 47 inherit (buildPackages) rustc; 48 cargo = buildPackages.cargo.override { 49 auditable = false; 50 }; 51 }; 52 53 bootstrap = rustPlatform.buildRustPackage ( 54 args 55 // { 56 auditable = false; 57 } 58 ); 59in 60 61rustPlatform.buildRustPackage.override { cargo-auditable = bootstrap; } ( 62 args 63 // { 64 nativeBuildInputs = [ 65 installShellFiles 66 ]; 67 68 postInstall = '' 69 installManPage cargo-auditable/cargo-auditable.1 70 ''; 71 72 passthru = { 73 inherit bootstrap; 74 }; 75 } 76)