1{ lib
2, rustPlatform
3, fetchFromGitHub
4, pkg-config
5, bzip2
6, xz
7, zstd
8, stdenv
9, darwin
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "cargo-binstall";
14 version = "1.6.9";
15
16 src = fetchFromGitHub {
17 owner = "cargo-bins";
18 repo = "cargo-binstall";
19 rev = "v${version}";
20 hash = "sha256-gByMCbh/RswZFrGY176PcZbBeHRsD0mv8Om4xQ/1wTo=";
21 };
22
23 cargoHash = "sha256-GPDDKFM2dxsjQcrNK7y2lydnqGnFBUMcDJZ420jmzlo=";
24
25 nativeBuildInputs = [
26 pkg-config
27 ];
28
29 buildInputs = [
30 bzip2
31 xz
32 zstd
33 ] ++ lib.optionals stdenv.isDarwin [
34 darwin.apple_sdk.frameworks.SystemConfiguration
35 ];
36
37 buildNoDefaultFeatures = true;
38 buildFeatures = [
39 "fancy-no-backtrace"
40 "git"
41 "pkg-config"
42 "rustls"
43 "trust-dns"
44 "zstd-thin"
45 ];
46
47 cargoBuildFlags = [ "-p" "cargo-binstall" ];
48 cargoTestFlags = [ "-p" "cargo-binstall" ];
49
50 checkFlags = [
51 # requires internet access
52 "--skip=download::test::test_and_extract"
53 "--skip=gh_api_client::test::test_gh_api_client_cargo_binstall_no_such_release"
54 "--skip=gh_api_client::test::test_gh_api_client_cargo_binstall_v0_20_1"
55 ];
56
57 meta = with lib; {
58 description = "Tool for installing rust binaries as an alternative to building from source";
59 mainProgram = "cargo-binstall";
60 homepage = "https://github.com/cargo-bins/cargo-binstall";
61 changelog = "https://github.com/cargo-bins/cargo-binstall/releases/tag/v${version}";
62 license = licenses.gpl3Only;
63 maintainers = with maintainers; [ figsoda ];
64 };
65}