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";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "3.35";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "get-iplayer";
|
|
|
|
repo = "get_iplayer";
|
|
|
|
rev = "v${version}";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-fqzrgmtqy7dlmGEaTXAqpdt9HqZCVooJ0Vf6/JUKihw=";
|
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
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
install -D get_iplayer -t $out/bin
|
2023-10-09 19:29:22 +00:00
|
|
|
wrapProgram $out/bin/get_iplayer --suffix PATH : ${lib.makeBinPath [ atomicparsley ffmpeg ]} --prefix PERL5LIB : $PERL5LIB
|
2024-01-25 14:12:00 +00:00
|
|
|
install -Dm444 get_iplayer.1 -t $out/share/man/man1
|
2023-11-16 04:20:00 +00:00
|
|
|
|
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";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "get_iplayer";
|
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;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ rika chewblacka ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|