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.

74 lines
1.8 KiB
Nix
Raw Normal View History

2022-12-01 00:45:53 +00:00
{ lib
2023-04-05 11:57:26 +00:00
, cacert
, curl
2022-12-01 00:45:53 +00:00
, rustPlatform
, fetchFromGitHub
, makeWrapper
2023-04-05 11:57:26 +00:00
, pkg-config
, openssl
2022-12-01 00:45:53 +00:00
, stdenv
2023-04-05 11:57:26 +00:00
, CoreServices
2022-12-01 00:45:53 +00:00
, Security
, zig
}:
2022-10-30 03:43:44 +00:00
rustPlatform.buildRustPackage rec {
pname = "cargo-lambda";
2023-10-07 04:25:08 +00:00
version = "0.21.1";
2022-10-30 03:43:44 +00:00
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
2023-10-07 04:25:08 +00:00
hash = "sha256-QlTAYfd0taXfK370nzqictwK7bZ4bnh1oPBJKZzhnMo=";
2022-10-30 03:43:44 +00:00
};
2023-04-05 11:57:26 +00:00
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"cargo-test-macro-0.1.0" = "sha256-XvTKAbP/r1BthpEM84CYZ2yfJczxqzscGkN4JXLgvfA=";
};
};
nativeCheckInputs = [cacert];
2022-10-30 03:43:44 +00:00
2023-04-05 11:57:26 +00:00
nativeBuildInputs = [ makeWrapper pkg-config ];
2022-12-01 00:45:53 +00:00
2023-04-05 11:57:26 +00:00
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ curl CoreServices Security ];
2022-10-30 03:43:44 +00:00
2022-12-01 00:45:53 +00:00
checkFlags = [
2023-10-07 04:25:08 +00:00
# Disabled because they access the network.
2023-04-05 11:57:26 +00:00
"--skip=test_build_basic_extension"
"--skip=test_build_basic_function"
2023-10-07 04:25:08 +00: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 11:57:26 +00:00
"--skip=test_build_http_function"
2023-10-07 04:25:08 +00:00
"--skip=test_build_internal_zip_extension"
2023-04-05 11:57:26 +00:00
"--skip=test_build_logs_extension"
"--skip=test_build_telemetry_extension"
2022-12-01 00:45:53 +00:00
"--skip=test_download_example"
2023-04-05 11:57:26 +00:00
"--skip=test_init_subcommand"
"--skip=test_init_subcommand_without_override"
2022-12-01 00:45:53 +00:00
];
# remove date from version output to make reproducible
postPatch = ''
rm crates/cargo-lambda-cli/build.rs
'';
2022-10-30 03:43:44 +00:00
postInstall = ''
2023-04-05 11:57:26 +00:00
wrapProgram $out/bin/cargo-lambda --prefix PATH : ${lib.makeBinPath [ zig ]}
2022-10-30 03:43:44 +00:00
'';
2022-12-01 00:45:53 +00:00
CARGO_LAMBDA_BUILD_INFO = "(nixpkgs)";
2022-10-30 03:43:44 +00:00
meta = with lib; {
description = "A Cargo subcommand to help you work with AWS Lambda";
homepage = "https://cargo-lambda.info";
license = licenses.mit;
maintainers = with maintainers; [ taylor1791 calavera ];
2022-10-30 03:43:44 +00:00
};
}