summary refs log tree commit diff
path: root/pkgs/development/python-modules/twisted
diff options
context:
space:
mode:
authorLancelot SIX <lsix@lancelotsix.com>2017-04-26 14:45:04 +0200
committerLancelot SIX <lsix@lancelotsix.com>2017-05-02 09:28:34 +0200
commit528a4520430dceb34a510377e36bd2fca4a7fc35 (patch)
tree8a986bc65089c4caa64ee30d3d8940e8b7c4c4c1 /pkgs/development/python-modules/twisted
parentd965c8e6e98be22b01ba2e1716093d989651e57f (diff)
downloadnixpkgs-528a4520430dceb34a510377e36bd2fca4a7fc35.tar
nixpkgs-528a4520430dceb34a510377e36bd2fca4a7fc35.tar.gz
nixpkgs-528a4520430dceb34a510377e36bd2fca4a7fc35.tar.bz2
nixpkgs-528a4520430dceb34a510377e36bd2fca4a7fc35.tar.lz
nixpkgs-528a4520430dceb34a510377e36bd2fca4a7fc35.tar.xz
nixpkgs-528a4520430dceb34a510377e36bd2fca4a7fc35.tar.zst
nixpkgs-528a4520430dceb34a510377e36bd2fca4a7fc35.zip
pythonPackages.twisted: 16.4.1 -> 17.1.0
Diffstat (limited to 'pkgs/development/python-modules/twisted')
-rw-r--r--pkgs/development/python-modules/twisted/default.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/twisted/default.nix b/pkgs/development/python-modules/twisted/default.nix
new file mode 100644
index 00000000000..0cfb00c48b8
--- /dev/null
+++ b/pkgs/development/python-modules/twisted/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, buildPythonPackage, fetchurl, python,
+  zope_interface, incremental, automat, constantly
+}:
+buildPythonPackage rec {
+
+  name = "Twisted-${version}";
+  version = "17.1.0";
+
+  src = fetchurl {
+    url = "mirror://pypi/T/Twisted/${name}.tar.bz2";
+    sha256 = "1p245mg15hkxp7hy5cyq2fgvlgjkb4cg0gwkwd148nzy1bbi3wnv";
+  };
+
+  propagatedBuildInputs = [ zope_interface incremental automat constantly ];
+
+  # 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 = [ ];
+  };
+}