2023-02-16 17:41:37 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, bzip2
|
|
|
|
, xz
|
|
|
|
, zstd
|
|
|
|
, stdenv
|
|
|
|
, darwin
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-binstall";
|
2023-03-27 19:17:25 +00:00
|
|
|
version = "0.22.0";
|
2023-02-16 17:41:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cargo-bins";
|
|
|
|
repo = "cargo-binstall";
|
|
|
|
rev = "v${version}";
|
2023-03-27 19:17:25 +00:00
|
|
|
hash = "sha256-jY5mIbrcX2B0D6ezi1k0mcRAmrSPIoebJFHn3lZ2t9w=";
|
2023-02-16 17:41:37 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
cargoHash = "sha256-+O/+zsiG0wyNKp/2TP5I8EPMf6YPT8VtCD4BXI76J7Q=";
|
2023-02-16 17:41:37 +00:00
|
|
|
|
|
|
|
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"
|
|
|
|
];
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
cargoBuildFlags = [ "-p" "cargo-binstall" ];
|
|
|
|
cargoTestFlags = [ "-p" "cargo-binstall" ];
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
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"
|
|
|
|
];
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
# 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 ];
|
|
|
|
};
|
|
|
|
}
|