2019-05-07 13:53:23 +01:00
|
|
|
{ lib
|
2019-09-02 03:53:50 +01:00
|
|
|
, stdenv
|
2019-05-07 13:53:23 +01:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pyopenssl
|
|
|
|
, libuv
|
|
|
|
, psutil
|
|
|
|
, isPy27
|
2019-09-02 03:53:50 +01:00
|
|
|
, CoreServices
|
|
|
|
, ApplicationServices
|
2019-05-07 13:53:23 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "uvloop";
|
2019-09-02 03:53:50 +01:00
|
|
|
version = "0.13.0";
|
2019-05-07 13:53:23 +01:00
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-09-02 03:53:50 +01:00
|
|
|
sha256 = "0blcnrd5vky2k1m1p1skx4516dr1jx76yyb0c6fi82si6mqd0b4l";
|
2019-05-07 13:53:23 +01:00
|
|
|
};
|
|
|
|
|
2019-09-13 22:11:56 +01:00
|
|
|
patches = lib.optional stdenv.isDarwin ./darwin_sandbox.patch;
|
|
|
|
|
2019-09-02 03:53:50 +01:00
|
|
|
buildInputs = [
|
|
|
|
libuv
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [ CoreServices ApplicationServices ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Removing code linting tests, which we don't care about
|
|
|
|
rm tests/test_sourcecode.py
|
|
|
|
'';
|
2019-05-07 13:53:23 +01:00
|
|
|
|
|
|
|
checkInputs = [ pyopenssl psutil ];
|
|
|
|
|
2019-09-13 22:11:56 +01:00
|
|
|
# Some of the tests use localhost networking.
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2019-05-07 13:53:23 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Fast implementation of asyncio event loop on top of libuv";
|
|
|
|
homepage = http://github.com/MagicStack/uvloop;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
}
|