3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/misc/svtplay-dl/default.nix

43 lines
1.2 KiB
Nix
Raw Normal View History

2015-01-01 15:34:58 +00:00
{ stdenv, fetchurl, makeWrapper, python, perl, zip
, rtmpdump, nose, mock, pycrypto, substituteAll }:
stdenv.mkDerivation rec {
name = "svtplay-dl-${version}";
version = "0.10.2015.03.25";
2015-01-01 15:34:58 +00:00
src = fetchurl {
url = "https://github.com/spaam/svtplay-dl/archive/${version}.tar.gz";
sha256 = "0j0fg3qrldpaf880v488rr2snw6ghpdln4l9mbvmi70rjzzxv4ap";
2015-01-01 15:34:58 +00:00
};
pythonPaths = [ pycrypto ];
buildInputs = [ python perl nose mock rtmpdump makeWrapper ] ++ pythonPaths;
nativeBuildInputs = [ zip ];
postPatch = ''
substituteInPlace lib/svtplay_dl/fetcher/rtmp.py \
--replace '"rtmpdump"' '"${rtmpdump}/bin/rtmpdump"'
substituteInPlace run-tests.sh \
--replace 'PYTHONPATH=lib' 'PYTHONPATH=lib:$PYTHONPATH'
'';
makeFlags = "PREFIX=$(out) SYSCONFDIR=$(out)/etc PYTHON=${python}/bin/python";
postInstall = ''
wrapProgram "$out/bin/svtplay-dl" \
--prefix PYTHONPATH : "$PYTHONPATH"
'';
doCheck = true;
checkPhase = "sh run-tests.sh -2";
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 ];
};
}