2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchFromGitHub, makeWrapper, python3Packages, perl, zip
|
|
|
|
, gitMinimal }:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
inherit (python3Packages)
|
|
|
|
python nose pycrypto pyyaml requests mock python-dateutil setuptools;
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "svtplay-dl";
|
2020-10-19 00:13:06 +00:00
|
|
|
version = "2.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "spaam";
|
|
|
|
repo = "svtplay-dl";
|
|
|
|
rev = version;
|
2020-10-19 00:13:06 +00:00
|
|
|
sha256 = "0gcw7hwbr9jniwvqix37vvd2fiplsz70qab9w45d21i8jrfnhxb5";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
pythonPaths = [ pycrypto pyyaml requests ];
|
|
|
|
buildInputs = [ python perl nose mock makeWrapper python-dateutil setuptools ] ++ pythonPaths;
|
|
|
|
nativeBuildInputs = [ gitMinimal zip ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace scripts/run-tests.sh \
|
|
|
|
--replace 'PYTHONPATH=lib' 'PYTHONPATH=lib:$PYTHONPATH'
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
sed -i '/def test_sublang2\?(/ i\ @unittest.skip("accesses network")' \
|
|
|
|
lib/svtplay_dl/tests/test_postprocess.py
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=$(out)" "SYSCONFDIR=$(out)/etc" "PYTHON=${python.interpreter}" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/bin/svtplay-dl" \
|
|
|
|
--prefix PYTHONPATH : "$PYTHONPATH"
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
sh scripts/run-tests.sh -2
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = "https://github.com/spaam/svtplay-dl";
|
|
|
|
description = "Command-line tool to download videos from svtplay.se and other sites";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = [ maintainers.rycee ];
|
|
|
|
};
|
|
|
|
}
|