Loading pkgs/development/tools/rust/cargo-llvm-cov/default.nix +47 −24 Original line number Diff line number Diff line { stdenv , lib , fetchCrate , fetchurl , fetchFromGitHub , rustPlatform , rustc }: rustPlatform.buildRustPackage rec { let pname = "cargo-llvm-cov"; version = "0.5.31"; src = fetchCrate { owner = "taiki-e"; homepage = "https://github.com/${owner}/${pname}"; llvm = rustc.llvmPackages.llvm; # Download `Cargo.lock` from crates.io so we don't clutter up Nixpkgs cargoLock = fetchurl { name = "Cargo.lock"; url = "https://crates.io/api/v1/crates/${pname}/${version}/download"; sha256 = "sha256-BbrdyJgZSIz6GaTdQv1GiFHufRBSbcoHcqqEmr/HvAM="; downloadToTemp = true; postFetch = '' tar xzf $downloadedFile ${pname}-${version}/Cargo.lock mv ${pname}-${version}/Cargo.lock $out ''; }; in rustPlatform.buildRustPackage { inherit pname version; sha256 = "sha256-HjnP9H1t660PJ5eXzgAhrdDEgqdzzb+9Dbk5RGUPjaQ="; # Use `fetchFromGitHub` instead of `fetchCrate` because the latter does not # pull in fixtures needed for the test suite src = fetchFromGitHub { inherit owner; repo = pname; rev = "v${version}"; sha256 = "sha256-wRo94JVn4InkhrMHFSsEvm2FFIxUsltA57sMMOcL8b0="; }; cargoSha256 = "sha256-p6zpRRNX4g+jESNSwouWMjZlFhTBFJhe7LirYtFrZ1g="; # skip tests which require llvm-tools-preview checkFlags = [ "--skip bin_crate" "--skip cargo_config" "--skip clean_ws" "--skip instantiations" "--skip merge" "--skip merge_failure_mode_all" "--skip no_test" "--skip open_report" "--skip real1" "--skip show_env" "--skip virtual1" ]; meta = rec { homepage = "https://github.com/taiki-e/${pname}"; # Upstream doesn't include the lockfile so we need to add it back postUnpack = '' cp ${cargoLock} source/Cargo.lock ''; cargoSha256 = "sha256-XcsognndhHenYnlJCNMbrNh+S8FX7qxXUjuV1j2qsmY="; # `cargo-llvm-cov` reads these environment variables to find these binaries, # which are needed to run the tests LLVM_COV = "${llvm}/bin/llvm-cov"; LLVM_PROFDATA = "${llvm}/bin/llvm-profdata"; meta = { inherit homepage; changelog = homepage + "/blob/v${version}/CHANGELOG.md"; description = "Cargo subcommand to easily use LLVM source-based code coverage"; longDescription = '' Loading Loading
pkgs/development/tools/rust/cargo-llvm-cov/default.nix +47 −24 Original line number Diff line number Diff line { stdenv , lib , fetchCrate , fetchurl , fetchFromGitHub , rustPlatform , rustc }: rustPlatform.buildRustPackage rec { let pname = "cargo-llvm-cov"; version = "0.5.31"; src = fetchCrate { owner = "taiki-e"; homepage = "https://github.com/${owner}/${pname}"; llvm = rustc.llvmPackages.llvm; # Download `Cargo.lock` from crates.io so we don't clutter up Nixpkgs cargoLock = fetchurl { name = "Cargo.lock"; url = "https://crates.io/api/v1/crates/${pname}/${version}/download"; sha256 = "sha256-BbrdyJgZSIz6GaTdQv1GiFHufRBSbcoHcqqEmr/HvAM="; downloadToTemp = true; postFetch = '' tar xzf $downloadedFile ${pname}-${version}/Cargo.lock mv ${pname}-${version}/Cargo.lock $out ''; }; in rustPlatform.buildRustPackage { inherit pname version; sha256 = "sha256-HjnP9H1t660PJ5eXzgAhrdDEgqdzzb+9Dbk5RGUPjaQ="; # Use `fetchFromGitHub` instead of `fetchCrate` because the latter does not # pull in fixtures needed for the test suite src = fetchFromGitHub { inherit owner; repo = pname; rev = "v${version}"; sha256 = "sha256-wRo94JVn4InkhrMHFSsEvm2FFIxUsltA57sMMOcL8b0="; }; cargoSha256 = "sha256-p6zpRRNX4g+jESNSwouWMjZlFhTBFJhe7LirYtFrZ1g="; # skip tests which require llvm-tools-preview checkFlags = [ "--skip bin_crate" "--skip cargo_config" "--skip clean_ws" "--skip instantiations" "--skip merge" "--skip merge_failure_mode_all" "--skip no_test" "--skip open_report" "--skip real1" "--skip show_env" "--skip virtual1" ]; meta = rec { homepage = "https://github.com/taiki-e/${pname}"; # Upstream doesn't include the lockfile so we need to add it back postUnpack = '' cp ${cargoLock} source/Cargo.lock ''; cargoSha256 = "sha256-XcsognndhHenYnlJCNMbrNh+S8FX7qxXUjuV1j2qsmY="; # `cargo-llvm-cov` reads these environment variables to find these binaries, # which are needed to run the tests LLVM_COV = "${llvm}/bin/llvm-cov"; LLVM_PROFDATA = "${llvm}/bin/llvm-profdata"; meta = { inherit homepage; changelog = homepage + "/blob/v${version}/CHANGELOG.md"; description = "Cargo subcommand to easily use LLVM source-based code coverage"; longDescription = '' Loading