2017-09-05 10:16:41 +01:00
|
|
|
{ stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchurl
|
|
|
|
, python
|
|
|
|
, zope_interface
|
|
|
|
, incremental
|
|
|
|
, automat
|
|
|
|
, constantly
|
|
|
|
, hyperlink
|
|
|
|
, pyopenssl
|
|
|
|
, service-identity
|
|
|
|
, idna
|
2017-04-26 13:45:04 +01:00
|
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
2017-05-27 10:25:35 +01:00
|
|
|
pname = "Twisted";
|
|
|
|
name = "${pname}-${version}";
|
2017-08-15 09:02:16 +01:00
|
|
|
version = "17.5.0";
|
2017-04-26 13:45:04 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://pypi/T/Twisted/${name}.tar.bz2";
|
2017-08-15 09:02:16 +01:00
|
|
|
sha256 = "1sh2h23nnizcdyrl2rn7zxijglikxwz7z7grqpvq496zy2aa967i";
|
2017-04-26 13:45:04 +01:00
|
|
|
};
|
|
|
|
|
2017-08-15 09:02:16 +01:00
|
|
|
propagatedBuildInputs = [ zope_interface incremental automat constantly hyperlink ];
|
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
|
|
|
|
patchPhase = stdenv.lib.optionalString stdenv.isLinux ''
|
|
|
|
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.
|
|
|
|
postInstall = "$out/bin/twistd --help > /dev/null";
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} -m unittest discover -s twisted/test
|
|
|
|
'';
|
|
|
|
# Tests require network
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = http://twistedmatrix.com/;
|
|
|
|
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 = [ ];
|
|
|
|
};
|
|
|
|
}
|