2023-08-22 20:05:09 +00:00
|
|
|
{ lib
|
|
|
|
, perlPackages
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, stdenv
|
|
|
|
, shortenPerlShebang
|
|
|
|
, perl
|
|
|
|
, atomicparsley
|
|
|
|
, ffmpeg
|
|
|
|
}:
|
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-10-09 19:29:22 +00:00
|
|
|
LWP LWPProtocolHttps XMLLibXML 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-10-09 19:29:22 +00:00
|
|
|
wrapProgram $out/bin/get_iplayer --suffix PATH : ${lib.makeBinPath [ atomicparsley ffmpeg ]} --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; {
|
2023-10-09 19:29:22 +00:00
|
|
|
description = "Downloads TV and radio programmes from BBC iPlayer and BBC Sounds";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2023-10-09 19:29:22 +00:00
|
|
|
homepage = "https://github.com/get-iplayer/get_iplayer";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
2023-08-22 20:05:09 +00:00
|
|
|
maintainers = with maintainers; [ rika jgarcia ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|