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