summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/st/streamrip/package.nix
blob: 9c9158c1c5fc0e5bf2e78a40167400f4d19be805 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
{
  lib,
  python3Packages,
  fetchFromGitHub,

  ffmpeg,
}:

python3Packages.buildPythonApplication (finalAttrs: {
  pname = "streamrip";
  version = "2.2.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "nathom";
    repo = "streamrip";
    rev = "v${finalAttrs.version}";
    hash = "sha256-OeU1KBGcmpryOlDmW1aFNAgSP484ZAcc4CVsgfrsKVI=";
  };

  patches = [
    ./patches/ensure-the-default-config-file-is-writable.patch
  ];

  nativeBuildInputs = with python3Packages; [
    poetry-core
  ];

  propagatedBuildInputs = with python3Packages; [
    aiodns
    aiofiles
    aiohttp
    aiolimiter
    appdirs
    cleo
    click-help-colors
    deezer-py
    m3u8
    mutagen
    pathvalidate
    pillow
    pycryptodomex
    pytest-asyncio
    pytest-mock
    rich
    simple-term-menu
    tomlkit
    tqdm
  ];

  nativeCheckInputs = with python3Packages; [
    pytestCheckHook
  ];

  pythonRelaxDeps = true;

  prePatch = ''
    sed -i 's#"ffmpeg"#"${lib.getBin ffmpeg}/bin/ffmpeg"#g' streamrip/client/downloadable.py
  '';

  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  meta = {
    description = "Scriptable music downloader for Qobuz, Tidal, SoundCloud, and Deezer";
    homepage = "https://github.com/nathom/streamrip";
    license = lib.licenses.gpl3Only;
    maintainers = [ ];
    mainProgram = "rip";
  };
})