summary refs log tree commit diff
path: root/pkgs/applications/networking/flexget/default.nix
blob: 585e0c847da295e2aaa5259a8ea69dbc9c0e96a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{ lib
, fetchFromGitHub
, python
, transmission
, deluge
, config
}:

with python.pkgs;

buildPythonApplication rec {
  version = "2.10.82";
  name = "FlexGet-${version}";

  src = fetchFromGitHub {
    owner = "Flexget";
    repo = "Flexget";
    rev = version;
    sha256 = "15508ihswfjbkzhf1f0qhn2ar1aiibz2ggp5d6r33icy8xwhpv09";
  };

  doCheck = true;
  # test_regexp requires that HOME exist, test_filesystem requires a
  # unicode-capable filesystem (and setting LC_ALL doesn't work).
  # setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
  postPatch = ''
    substituteInPlace requirements.txt \
      --replace "chardet==3.0.3" "chardet" \
      --replace "rebulk==0.8.2" "rebulk" \
      --replace "cherrypy==10.2.2" "cherrypy" \
      --replace "portend==1.8" "portend" \
      --replace "sqlalchemy==1.1.10" "sqlalchemy" \
      --replace "zxcvbn-python==4.4.15" "zxcvbn-python" \
      --replace "flask-cors==3.0.2" "flask-cors" \
      --replace "certifi==2017.4.17" "certifi" \
      --replace "apscheduler==3.3.1" "apscheduler" \
      --replace "path.py==10.3.1" "path.py" \
      --replace "tempora==1.8" "tempora" \
      --replace "cheroot==5.5.0" "cheroot" \
      --replace "six==1.10.0" "six" \
      --replace "aniso8601==1.2.1" "aniso8601"
  '';

  checkPhase = ''
    export HOME=.
    py.test --disable-pytest-warnings -k "not test_quality_failures \
                                          and not test_group_quality \
                                          and not crash_report \
                                          and not test_multi_episode \
                                          and not test_double_episodes \
                                          and not test_inject_force \
                                          and not test_double_prefered \
                                          and not test_double \
                                          and not test_non_ascii"
  '';

  buildInputs = [ pytest mock vcrpy pytest-catchlog boto3 ];
  propagatedBuildInputs = [
    feedparser sqlalchemy pyyaml chardet
    beautifulsoup4 html5lib PyRSS2Gen pynzb
    rpyc jinja2 jsonschema requests dateutil jsonschema
    pathpy guessit_2_0 APScheduler
    terminaltables colorclass
    cherrypy flask flask-restful flask-restplus
    flask-compress flask_login flask-cors
    pyparsing safe future zxcvbn-python
    werkzeug tempora cheroot rebulk portend
  ] ++ lib.optional (pythonOlder "3.4") pathlib
    # enable deluge and transmission plugin support, if they're installed
    ++ lib.optional (config.deluge or false) deluge
    ++ lib.optional (transmission != null) transmissionrpc;

  meta = {
    homepage = https://flexget.com/;
    description = "Multipurpose automation tool for content like torrents";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ domenkozar tari ];
    broken = true; # as of 2018-02-09
  };
}