depot/third_party/nixpkgs/pkgs/development/tools/rust/cargo-binstall/default.nix
Default email eaf6957cd3 Project import generated by Copybara.
GitOrigin-RevId: 4bb072f0a8b267613c127684e099a70e1f6ff106
2023-03-27 12:17:25 -07:00

68 lines
1.6 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, bzip2
, xz
, zstd
, stdenv
, darwin
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-binstall";
version = "0.22.0";
src = fetchFromGitHub {
owner = "cargo-bins";
repo = "cargo-binstall";
rev = "v${version}";
hash = "sha256-jY5mIbrcX2B0D6ezi1k0mcRAmrSPIoebJFHn3lZ2t9w=";
};
cargoHash = "sha256-+O/+zsiG0wyNKp/2TP5I8EPMf6YPT8VtCD4BXI76J7Q=";
nativeBuildInputs = [
pkg-config
];
buildInputs = [
bzip2
xz
zstd
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
buildNoDefaultFeatures = true;
buildFeatures = [
"fancy-no-backtrace"
"pkg-config"
"rustls"
"trust-dns"
"zstd-thin"
];
cargoBuildFlags = [ "-p" "cargo-binstall" ];
cargoTestFlags = [ "-p" "cargo-binstall" ];
checkFlags = [
# requires internet access
"--skip=download::test::test_and_extract"
"--skip=gh_api_client::test::test_gh_api_client_cargo_binstall_no_such_release"
"--skip=gh_api_client::test::test_gh_api_client_cargo_binstall_v0_20_1"
];
# remove cargo config so it can find the linker on aarch64-unknown-linux-gnu
postPatch = ''
rm .cargo/config
'';
meta = with lib; {
description = "A tool for installing rust binaries as an alternative to building from source";
homepage = "https://github.com/cargo-bins/cargo-binstall";
changelog = "https://github.com/cargo-bins/cargo-binstall/releases/tag/v${version}";
license = licenses.gpl3Only;
maintainers = with maintainers; [ figsoda ];
};
}