1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, fetchpatch
6, poetry-core
7, aiohttp
8, async-upnp-client
9, attrs
10, click
11, importlib-metadata
12}:
13
14buildPythonPackage rec {
15 pname = "python-songpal";
16 version = "0.13";
17
18 format = "pyproject";
19
20 disabled = pythonOlder "3.6";
21
22 src = fetchFromGitHub {
23 owner = "rytilahti";
24 repo = "python-songpal";
25 rev = version;
26 sha256 = "124w6vfn992845k09bjv352havk8pg590b135m37h1x1m7fmbpwa";
27 };
28
29 patches = [
30 # https://github.com/rytilahti/python-songpal/pull/90
31 (fetchpatch {
32 name = "switch-to-poetry-core.patch";
33 url = "https://github.com/rytilahti/python-songpal/commit/56b634790d94b2f9788d5af3d5cedff47f1e42c2.patch";
34 sha256 = "0yc0mrb91ywk77nd4mxvyc0p2kjz2w1p395755a32ls30zw2bs27";
35 })
36 ];
37
38 postPatch = ''
39 # https://github.com/rytilahti/python-songpal/issues/91
40 substituteInPlace pyproject.toml \
41 --replace 'click = "^7"' 'click = "*"'
42 '';
43
44 nativeBuildInputs = [
45 poetry-core
46 ];
47
48 propagatedBuildInputs = [
49 aiohttp
50 async-upnp-client
51 attrs
52 click
53 importlib-metadata
54 ];
55
56 # no tests implemented
57 doCheck = false;
58
59 pythonImportsCheck = [ "songpal" ];
60
61 meta = with lib; {
62 description = "Python library for interfacing with Sony's Songpal devices";
63 homepage = "https://github.com/rytilahti/python-songpal";
64 license = licenses.gpl3Only;
65 maintainers = with maintainers; [ dotlambda ];
66 };
67}