about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/m2crypto/default.nix
blob: 7353831bad3925b24013aa478d3d86ee7fb5f546 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, openssl
, parameterized
, pytestCheckHook
, pythonOlder
, swig2
}:

buildPythonPackage rec {
  pname = "m2crypto";
  version = "0.40.1";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchPypi {
    pname = "M2Crypto";
    inherit version;
    hash = "sha256-u/0RPsVXCMBYFiUqTwnkI33087v8gXHLvDMFfSV7uzA=";
  };

  nativeBuildInputs = [
    swig2
    openssl
  ];

  buildInputs = [
    openssl
    parameterized
  ];

  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin (toString [
    "-Wno-error=implicit-function-declaration"
    "-Wno-error=incompatible-pointer-types"
  ]);

  nativeCheckInputs = [
    pytestCheckHook
  ];

  pythonImportsCheck = [
    "M2Crypto"
  ];

  meta = with lib; {
    description = "A Python crypto and SSL toolkit";
    homepage = "https://gitlab.com/m2crypto/m2crypto";
    changelog = "https://gitlab.com/m2crypto/m2crypto/-/blob/${version}/CHANGES";
    license = licenses.mit;
    maintainers = with maintainers; [ andrew-d ];
  };
}