59 lines
1.2 KiB
Nix
59 lines
1.2 KiB
Nix
|
{ lib
|
||
|
, rustPlatform
|
||
|
, fetchFromGitHub
|
||
|
, pkg-config
|
||
|
, bzip2
|
||
|
, xz
|
||
|
, zstd
|
||
|
, stdenv
|
||
|
, darwin
|
||
|
}:
|
||
|
|
||
|
rustPlatform.buildRustPackage rec {
|
||
|
pname = "cargo-binstall";
|
||
|
version = "0.20.1";
|
||
|
|
||
|
src = fetchFromGitHub {
|
||
|
owner = "cargo-bins";
|
||
|
repo = "cargo-binstall";
|
||
|
rev = "v${version}";
|
||
|
hash = "sha256-wM8DawrniyJxj8Omgj+hiePa521p4hIAngfzEHFNO58=";
|
||
|
};
|
||
|
|
||
|
cargoHash = "sha256-ZanPmdFMDGZhRHVVGt03OJWz8HnSYFdm42W6rpytu5Y=";
|
||
|
|
||
|
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"
|
||
|
];
|
||
|
|
||
|
# 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 ];
|
||
|
};
|
||
|
}
|