2021-01-10 23:54:33 -08:00
|
|
|
{ lib, stdenv, fetchFromGitHub, makeWrapper, python3Packages, perl, zip
|
2020-11-24 11:01:07 -08:00
|
|
|
, gitMinimal, ffmpeg }:
|
2015-01-01 07:34:58 -08:00
|
|
|
|
2016-08-14 05:28:05 -07:00
|
|
|
let
|
2019-09-14 07:47:09 -07:00
|
|
|
|
|
|
|
inherit (python3Packages)
|
2021-04-05 08:59:58 -07:00
|
|
|
python nose cryptography pyyaml requests mock python-dateutil setuptools;
|
2019-09-14 07:47:09 -07:00
|
|
|
|
2016-08-14 05:28:05 -07:00
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "svtplay-dl";
|
2021-05-07 14:32:12 -07:00
|
|
|
version = "3.7";
|
2015-01-01 07:34:58 -08:00
|
|
|
|
2015-05-31 13:38:44 -07:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "spaam";
|
|
|
|
repo = "svtplay-dl";
|
|
|
|
rev = version;
|
2021-05-07 14:32:12 -07:00
|
|
|
sha256 = "0krskxbmlglkipqzjwgm2nmq118m8l0djgh0f8l6n2w3bjblhyfx";
|
2015-01-01 07:34:58 -08:00
|
|
|
};
|
|
|
|
|
2021-04-05 08:59:58 -07:00
|
|
|
pythonPaths = [ cryptography pyyaml requests ];
|
2021-02-07 01:17:39 -08:00
|
|
|
buildInputs = [ python perl nose mock python-dateutil setuptools ] ++ pythonPaths;
|
|
|
|
nativeBuildInputs = [ gitMinimal zip makeWrapper ];
|
2015-01-01 07:34:58 -08:00
|
|
|
|
|
|
|
postPatch = ''
|
2016-08-27 14:55:37 -07:00
|
|
|
substituteInPlace scripts/run-tests.sh \
|
2015-01-01 07:34:58 -08:00
|
|
|
--replace 'PYTHONPATH=lib' 'PYTHONPATH=lib:$PYTHONPATH'
|
2020-10-03 13:34:03 -07:00
|
|
|
|
|
|
|
sed -i '/def test_sublang2\?(/ i\ @unittest.skip("accesses network")' \
|
|
|
|
lib/svtplay_dl/tests/test_postprocess.py
|
2015-01-01 07:34:58 -08:00
|
|
|
'';
|
|
|
|
|
2019-10-27 06:03:25 -07:00
|
|
|
makeFlags = [ "PREFIX=$(out)" "SYSCONFDIR=$(out)/etc" "PYTHON=${python.interpreter}" ];
|
2015-01-01 07:34:58 -08:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/bin/svtplay-dl" \
|
2020-11-24 11:01:07 -08:00
|
|
|
--prefix PATH : "${ffmpeg}" \
|
2015-01-01 07:34:58 -08:00
|
|
|
--prefix PYTHONPATH : "$PYTHONPATH"
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
2018-01-14 11:45:17 -08:00
|
|
|
checkPhase = ''
|
|
|
|
sh scripts/run-tests.sh -2
|
|
|
|
'';
|
2015-01-01 07:34:58 -08:00
|
|
|
|
2021-01-10 23:54:33 -08:00
|
|
|
meta = with lib; {
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://github.com/spaam/svtplay-dl";
|
2015-01-01 07:34:58 -08:00
|
|
|
description = "Command-line tool to download videos from svtplay.se and other sites";
|
|
|
|
license = licenses.mit;
|
2021-01-15 01:19:50 -08:00
|
|
|
platforms = lib.platforms.unix;
|
2015-01-01 07:34:58 -08:00
|
|
|
};
|
|
|
|
}
|