nixpkgs/pkgs/development/tools/rust/cargo-lambda/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
1.9 KiB
Nix
Raw Permalink Normal View History

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