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

77 lines
1.6 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, installShellFiles
, bzip2
, openssl
, xz
, zstd
, stdenv
, darwin
, testers
, espup
}:
rustPlatform.buildRustPackage rec {
pname = "espup";
version = "0.12.0";
src = fetchFromGitHub {
owner = "esp-rs";
repo = "espup";
rev = "v${version}";
hash = "sha256-ofC9pBKZEKGNNirshhfcCkzWN4CvD7IfArZaikkfnmI=";
};
cargoHash = "sha256-fM1If/RnPzLDYjUImNkMViWkjXBc5YRIJHthypcJfmc=";
nativeBuildInputs = [
pkg-config
installShellFiles
];
buildInputs = [
bzip2
openssl
xz
zstd
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.CoreFoundation
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.SystemConfiguration
];
env = {
OPENSSL_NO_VENDOR = true;
ZSTD_SYS_USE_PKG_CONFIG = true;
};
preCheck = ''
export HOME=$(mktemp -d)
'';
checkFlags = [
# makes network calls
"--skip=toolchain::rust::tests::test_xtensa_rust_parse_version"
];
postInstall = ''
installShellCompletion --cmd espup \
--bash <($out/bin/espup completions bash) \
--fish <($out/bin/espup completions fish) \
--zsh <($out/bin/espup completions zsh)
'';
passthru.tests.version = testers.testVersion {
package = espup;
};
meta = with lib; {
description = "Tool for installing and maintaining Espressif Rust ecosystem";
homepage = "https://github.com/esp-rs/espup/";
license = with licenses; [ mit asl20 ];
maintainers = with maintainers; [ knightpp beeb ];
mainProgram = "espup";
};
}