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

45 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, makeWrapper, python, perl, zip
, rtmpdump, nose, mock, pycrypto, requests2, substituteAll }:
2015-01-01 15:34:58 +00:00
stdenv.mkDerivation rec {
name = "svtplay-dl-${version}";
2016-05-08 23:37:28 +01:00
version = "1.1";
2015-01-01 15:34:58 +00:00
src = fetchFromGitHub {
owner = "spaam";
repo = "svtplay-dl";
rev = version;
2016-05-10 18:33:08 +01:00
sha256 = "0wzh86zjly2r03qpjb5z0ddy79qkbw7k04qfawj22nf2w629r0dk";
2015-01-01 15:34:58 +00:00
};
pythonPaths = [ pycrypto requests2 ];
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"'
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 ];
};
}