1{ lib
2, buildPythonPackage
3, casttube
4, fetchPypi
5, isPy3k
6, protobuf
7, requests
8, zeroconf
9}:
10
11buildPythonPackage rec {
12 pname = "pychromecast";
13 version = "12.1.4";
14 format = "setuptools";
15
16 disabled = !isPy3k;
17
18 src = fetchPypi {
19 pname = "PyChromecast";
20 inherit version;
21 sha256 = "sha256-nlfcmFpKBdtb3NXaIZy/bO0lVIygk/jXS8EHs8VU7AA=";
22 };
23
24 postPatch = ''
25 substituteInPlace requirements.txt \
26 --replace "protobuf>=3.19.1,<4" "protobuf>=3.19.1"
27 '';
28
29 propagatedBuildInputs = [
30 casttube
31 protobuf
32 requests
33 zeroconf
34 ];
35
36 # no tests available
37 doCheck = false;
38
39 pythonImportsCheck = [
40 "pychromecast"
41 ];
42
43 meta = with lib; {
44 description = "Library for Python to communicate with the Google Chromecast";
45 homepage = "https://github.com/home-assistant-libs/pychromecast";
46 license = licenses.mit;
47 maintainers = with maintainers; [ abbradar ];
48 platforms = platforms.unix;
49 };
50}