2023-08-20 17:49:13 +01:00
|
|
|
{ lib
|
|
|
|
, perlPackages
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, stdenv
|
|
|
|
, shortenPerlShebang
|
|
|
|
, perl
|
|
|
|
, atomicparsley
|
|
|
|
, ffmpeg
|
|
|
|
}:
|
2017-03-23 01:27:43 +00:00
|
|
|
|
2018-10-13 00:10:38 +01:00
|
|
|
perlPackages.buildPerlPackage rec {
|
2019-06-20 14:07:56 +01:00
|
|
|
pname = "get_iplayer";
|
2024-01-15 11:33:34 +00:00
|
|
|
version = "3.35";
|
2018-10-13 00:10:38 +01:00
|
|
|
|
2017-03-23 01:27:43 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "get-iplayer";
|
|
|
|
repo = "get_iplayer";
|
|
|
|
rev = "v${version}";
|
2024-01-15 11:33:34 +00:00
|
|
|
hash = "sha256-fqzrgmtqy7dlmGEaTXAqpdt9HqZCVooJ0Vf6/JUKihw=";
|
2017-03-23 01:27:43 +00:00
|
|
|
};
|
2011-08-30 01:14:16 +01:00
|
|
|
|
2023-08-20 17:49:13 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ] ++ lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang;
|
|
|
|
buildInputs = [ perl ];
|
2019-12-28 20:08:33 +00:00
|
|
|
propagatedBuildInputs = with perlPackages; [
|
2023-08-21 00:16:51 +01:00
|
|
|
LWP LWPProtocolHttps XMLLibXML Mojolicious
|
2019-12-28 20:08:33 +00:00
|
|
|
];
|
2013-06-29 19:50:44 +01:00
|
|
|
|
|
|
|
preConfigure = "touch Makefile.PL";
|
|
|
|
doCheck = false;
|
2016-04-18 09:49:20 +01:00
|
|
|
outputs = [ "out" "man" ];
|
2011-08-30 01:14:16 +01:00
|
|
|
|
2016-10-06 23:17:43 +01:00
|
|
|
installPhase = ''
|
2023-08-20 17:49:13 +01:00
|
|
|
runHook preInstall
|
2023-10-15 21:28:18 +01:00
|
|
|
|
2023-11-05 13:48:29 +00:00
|
|
|
install -D get_iplayer -t $out/bin
|
2023-08-21 00:16:51 +01:00
|
|
|
wrapProgram $out/bin/get_iplayer --suffix PATH : ${lib.makeBinPath [ atomicparsley ffmpeg ]} --prefix PERL5LIB : $PERL5LIB
|
2024-01-15 11:33:34 +00:00
|
|
|
install -Dm444 get_iplayer.1 -t $out/share/man/man1
|
2023-10-15 21:28:18 +01:00
|
|
|
|
2023-08-20 17:49:13 +01:00
|
|
|
runHook postInstall
|
2016-04-18 09:49:20 +01:00
|
|
|
'';
|
2023-08-20 17:49:13 +01:00
|
|
|
|
2023-08-16 21:30:38 +01:00
|
|
|
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
|
|
shortenPerlShebang $out/bin/.get_iplayer-wrapped
|
|
|
|
'';
|
2016-10-06 23:17:43 +01:00
|
|
|
|
2023-01-24 16:29:20 +00:00
|
|
|
meta = with lib; {
|
2023-08-21 00:16:51 +01:00
|
|
|
description = "Downloads TV and radio programmes from BBC iPlayer and BBC Sounds";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "get_iplayer";
|
2017-03-23 01:27:43 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2023-08-21 00:16:51 +01:00
|
|
|
homepage = "https://github.com/get-iplayer/get_iplayer";
|
2017-03-23 01:27:43 +00:00
|
|
|
platforms = platforms.all;
|
2023-11-24 13:32:09 +00:00
|
|
|
maintainers = with maintainers; [ rika chewblacka ];
|
2011-08-30 01:14:16 +01:00
|
|
|
};
|
2018-10-13 00:10:38 +01:00
|
|
|
|
2011-08-30 01:14:16 +01:00
|
|
|
}
|