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