From 9caa413254bc780901d2272c3f09519c58e86f48 Mon Sep 17 00:00:00 2001 From: Justin Restivo Date: Fri, 29 Apr 2022 13:02:50 -0700 Subject: [PATCH] cargo-llvm-cov: init at 0.4.14 Co-authored-by: Justin Restivo Co-authored-by: FliegendeWurst <2012gdwu+github@posteo.de> Co-authored-by: Winter Signed-off-by: Matthias Beyer --- .../tools/rust/cargo-llvm-cov/default.nix | 36 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 37 insertions(+) create mode 100644 pkgs/development/tools/rust/cargo-llvm-cov/default.nix diff --git a/pkgs/development/tools/rust/cargo-llvm-cov/default.nix b/pkgs/development/tools/rust/cargo-llvm-cov/default.nix new file mode 100644 index 0000000000000..2ef8f643552fe --- /dev/null +++ b/pkgs/development/tools/rust/cargo-llvm-cov/default.nix @@ -0,0 +1,36 @@ +{ lib, rustPlatform, fetchCrate, fetchFromGitHub, libllvm, makeBinaryWrapper }: + +rustPlatform.buildRustPackage rec { + pname = "cargo-llvm-cov"; + version = "0.4.14"; + + src = fetchCrate { + inherit pname version; + sha256 = "sha256-DY5eBSx/PSmKaG7I6scDEbyZQ5hknA/pfl0KjTNqZlo="; + }; + + postPatch = '' + rm tests/test.rs + ''; + + nativeBuildInputs = [ makeBinaryWrapper ]; + buildInputs = [ libllvm ]; + + LLVM_COV = "${rustPlatform.rust.rustc.llvmPackages.llvm}/bin/llvm-cov"; + LLVM_PROFDATA = "${rustPlatform.rust.rustc.llvmPackages.llvm}/bin/llvm-profdata"; + + postInstall = '' + wrapProgram $out/bin/cargo-llvm-cov \ + --set LLVM_COV "${rustPlatform.rust.rustc.llvmPackages.llvm}/bin/llvm-cov" \ + --set LLVM_PROFDATA "${rustPlatform.rust.rustc.llvmPackages.llvm}/bin/llvm-profdata" + ''; + + cargoSha256 = "sha256-MGI1wV0QEZRxea6Q3fh2TJVPmI4eb9O6/DwpKkWrToE="; + + meta = with lib; { + description = "Cargo subcommand to gather source-based code coverage using LLVM"; + homepage = "https://github.com/taiki-e/cargo-llvm-cov"; + license = with licenses; [ mit asl20 ]; + maintainers = with maintainers; [ DieracDelta matthiasbeyer ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b5e2cd4d99570..b20b89e2b2700 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14251,6 +14251,7 @@ with pkgs; cargo-kcov = callPackage ../development/tools/rust/cargo-kcov { }; cargo-graph = callPackage ../development/tools/rust/cargo-graph { }; cargo-license = callPackage ../development/tools/rust/cargo-license { }; + cargo-llvm-cov = callPackage ../development/tools/rust/cargo-llvm-cov { }; cargo-llvm-lines = callPackage ../development/tools/rust/cargo-llvm-lines { }; cargo-outdated = callPackage ../development/tools/rust/cargo-outdated { inherit (darwin.apple_sdk.frameworks) Security SystemConfiguration;