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

74 lines
1.9 KiB
Nix

{ lib
, cacert
, curl
, rustPlatform
, fetchFromGitHub
, makeWrapper
, pkg-config
, openssl
, stdenv
, CoreServices
, Security
, zig
, nix-update-script
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-lambda";
version = "1.2.1";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
hash = "sha256-E9jUlEiHyf5UR/UZxJj9LTfyAxGR/WsvRQdFdIVvLG8=";
};
cargoHash = "sha256-IXMkgpyYwll8NwTXRffbsSP5uFHGJe1n2RQ1Mbu+E70=";
nativeCheckInputs = [cacert];
nativeBuildInputs = [ makeWrapper pkg-config ];
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ curl CoreServices Security ];
checkFlags = [
# Disabled because they access the network.
"--skip=test_build_basic_extension"
"--skip=test_build_basic_function"
"--skip=test_build_basic_zip_extension"
"--skip=test_build_basic_zip_function"
"--skip=test_build_event_type_function"
"--skip=test_build_http_feature_function"
"--skip=test_build_http_function"
"--skip=test_build_internal_zip_extension"
"--skip=test_build_logs_extension"
"--skip=test_build_telemetry_extension"
"--skip=test_download_example"
"--skip=test_init_subcommand"
"--skip=test_init_subcommand_without_override"
"--skip=test_build_example"
"--skip=test_deploy_workspace"
];
# remove date from version output to make reproducible
postPatch = ''
rm crates/cargo-lambda-cli/build.rs
'';
postInstall = ''
wrapProgram $out/bin/cargo-lambda --prefix PATH : ${lib.makeBinPath [ zig ]}
'';
CARGO_LAMBDA_BUILD_INFO = "(nixpkgs)";
passthru.updateScript = nix-update-script { };
meta = with lib; {
description = "Cargo subcommand to help you work with AWS Lambda";
mainProgram = "cargo-lambda";
homepage = "https://cargo-lambda.info";
license = licenses.mit;
maintainers = with maintainers; [ taylor1791 calavera ];
};
}