nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at r-updates 59 lines 1.5 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 setuptools, 6 autobahn, 7 twisted, 8 python, 9 pytestCheckHook, 10}: 11 12buildPythonPackage (finalAttrs: { 13 pname = "magic-wormhole-transit-relay"; 14 version = "0.5.0"; 15 pyproject = true; 16 17 src = fetchFromGitHub { 18 owner = "magic-wormhole"; 19 repo = "magic-wormhole-transit-relay"; 20 tag = finalAttrs.version; 21 hash = "sha256-UhV0M8Nl9Y850PQcJoDyIvIPRyBS8gyF2Ub9qF3aq0U="; 22 }; 23 24 postPatch = '' 25 # Passing the environment to twistd is necessary to preserve Python's site path. 26 substituteInPlace src/wormhole_transit_relay/test/test_backpressure.py --replace-fail \ 27 'reactor.spawnProcess(proto, exe, args)' \ 28 'reactor.spawnProcess(proto, exe, args, None)' 29 ''; 30 31 build-system = [ setuptools ]; 32 33 dependencies = [ 34 autobahn 35 twisted 36 ]; 37 38 pythonImportsCheck = [ "wormhole_transit_relay" ]; 39 40 nativeCheckInputs = [ 41 pytestCheckHook 42 twisted 43 ]; 44 45 __darwinAllowLocalNetworking = true; 46 47 postCheck = '' 48 # Avoid collision with twisted's plugin cache (#164775). 49 rm "$out/${python.sitePackages}/twisted/plugins/dropin.cache" 50 ''; 51 52 meta = { 53 description = "Transit Relay server for Magic-Wormhole"; 54 homepage = "https://github.com/magic-wormhole/magic-wormhole-transit-relay"; 55 changelog = "https://github.com/magic-wormhole/magic-wormhole-transit-relay/blob/${finalAttrs.src.rev}/NEWS.md"; 56 license = lib.licenses.mit; 57 maintainers = [ lib.maintainers.mjoerg ]; 58 }; 59})