1{ lib, fetchPypi, buildPythonPackage, pythonOlder, routerFeatures 2, janus, ncclient, paramiko, pyyaml, sanic }: 3 4let 5 # The `routerFeatures` flag optionally brings in some somewhat heavy 6 # dependencies, in order to enable interacting with routers 7 opts = if routerFeatures then { 8 prePatch = '' 9 substituteInPlace ./setup.py --replace "extra_deps = []" "extra_deps = router_feature_deps" 10 ''; 11 extraBuildInputs = [ janus ncclient paramiko ]; 12 } else { 13 prePatch = ""; 14 extraBuildInputs = []; 15 }; 16 17in 18 19buildPythonPackage rec { 20 pname = "entrance"; 21 version = "1.1.17"; 22 23 src = fetchPypi { 24 inherit pname version; 25 sha256 = "dee5b4f3330f633fcd4e665f1781bf6e53b375ffdc7a24434257dfba6b1c2d7f"; 26 }; 27 28 # The versions of `sanic` and `websockets` in nixpkgs only support 3.6 or later 29 disabled = pythonOlder "3.6"; 30 31 # No useful tests 32 doCheck = false; 33 34 propagatedBuildInputs = [ pyyaml sanic ] ++ opts.extraBuildInputs; 35 36 prePatch = opts.prePatch; 37 38 meta = with lib; { 39 description = "A server framework for web apps with an Elm frontend"; 40 homepage = "https://github.com/ensoft/entrance"; 41 license = licenses.mit; 42 maintainers = with maintainers; [ simonchatts ]; 43 }; 44} 45