nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, isPy27
6, pytestCheckHook
7, autoconf
8, automake
9, cmake
10, gcc
11, libtool
12, perl
13, simplejson
14}:
15
16buildPythonPackage rec {
17 pname = "awslambdaric";
18 version = "2.0.0";
19 disabled = isPy27;
20
21 src = fetchFromGitHub {
22 owner = "aws";
23 repo = "aws-lambda-python-runtime-interface-client";
24 rev = version;
25 sha256 = "1amlaq119mk8fa3fxi3d6vgp83vcd81mbk53jzbixacklmcsp50k";
26 };
27
28 patches = [
29 (fetchpatch {
30 # https://github.com/aws/aws-lambda-python-runtime-interface-client/pull/58
31 url = "https://github.com/aws/aws-lambda-python-runtime-interface-client/commit/162c3c0051bb9daa92e4a2a4af7e90aea60ee405.patch";
32 sha256 = "09qqq5x6npc9jw2qbhzifqn5sqiby4smiin1aw30psmlp21fv7j8";
33 })
34 ];
35
36 postPatch = ''
37 substituteInPlace requirements/base.txt \
38 --replace 'simplejson==3' 'simplejson~=3'
39 '';
40
41 propagatedBuildInputs = [ simplejson ];
42
43 nativeBuildInputs = [ autoconf automake cmake libtool perl ];
44
45 buildInputs = [ gcc ];
46
47 dontUseCmakeConfigure = true;
48
49 checkInputs = [ pytestCheckHook ];
50
51 pythonImportsCheck = [ "awslambdaric" "runtime_client" ];
52
53 meta = with lib; {
54 description = "AWS Lambda Runtime Interface Client for Python";
55 homepage = "https://github.com/aws/aws-lambda-python-runtime-interface-client";
56 license = licenses.asl20;
57 maintainers = with maintainers; [ austinbutler ];
58 platforms = platforms.linux;
59 };
60}