aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/tools/audio/google-music-scripts/default.nix
blob: 272cf9025392ba56f1ba754444e9bf34a8c60c6a (plain)
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
{ lib, python3 }:

let
  py = python3.override {
    packageOverrides = self: super: {
      loguru = super.loguru.overridePythonAttrs (oldAttrs: rec {
        version = "0.4.0";
        src = oldAttrs.src.override {
          inherit version;
          sha256 = "0j47cg3gi8in4z6z4w3by6x02mpkkfl78gr85xjn5rg0nxiz7pfm";
        };
      });
    };
  };

in

with py.pkgs;

buildPythonApplication rec {
  pname = "google-music-scripts";
  version = "4.5.0";

  src = fetchPypi {
    inherit pname version;
    sha256 = "0apwgj86whrc077dfymvyb4qwj19bawyrx49g4kg364895v0rbbq";
  };

  # pendulum pinning was to prevent PEP517 from trying to build from source
  postPatch = ''
    substituteInPlace setup.py \
      --replace "tomlkit>=0.5,<0.6" "tomlkit" \
      --replace "pendulum>=2.0,<=3.0,!=2.0.5,!=2.1.0" "pendulum"
  '';

  propagatedBuildInputs = [
    appdirs
    audio-metadata
    google-music
    google-music-proto
    google-music-utils
    loguru
    pendulum
    natsort
    tomlkit
  ];

  # No tests
  checkPhase = ''
    $out/bin/gms --help >/dev/null
  '';

  meta = with lib; {
    homepage = "https://github.com/thebigmunch/google-music-scripts";
    description = "A CLI utility for interacting with Google Music";
    license = licenses.mit;
    maintainers = with maintainers; [ jakewaksbaum ];
  };
}