2018-08-03 06:48:26 -07:00
|
|
|
{ stdenv, fetchFromGitHub, makeWrapper, python3Packages, perl, zip
|
2019-08-27 08:45:00 -07:00
|
|
|
, gitMinimal }:
|
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)
|
|
|
|
python nose pycrypto pyyaml requests mock python-dateutil setuptools;
|
|
|
|
|
2016-08-14 05:28:05 -07:00
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "svtplay-dl";
|
2019-09-14 07:47:09 -07:00
|
|
|
version = "2.4";
|
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;
|
2019-09-14 07:47:09 -07:00
|
|
|
sha256 = "146ss7pzh61yw84crk6hzfxkfdnf6bq07m11b6lgsw4hsn71g59w";
|
2015-01-01 07:34:58 -08:00
|
|
|
};
|
|
|
|
|
2018-11-04 15:08:46 -08:00
|
|
|
pythonPaths = [ pycrypto pyyaml requests ];
|
2019-09-14 07:47:09 -07:00
|
|
|
buildInputs = [ python perl nose mock makeWrapper python-dateutil setuptools ] ++ pythonPaths;
|
2018-11-04 15:08:46 -08:00
|
|
|
nativeBuildInputs = [ gitMinimal zip ];
|
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'
|
|
|
|
'';
|
|
|
|
|
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" \
|
|
|
|
--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
|
|
|
|
|
|
|
meta = with stdenv.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;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = [ maintainers.rycee ];
|
|
|
|
};
|
|
|
|
}
|