1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 cmake,
6 perl,
7 stdenv,
8 gcc10,
9 CoreFoundation,
10 Security,
11 pythonOlder,
12}:
13
14buildPythonPackage rec {
15 pname = "awscrt";
16 version = "0.21.2";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchPypi {
22 inherit pname version;
23 hash = "sha256-N6zijQ16kfkIYt0plIcqFZYre08TduC3sBqCGVRhFQc=";
24 };
25
26 buildInputs = lib.optionals stdenv.isDarwin [
27 CoreFoundation
28 Security
29 ];
30
31 # gcc <10 is not supported, LLVM on darwin is just fine
32 nativeBuildInputs =
33 [ cmake ]
34 ++ lib.optionals (!stdenv.isDarwin && stdenv.isAarch64) [
35 gcc10
36 perl
37 ];
38
39 dontUseCmakeConfigure = true;
40
41 pythonImportsCheck = [ "awscrt" ];
42
43 # Unable to import test module
44 # https://github.com/awslabs/aws-crt-python/issues/281
45 doCheck = false;
46
47 meta = with lib; {
48 homepage = "https://github.com/awslabs/aws-crt-python";
49 changelog = "https://github.com/awslabs/aws-crt-python/releases/tag/v${version}";
50 description = "Python bindings for the AWS Common Runtime";
51 license = licenses.asl20;
52 maintainers = with maintainers; [ davegallant ];
53 };
54}