ks: add completions for bash and zsh (#364049)
[NixPkgs.git] / pkgs / by-name / tw / twitch-dl / package.nix
blob877683f51fba4750d07b617e42fe0a5d07813a03
2   lib,
3   fetchFromGitHub,
4   python3Packages,
5   installShellFiles,
6   scdoc,
7   ffmpeg,
8 }:
10 python3Packages.buildPythonApplication rec {
11   pname = "twitch-dl";
12   version = "2.9.2";
13   pyproject = true;
15   src = fetchFromGitHub {
16     owner = "ihabunek";
17     repo = "twitch-dl";
18     rev = "refs/tags/${version}";
19     hash = "sha256-BIE3+SDmc5ggF9P+qeloI1JYYrEtOJQ/8oDR76i0t6c=";
20   };
22   pythonRelaxDeps = [
23     "m3u8"
24   ];
26   nativeBuildInputs = [
27     python3Packages.setuptools
28     python3Packages.setuptools-scm
29     installShellFiles
30     scdoc
31   ];
33   propagatedBuildInputs = with python3Packages; [
34     click
35     httpx
36     m3u8
37   ];
39   nativeCheckInputs = [
40     python3Packages.pytestCheckHook
41   ];
43   disabledTestPaths = [
44     # Requires network access
45     "tests/test_api.py"
46     "tests/test_cli.py"
47   ];
49   pythonImportsCheck = [
50     "twitchdl"
51     "twitchdl.cli"
52     "twitchdl.naming"
53     "twitchdl.entities"
54     "twitchdl.http"
55     "twitchdl.output"
56     "twitchdl.playlists"
57     "twitchdl.progress"
58     "twitchdl.twitch"
59     "twitchdl.utils"
60     "twitchdl.commands"
61   ];
63   makeWrapperArgs = [
64     "--prefix"
65     "PATH"
66     ":"
67     (lib.makeBinPath [ ffmpeg ])
68   ];
70   postInstall = ''
71     scdoc < twitch-dl.1.scd > twitch-dl.1
72     installManPage twitch-dl.1
73   '';
75   preInstallCheck = ''
76     export HOME="$(mktemp -d)"
77   '';
79   meta = with lib; {
80     description = "CLI tool for downloading videos from Twitch";
81     homepage = "https://github.com/ihabunek/twitch-dl";
82     changelog = "https://github.com/ihabunek/twitch-dl/blob/${src.rev}/CHANGELOG.md";
83     license = licenses.gpl3Only;
84     maintainers = with maintainers; [
85       pbsds
86       hausken
87     ];
88     mainProgram = "twitch-dl";
89   };