2023-08-22 20:05:09 +00:00
|
|
|
{ lib
|
|
|
|
, perlPackages
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, stdenv
|
|
|
|
, shortenPerlShebang
|
|
|
|
, perl
|
|
|
|
, atomicparsley
|
|
|
|
, ffmpeg
|
|
|
|
, flvstreamer
|
|
|
|
, rtmpdump
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
perlPackages.buildPerlPackage rec {
|
|
|
|
pname = "get_iplayer";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "3.31";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "get-iplayer";
|
|
|
|
repo = "get_iplayer";
|
|
|
|
rev = "v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "+ChCF27nmPKbqaZVxsZ6TlbzSdEz6RfMs87NE8xaSRw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ] ++ lib.optional stdenv.isDarwin shortenPerlShebang;
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ perl ];
|
|
|
|
propagatedBuildInputs = with perlPackages; [
|
2023-05-24 13:37:59 +00:00
|
|
|
HTMLParser HTTPCookies LWP LWPProtocolHttps XMLLibXML XMLSimple Mojolicious
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = "touch Makefile.PL";
|
|
|
|
doCheck = false;
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2023-08-22 20:05:09 +00:00
|
|
|
runHook preInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/bin $out/share/man/man1
|
|
|
|
cp get_iplayer $out/bin
|
2023-02-02 18:25:31 +00:00
|
|
|
wrapProgram $out/bin/get_iplayer --suffix PATH : ${lib.makeBinPath [ atomicparsley ffmpeg flvstreamer rtmpdump ]} --prefix PERL5LIB : $PERL5LIB
|
2020-04-24 23:36:52 +00:00
|
|
|
cp get_iplayer.1 $out/share/man/man1
|
2023-08-22 20:05:09 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
|
|
|
shortenPerlShebang $out/bin/.get_iplayer-wrapped
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Downloads TV and radio from BBC iPlayer";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
homepage = "https://squarepenguin.co.uk/";
|
|
|
|
platforms = platforms.all;
|
2023-08-22 20:05:09 +00:00
|
|
|
maintainers = with maintainers; [ rika jgarcia ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|