1{
2 lib,
3 fetchFromGitHub,
4 replaceVars,
5 buildPythonPackage,
6 isPy3k,
7 gnutls,
8 twisted,
9 pyopenssl,
10 service-identity,
11 setuptools,
12}:
13
14buildPythonPackage rec {
15 pname = "python3-gnutls";
16 version = "3.1.10";
17 pyproject = true;
18
19 disabled = !isPy3k;
20
21 src = fetchFromGitHub {
22 owner = "AGProjects";
23 repo = "python3-gnutls";
24 tag = "release-${version}";
25 hash = "sha256-AdFRF3ZlkkAoSm5rvf/09FSYIo7SsZ38sD2joOLyukA=";
26 };
27
28 nativeBuildInputs = [ setuptools ];
29
30 propagatedBuildInputs = [
31 twisted
32 pyopenssl
33 service-identity
34 ];
35
36 patches = [
37 (replaceVars ./libgnutls-path.patch {
38 gnutlslib = "${lib.getLib gnutls}/lib";
39 })
40 ];
41
42 pythonImportsCheck = [ "gnutls" ];
43
44 meta = with lib; {
45 description = "Python wrapper for the GnuTLS library";
46 homepage = "https://github.com/AGProjects/python3-gnutls";
47 license = licenses.lgpl21Plus;
48 maintainers = with maintainers; [ chanley ];
49 longDescription = ''
50 This package provides a high level object oriented wrapper around libgnutls,
51 as well as low level bindings to the GnuTLS types and functions via ctypes.
52 The high level wrapper hides the details of accessing the GnuTLS library via
53 ctypes behind a set of classes that encapsulate GnuTLS sessions, certificates
54 and credentials and expose them to python applications using a simple API.
55
56 The package also includes a Twisted interface that has seamless intergration
57 with Twisted, providing connectTLS and listenTLS methods on the Twisted
58 reactor once imported (the methods are automatically attached to the reactor
59 by simply importing the GnuTLS Twisted interface module).
60
61 The high level wrapper is written using the GnuTLS library bindings that are
62 made available via ctypes. This makes the wrapper very powerful and flexible
63 as it has direct access to all the GnuTLS internals and is also very easy to
64 extend without any need to write C code or recompile anything.
65
66 '';
67 };
68}