2016-08-14 14:28:05 +02:00
|
|
|
{ stdenv, fetchFromGitHub, makeWrapper, pythonPackages, perl, zip
|
|
|
|
, rtmpdump, substituteAll }:
|
2015-01-01 16:34:58 +01:00
|
|
|
|
2016-08-14 14:28:05 +02:00
|
|
|
let
|
|
|
|
inherit (pythonPackages) python nose pycrypto requests2 mock;
|
|
|
|
in stdenv.mkDerivation rec {
|
2015-01-01 16:34:58 +01:00
|
|
|
name = "svtplay-dl-${version}";
|
2017-03-01 20:11:02 +01:00
|
|
|
version = "1.9.3";
|
2015-01-01 16:34:58 +01:00
|
|
|
|
2015-05-31 22:38:44 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "spaam";
|
|
|
|
repo = "svtplay-dl";
|
|
|
|
rev = version;
|
2017-03-01 20:11:02 +01:00
|
|
|
sha256 = "14qksi1svi89niffykxg47kay013byls6bnhkrkzkanq04075lmw";
|
2015-01-01 16:34:58 +01:00
|
|
|
};
|
|
|
|
|
2015-09-14 20:06:17 +02:00
|
|
|
pythonPaths = [ pycrypto requests2 ];
|
2015-01-01 16:34:58 +01:00
|
|
|
buildInputs = [ python perl nose mock rtmpdump makeWrapper ] ++ pythonPaths;
|
|
|
|
nativeBuildInputs = [ zip ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace lib/svtplay_dl/fetcher/rtmp.py \
|
|
|
|
--replace '"rtmpdump"' '"${rtmpdump}/bin/rtmpdump"'
|
|
|
|
|
2016-08-27 23:55:37 +02:00
|
|
|
substituteInPlace scripts/run-tests.sh \
|
2015-01-01 16:34:58 +01:00
|
|
|
--replace 'PYTHONPATH=lib' 'PYTHONPATH=lib:$PYTHONPATH'
|
|
|
|
'';
|
|
|
|
|
2016-08-14 14:28:05 +02:00
|
|
|
makeFlags = "PREFIX=$(out) SYSCONFDIR=$(out)/etc PYTHON=${python.interpreter}";
|
2015-01-01 16:34:58 +01:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/bin/svtplay-dl" \
|
|
|
|
--prefix PYTHONPATH : "$PYTHONPATH"
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
2016-08-27 23:55:37 +02:00
|
|
|
checkPhase = "sh scripts/run-tests.sh -2";
|
2015-01-01 16:34:58 +01:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|