2024-04-21 15:54:59 +00:00
|
|
|
{ lib, python3Packages, fetchFromGitHub, installShellFiles, nix-update-script }:
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "audible-cli";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.3.1";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mkb79";
|
2023-11-16 04:20:00 +00:00
|
|
|
repo = "audible-cli";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-AYL7lcYYY7gK12Id94aHRWRlCiznnF4r+lpI5VFpAWY=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeBuildInputs = with python3Packages; [
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
setuptools
|
|
|
|
] ++ [
|
|
|
|
installShellFiles
|
|
|
|
];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
aiofiles
|
|
|
|
audible
|
|
|
|
click
|
|
|
|
httpx
|
|
|
|
packaging
|
|
|
|
pillow
|
|
|
|
questionary
|
2024-02-29 20:09:43 +00:00
|
|
|
setuptools
|
2023-11-16 04:20:00 +00:00
|
|
|
tabulate
|
|
|
|
toml
|
|
|
|
tqdm
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
"httpx"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
export PATH=$out/bin:$PATH
|
|
|
|
installShellCompletion --cmd audible \
|
|
|
|
--bash <(source utils/code_completion/audible-complete-bash.sh) \
|
|
|
|
--fish <(source utils/code_completion/audible-complete-zsh-fish.sh) \
|
|
|
|
--zsh <(source utils/code_completion/audible-complete-zsh-fish.sh)
|
2022-06-16 17:23:12 +00:00
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
# upstream has no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"audible_cli"
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Command line interface for audible package. With the cli you can download your Audible books, cover, chapter files";
|
2023-11-16 04:20:00 +00:00
|
|
|
license = licenses.agpl3Only;
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://github.com/mkb79/audible-cli";
|
2023-11-16 04:20:00 +00:00
|
|
|
changelog = "https://github.com/mkb79/audible-cli/blob/${src.rev}/CHANGELOG.md";
|
2022-06-16 17:23:12 +00:00
|
|
|
maintainers = with maintainers; [ jvanbruegge ];
|
2023-11-16 04:20:00 +00:00
|
|
|
mainProgram = "audible";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
}
|