nixpkgs/pkgs/tools/misc/svtplay-dl/default.nix

47 lines
1.3 KiB
Nix
Raw Normal View History

2016-08-14 12:28:05 +00:00
{ stdenv, fetchFromGitHub, makeWrapper, pythonPackages, perl, zip
, rtmpdump, substituteAll }:
2015-01-01 15:34:58 +00:00
2016-08-14 12:28:05 +00:00
let
inherit (pythonPackages) python nose pycrypto requests mock;
2016-08-14 12:28:05 +00:00
in stdenv.mkDerivation rec {
2015-01-01 15:34:58 +00:00
name = "svtplay-dl-${version}";
2017-09-21 13:22:08 +00:00
version = "1.9.6";
2015-01-01 15:34:58 +00:00
src = fetchFromGitHub {
owner = "spaam";
repo = "svtplay-dl";
rev = version;
2017-09-21 13:22:08 +00:00
sha256 = "11xw4whh60k61i8akd7avb254mmffaig72kb7w6prk1kjq05js2s";
2015-01-01 15:34:58 +00:00
};
pythonPaths = [ pycrypto requests ];
2015-01-01 15:34:58 +00: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 21:55:37 +00:00
substituteInPlace scripts/run-tests.sh \
2015-01-01 15:34:58 +00:00
--replace 'PYTHONPATH=lib' 'PYTHONPATH=lib:$PYTHONPATH'
'';
2016-08-14 12:28:05 +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" \
--prefix PYTHONPATH : "$PYTHONPATH"
'';
doCheck = true;
2016-08-27 21:55:37 +00:00
checkPhase = "sh scripts/run-tests.sh -2";
2015-01-01 15:34:58 +00: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 ];
};
}