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

52 lines
1.5 KiB
Nix
Raw Normal View History

2018-08-03 13:48:26 +00:00
{ stdenv, fetchFromGitHub, makeWrapper, python3Packages, perl, zip
2018-11-04 23:08:46 +00:00
, rtmpdump, gitMinimal }:
2015-01-01 15:34:58 +00:00
2016-08-14 12:28:05 +00:00
let
2018-11-04 23:08:46 +00:00
inherit (python3Packages) python nose pycrypto pyyaml 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}";
2018-11-04 23:08:46 +00:00
version = "2.1";
2015-01-01 15:34:58 +00:00
src = fetchFromGitHub {
owner = "spaam";
repo = "svtplay-dl";
rev = version;
2018-11-04 23:08:46 +00:00
sha256 = "1cnc32gbhs955391hs1x1jpjsl3b6pqy7ysdydmp9q1i2rw105ln";
2015-01-01 15:34:58 +00:00
};
2018-11-04 23:08:46 +00:00
pythonPaths = [ pycrypto pyyaml requests ];
2015-01-01 15:34:58 +00:00
buildInputs = [ python perl nose mock rtmpdump makeWrapper ] ++ pythonPaths;
2018-11-04 23:08:46 +00:00
nativeBuildInputs = [ gitMinimal zip ];
2015-01-01 15:34:58 +00:00
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;
2018-01-14 19:45:17 +00:00
checkPhase = ''
sed -i "/def test_parse_m3u8/i\\
@unittest.skip('requires internet')" lib/svtplay_dl/tests/hls.py
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 ];
};
}