about summary refs log tree commit diff
path: root/pkgs/by-name/ca/castero/package.nix
blob: 0b9f727dda92164cfefa8bcec6d97604d487c1e8 (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
{ lib
, fetchFromGitHub
, python3
}:

python3.pkgs.buildPythonApplication rec {
  pname = "castero";
  version = "0.9.5";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "xgi";
    repo = "castero";
    rev = "v${version}";
    hash = "sha256-6/7oCKBMEcQeJ8PaFP15Xef9sQRYCpigtzINv2M6GUY=";
  };

  build-system = with python3.pkgs; [
    wheel
  ];

  propagatedBuildInputs = with python3.pkgs; [
    requests
    grequests
    cjkwrap
    pytz
    beautifulsoup4
    lxml
    mpv
    python-vlc
  ] ++ requests.optional-dependencies.socks;

  nativeCheckInputs = with python3.pkgs; [
    pytestCheckHook
  ];

  pytestFlagsArray = [
    "tests"
  ];

  disabledTests = [ "test_datafile_download" ];

  pythonImportCheck = [
    "castero"
  ];

  # Resolve configuration tests, which access $HOME
  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  # Satisfy the python-mpv depedency, which is mpv within NixOS
  postPatch = ''
    substituteInPlace setup.py --replace-fail "python-mpv" "mpv"
  '';

  # VLC currently doesn't support Darwin on NixOS
  meta = with lib; {
    mainProgram = "castero";
    description = "TUI podcast client for the terminal";
    homepage = "https://github.com/xgi/castero";
    license = licenses.mit;
    platforms = platforms.linux;
    maintainers = with maintainers; [ keto ];
  };
}