depot/third_party/nixpkgs/pkgs/tools/misc/svtplay-dl/default.nix
Default email 657f08b14c Project import generated by Copybara.
GitOrigin-RevId: 807e9154dcb16384b1b765ebe9cd2bba2ac287fd
2024-10-29 11:11:06 +00:00

86 lines
1.4 KiB
Nix

{
lib,
fetchFromGitHub,
installShellFiles,
python3Packages,
perl,
ffmpeg,
}:
let
inherit (python3Packages)
buildPythonApplication
setuptools
requests
pysocks
cryptography
pyyaml
pytestCheckHook
mock
requests-mock
;
version = "4.101";
in
buildPythonApplication {
pname = "svtplay-dl";
inherit version;
pyproject = true;
src = fetchFromGitHub {
owner = "spaam";
repo = "svtplay-dl";
rev = version;
hash = "sha256-bHUrpkGBguI8oZB1h1ToFkFsGiMeyV7TyDtgJ8+2TzI=";
};
build-system = [ setuptools ];
dependencies = [
requests
pysocks
cryptography
pyyaml
];
nativeBuildInputs = [
# For `pod2man(1)`.
perl
installShellFiles
];
nativeCheckInputs = [
pytestCheckHook
mock
requests-mock
];
pytestFlagsArray = [
"--doctest-modules"
"lib"
];
postBuild = ''
make svtplay-dl.1
'';
postInstall = ''
installManPage svtplay-dl.1
makeWrapperArgs+=(--prefix PATH : "${lib.makeBinPath [ ffmpeg ]}")
'';
postInstallCheck = ''
$out/bin/svtplay-dl --help > /dev/null
'';
meta = {
homepage = "https://github.com/spaam/svtplay-dl";
description = "Command-line tool to download videos from svtplay.se and other sites";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
mainProgram = "svtplay-dl";
};
}