1{ lib, python3Packages, fetchFromGitHub, installShellFiles }:
2
3python3Packages.buildPythonApplication rec {
4 pname = "audible-cli";
5 version = "0.2.5";
6 pyproject = true;
7
8 src = fetchFromGitHub {
9 owner = "mkb79";
10 repo = "audible-cli";
11 rev = "refs/tags/v${version}";
12 hash = "sha256-YGvnye6YSp/H/2HAw6A8z5VzzCqa3ktJucq+3cXPUpc=";
13 };
14
15 nativeBuildInputs = with python3Packages; [
16 pythonRelaxDepsHook
17 setuptools
18 ] ++ [
19 installShellFiles
20 ];
21
22 propagatedBuildInputs = with python3Packages; [
23 aiofiles
24 audible
25 click
26 httpx
27 packaging
28 pillow
29 questionary
30 tabulate
31 toml
32 tqdm
33 ];
34
35 pythonRelaxDeps = [
36 "httpx"
37 "audible"
38 ];
39
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 '';
47
48 # upstream has no tests
49 doCheck = false;
50
51 pythonImportsCheck = [
52 "audible_cli"
53 ];
54
55 meta = with lib; {
56 description = "A command line interface for audible package. With the cli you can download your Audible books, cover, chapter files";
57 license = licenses.agpl3Only;
58 homepage = "https://github.com/mkb79/audible-cli";
59 changelog = "https://github.com/mkb79/audible-cli/blob/${src.rev}/CHANGELOG.md";
60 maintainers = with maintainers; [ jvanbruegge ];
61 mainProgram = "audible";
62 };
63}