nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 python3Packages,
4 fetchFromGitHub,
5 addBinToPathHook,
6 installShellFiles,
7 nix-update-script,
8}:
9
10python3Packages.buildPythonApplication rec {
11 pname = "audible-cli";
12 version = "0.3.2";
13 pyproject = true;
14
15 src = fetchFromGitHub {
16 owner = "mkb79";
17 repo = "audible-cli";
18 tag = "v${version}";
19 hash = "sha256-DGOOMjP6dxIwbIhzRKf0+oy/2Cs+00tpwHkcmrukatw=";
20 };
21
22 nativeBuildInputs =
23 with python3Packages;
24 [
25 setuptools
26 ]
27 ++ [
28 addBinToPathHook
29 installShellFiles
30 ];
31
32 propagatedBuildInputs = with python3Packages; [
33 aiofiles
34 audible
35 click
36 httpx
37 packaging
38 pillow
39 questionary
40 setuptools
41 tabulate
42 toml
43 tqdm
44 ];
45
46 pythonRelaxDeps = [
47 "httpx"
48 ];
49
50 postInstall = ''
51 installShellCompletion --cmd audible \
52 --bash <(source utils/code_completion/audible-complete-bash.sh) \
53 --fish <(source utils/code_completion/audible-complete-zsh-fish.sh) \
54 --zsh <(source utils/code_completion/audible-complete-zsh-fish.sh)
55 '';
56
57 # upstream has no tests
58 doCheck = false;
59
60 pythonImportsCheck = [
61 "audible_cli"
62 ];
63
64 passthru.updateScript = nix-update-script {
65 extraArgs = [
66 "--version-regex"
67 "v([0-9.]+)"
68 ];
69 };
70
71 meta = with lib; {
72 description = "Command line interface for audible package. With the cli you can download your Audible books, cover, chapter files";
73 license = licenses.agpl3Only;
74 homepage = "https://github.com/mkb79/audible-cli";
75 changelog = "https://github.com/mkb79/audible-cli/blob/${src.rev}/CHANGELOG.md";
76 maintainers = with maintainers; [ jvanbruegge ];
77 mainProgram = "audible";
78 };
79}