2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2017-09-05 10:16:41 +01:00
|
|
|
, buildPythonPackage
|
2018-06-23 14:27:58 +01:00
|
|
|
, fetchPypi
|
2017-09-05 10:16:41 +01:00
|
|
|
, python
|
|
|
|
, zope_interface
|
|
|
|
, incremental
|
|
|
|
, automat
|
|
|
|
, constantly
|
|
|
|
, hyperlink
|
2018-07-23 10:22:37 +01:00
|
|
|
, pyhamcrest
|
|
|
|
, attrs
|
2017-09-05 10:16:41 +01:00
|
|
|
, pyopenssl
|
|
|
|
, service-identity
|
2019-09-14 04:51:56 +01:00
|
|
|
, setuptools
|
2017-09-05 10:16:41 +01:00
|
|
|
, idna
|
2017-04-26 13:45:04 +01:00
|
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
2017-05-27 10:25:35 +01:00
|
|
|
pname = "Twisted";
|
2020-03-23 19:11:34 +00:00
|
|
|
version = "20.3.0";
|
2017-04-26 13:45:04 +01:00
|
|
|
|
2018-06-23 14:27:58 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2018-06-29 22:20:08 +01:00
|
|
|
extension = "tar.bz2";
|
2020-03-23 19:11:34 +00:00
|
|
|
sha256 = "040yzha6cyshnn6ljgk2birgh6mh2cnra48xp5ina5vfsnsmab6p";
|
2017-04-26 13:45:04 +01:00
|
|
|
};
|
|
|
|
|
2019-09-14 04:51:56 +01:00
|
|
|
propagatedBuildInputs = [ zope_interface incremental automat constantly hyperlink pyhamcrest attrs setuptools ];
|
2017-04-26 13:45:04 +01:00
|
|
|
|
2017-09-05 10:16:41 +01:00
|
|
|
passthru.extras.tls = [ pyopenssl service-identity idna ];
|
|
|
|
|
2017-04-26 13:45:04 +01:00
|
|
|
# Patch t.p._inotify to point to libc. Without this,
|
|
|
|
# twisted.python.runtime.platform.supportsINotify() == False
|
2021-01-24 00:29:22 +00:00
|
|
|
patchPhase = lib.optionalString stdenv.isLinux ''
|
2017-04-26 13:45:04 +01:00
|
|
|
substituteInPlace src/twisted/python/_inotify.py --replace \
|
|
|
|
"ctypes.util.find_library('c')" "'${stdenv.glibc.out}/lib/libc.so.6'"
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Generate Twisted's plug-in cache. Twisted users must do it as well. See
|
|
|
|
# http://twistedmatrix.com/documents/current/core/howto/plugin.html#auto3
|
|
|
|
# and http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477103 for
|
|
|
|
# details.
|
2019-10-23 10:26:47 +01:00
|
|
|
postFixup = ''
|
|
|
|
$out/bin/twistd --help > /dev/null
|
|
|
|
'';
|
2017-04-26 13:45:04 +01:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} -m unittest discover -s twisted/test
|
|
|
|
'';
|
|
|
|
# Tests require network
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://twistedmatrix.com/";
|
2017-04-26 13:45:04 +01:00
|
|
|
description = "Twisted, an event-driven networking engine written in Python";
|
|
|
|
longDescription = ''
|
|
|
|
Twisted is an event-driven networking engine written in Python
|
|
|
|
and licensed under the MIT license.
|
|
|
|
'';
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ ];
|
|
|
|
};
|
|
|
|
}
|