about summary refs log tree commit diff
path: root/pkgs/applications/video/catt/default.nix
blob: f6bdde3577be6719e374d380432bc695b2728ec9 (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
{ lib
, fetchPypi
, fetchpatch
, python3
}:

let
  python = python3.override {
    self = python;
    packageOverrides = self: super: {
      pychromecast = super.pychromecast.overridePythonAttrs (_: rec {
        version = "13.1.0";

        src = fetchPypi {
          pname = "PyChromecast";
          inherit version;
          hash = "sha256-COYai1S9IRnTyasewBNtPYVjqpfgo7V4QViLm+YMJnY=";
        };

        postPatch = "";
      });
    };
  };
in

python.pkgs.buildPythonApplication rec {
  pname = "catt";
  version = "0.12.11";
  format = "pyproject";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-0bqYYfWwF7yYoAbjZPhi/f4CLcL89imWGYaMi5Bwhtc=";
  };

  patches = [
    (fetchpatch {
      # set explicit build-system
      url = "https://github.com/skorokithakis/catt/commit/08e7870a239e85badd30982556adc2aa8a8e4fc1.patch";
      hash = "sha256-QH5uN3zQNVPP6Th2LHdDBF53WxwMhoyhhQUAZOeHh4k=";
    })
  ];

  nativeBuildInputs = with python.pkgs; [
    poetry-core
  ];

  propagatedBuildInputs = with python.pkgs; [
    click
    ifaddr
    pychromecast
    protobuf
    requests
    yt-dlp
  ];

  doCheck = false; # attempts to access various URLs

  pythonImportsCheck = [
    "catt"
  ];

  meta = with lib; {
    description = "Tool to send media from online sources to Chromecast devices";
    homepage = "https://github.com/skorokithakis/catt";
    license = licenses.bsd2;
    maintainers = [ ];
    mainProgram = "catt";
  };
}