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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
1.7 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, makeWrapper
, python3Packages
, perl
, zip
, gitMinimal
, ffmpeg
}:
2015-01-01 18:34:58 +03:00
2016-08-14 15:28:05 +03:00
let
2019-09-14 17:47:09 +03:00
inherit (python3Packages)
2021-09-12 17:08:00 +03:00
python pytest nose cryptography pyyaml requests mock requests-mock
python-dateutil setuptools;
2019-09-14 17:47:09 +03:00
2022-10-25 23:01:46 +03:00
version = "4.14";
2015-01-01 18:34:58 +03:00
in
stdenv.mkDerivation rec {
pname = "svtplay-dl";
inherit version;
src = fetchFromGitHub {
owner = "spaam";
repo = "svtplay-dl";
rev = version;
2022-10-25 23:01:46 +03:00
sha256 = "sha256-jfrzgWlEoct8BJLkteWlYjXR/D4J+ShQhsNPBCN+zeQ=";
2015-01-01 18:34:58 +03:00
};
2021-04-05 18:59:58 +03:00
pythonPaths = [ cryptography pyyaml requests ];
2021-09-12 17:08:00 +03:00
buildInputs = [ python perl python-dateutil setuptools ] ++ pythonPaths;
nativeBuildInputs = [ gitMinimal zip makeWrapper ];
2021-09-12 17:08:00 +03:00
checkInputs = [ nose pytest mock requests-mock ];
2015-01-01 18:34:58 +03:00
postPatch = ''
2016-08-28 00:55:37 +03:00
substituteInPlace scripts/run-tests.sh \
2015-01-01 18:34:58 +03:00
--replace 'PYTHONPATH=lib' 'PYTHONPATH=lib:$PYTHONPATH'
2020-10-03 23:34:03 +03:00
sed -i '/def test_sublang2\?(/ i\ @unittest.skip("accesses network")' \
lib/svtplay_dl/tests/test_postprocess.py
2015-01-01 18:34:58 +03:00
'';
makeFlags = [ "PREFIX=$(out)" "SYSCONFDIR=$(out)/etc" "PYTHON=${python.interpreter}" ];
2015-01-01 18:34:58 +03:00
postInstall = ''
wrapProgram "$out/bin/svtplay-dl" \
2020-11-24 22:01:07 +03:00
--prefix PATH : "${ffmpeg}" \
2015-01-01 18:34:58 +03:00
--prefix PYTHONPATH : "$PYTHONPATH"
'';
doCheck = true;
2018-01-14 22:45:17 +03:00
checkPhase = ''
sh scripts/run-tests.sh -2
'';
2015-01-01 18:34:58 +03:00
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/svtplay-dl --help > /dev/null
runHook postInstallCheck
'';
meta = with lib; {
homepage = "https://github.com/spaam/svtplay-dl";
2015-01-01 18:34:58 +03:00
description = "Command-line tool to download videos from svtplay.se and other sites";
license = licenses.mit;
2021-01-15 12:19:50 +03:00
platforms = lib.platforms.unix;
2015-01-01 18:34:58 +03:00
};
}