2022-12-02 08:20:57 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, stdenv
|
|
|
|
, Security
|
|
|
|
, cargo-watch
|
|
|
|
, zig
|
|
|
|
}:
|
2022-11-02 22:02:43 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-lambda";
|
2022-12-02 08:20:57 +00:00
|
|
|
version = "0.13.0";
|
2022-11-02 22:02:43 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-12-02 08:20:57 +00:00
|
|
|
sha256 = "sha256-JwrTwCn4qXcjXjy4cPYM3WCblJS0J5Xxnc6WESMwCpU=";
|
2022-11-02 22:02:43 +00:00
|
|
|
};
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
cargoSha256 = "sha256-p3q5S6IFQQgNp/MHGSUE1DVLFyMLWDTv/dxrUACKSWo=";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2022-11-02 22:02:43 +00:00
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
checkFlags = [
|
|
|
|
# Disabled because it accesses the network.
|
|
|
|
"--skip=test_download_example"
|
|
|
|
];
|
|
|
|
|
|
|
|
# remove date from version output to make reproducible
|
|
|
|
postPatch = ''
|
|
|
|
rm crates/cargo-lambda-cli/build.rs
|
|
|
|
'';
|
2022-11-02 22:02:43 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/cargo-lambda --prefix PATH : ${lib.makeBinPath [ cargo-watch zig ]}
|
|
|
|
'';
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
CARGO_LAMBDA_BUILD_INFO = "(nixpkgs)";
|
2022-11-02 22:02:43 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A Cargo subcommand to help you work with AWS Lambda";
|
|
|
|
homepage = "https://cargo-lambda.info";
|
|
|
|
license = licenses.mit;
|
2022-11-04 12:27:35 +00:00
|
|
|
maintainers = with maintainers; [ taylor1791 calavera ];
|
2022-11-02 22:02:43 +00:00
|
|
|
};
|
|
|
|
}
|