butt: set meta.platforms
[NixPkgs.git] / pkgs / by-name / au / audible-cli / package.nix
blob7e78e2a8d395ad3cb91bc535b0036b5aef7a62a0
1 { lib, python3Packages, fetchFromGitHub, installShellFiles, nix-update-script }:
3 python3Packages.buildPythonApplication rec {
4   pname = "audible-cli";
5   version = "0.3.1";
6   pyproject = true;
8   src = fetchFromGitHub {
9     owner = "mkb79";
10     repo = "audible-cli";
11     rev = "refs/tags/v${version}";
12     hash = "sha256-AYL7lcYYY7gK12Id94aHRWRlCiznnF4r+lpI5VFpAWY=";
13   };
15   nativeBuildInputs = with python3Packages; [
16     pythonRelaxDepsHook
17     setuptools
18   ] ++ [
19     installShellFiles
20   ];
22   propagatedBuildInputs = with python3Packages; [
23     aiofiles
24     audible
25     click
26     httpx
27     packaging
28     pillow
29     questionary
30     setuptools
31     tabulate
32     toml
33     tqdm
34   ];
36   pythonRelaxDeps = [
37     "httpx"
38   ];
40   postInstall = ''
41     export PATH=$out/bin:$PATH
42     installShellCompletion --cmd audible \
43       --bash <(source utils/code_completion/audible-complete-bash.sh) \
44       --fish <(source utils/code_completion/audible-complete-zsh-fish.sh) \
45       --zsh <(source utils/code_completion/audible-complete-zsh-fish.sh)
46   '';
48   # upstream has no tests
49   doCheck = false;
51   pythonImportsCheck = [
52     "audible_cli"
53   ];
55   passthru.updateScript = nix-update-script { };
57   meta = with lib; {
58     description = "A command line interface for audible package. With the cli you can download your Audible books, cover, chapter files";
59     license = licenses.agpl3Only;
60     homepage = "https://github.com/mkb79/audible-cli";
61     changelog = "https://github.com/mkb79/audible-cli/blob/${src.rev}/CHANGELOG.md";
62     maintainers = with maintainers; [ jvanbruegge ];
63     mainProgram = "audible";
64   };