summary refs log tree commit diff
path: root/pkgs/development/python-modules/m2crypto/default.nix
blob: c0e91542d38a2a9f30b6dec67757f5bf8faff7e2 (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
{ stdenv
, fetchpatch
, buildPythonPackage
, fetchPypi
, swig2
, openssl
, typing
}:


buildPythonPackage rec {
  version = "0.30.1";
  pname = "M2Crypto";

  src = fetchPypi {
    inherit pname version;
    sha256 = "a1b2751cdadc6afac3df8a5799676b7b7c67a6ad144bb62d38563062e7cd3fc6";
  };

  patches = [
    (fetchpatch {
      url = "https://github.com/void-linux/void-packages/raw/7946d12eb3d815e5ecd4578f1a6133d948694370/srcpkgs/python-M2Crypto/patches/libressl.patch";
      sha256 = "0z5qnkndg6ma5f5qqrid5m95i9kybsr000v3fdy1ab562kf65a27";
    })
  ];
  patchFlags = "-p0";

  nativeBuildInputs = [ swig2 ];
  buildInputs = [ swig2 openssl ];

  propagatedBuildInputs = [ typing ];

  preConfigure = ''
    substituteInPlace setup.py --replace "self.openssl = '/usr'" "self.openssl = '${openssl.dev}'"
  '';

  doCheck = false; # another test that depends on the network.

  meta = with stdenv.lib; {
    description = "A Python crypto and SSL toolkit";
    homepage = http://chandlerproject.org/Projects/MeTooCrypto;
    license = licenses.mit;
    maintainers = with maintainers; [ andrew-d ];
  };

}