diff options
Diffstat (limited to 'nixpkgs/pkgs/development/tools/rust/cargo-dist/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/tools/rust/cargo-dist/default.nix | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-dist/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-dist/default.nix new file mode 100644 index 000000000000..47e62a2c366b --- /dev/null +++ b/nixpkgs/pkgs/development/tools/rust/cargo-dist/default.nix @@ -0,0 +1,61 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, pkg-config +, bzip2 +, xz +, zstd +, stdenv +, darwin +, git +, rustup +}: + +rustPlatform.buildRustPackage rec { + pname = "cargo-dist"; + version = "0.2.0"; + + src = fetchFromGitHub { + owner = "axodotdev"; + repo = "cargo-dist"; + rev = "v${version}"; + hash = "sha256-uHkmwmEVV3+VPvp5WIc+PbwYvhYZHStiMun1yguPelw="; + }; + + cargoHash = "sha256-8bgb8CCkoqECyd9CW2OkPQmhqfiIOuelsXhOcm1d9kQ="; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + bzip2 + xz + zstd + ] ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.Security + ]; + + nativeCheckInputs = [ + git + ] ++ lib.optionals stdenv.isDarwin [ + rustup + ]; + + env = { + ZSTD_SYS_USE_PKG_CONFIG = true; + }; + + # remove tests that require internet access + postPatch = '' + rm cargo-dist/tests/integration-tests.rs + ''; + + meta = with lib; { + description = "A tool for building final distributable artifacts and uploading them to an archive"; + 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 ]; + }; +} |