depot/third_party/nixpkgs/pkgs/development/tools/rust/cargo-dist/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

64 lines
1.3 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, nix-update-script
, pkg-config
, bzip2
, xz
, zstd
, stdenv
, darwin
, git
, rustup
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-dist";
version = "0.15.0";
src = fetchFromGitHub {
owner = "axodotdev";
repo = "cargo-dist";
rev = "v${version}";
hash = "sha256-p8acrP09/m3pdw24j8KUoZnqWMt2KwhVro9kNIABngw=";
};
cargoHash = "sha256-ecGtY6IpAiFjcN/E43STsEjbHXqSC4Vo6z3mH01rTI4=";
nativeBuildInputs = [
pkg-config
];
buildInputs = [
bzip2
xz
zstd
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.SystemConfiguration
];
nativeCheckInputs = [
git
rustup
];
env = {
ZSTD_SYS_USE_PKG_CONFIG = true;
};
# remove tests that require internet access
postPatch = ''
rm cargo-dist/tests/integration-tests.rs
'';
passthru.updateScript = nix-update-script { };
meta = with lib; {
description = "Tool for building final distributable artifacts and uploading them to an archive";
mainProgram = "cargo-dist";
homepage = "https://github.com/axodotdev/cargo-dist";
changelog = "https://github.com/axodotdev/cargo-dist/blob/${src.rev}/CHANGELOG.md";
license = with licenses; [ asl20 mit ];
maintainers = with maintainers; [ figsoda matthiasbeyer mistydemeo ];
};
}