about summary refs log tree commit diff
path: root/pkgs/development/perl-modules/WWW-YoutubeViewer/default.nix
blob: 4916c9619c61706f5d7ceb09f3a5c09cd81490d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{ stdenv, lib, fetchFromGitHub, buildPerlPackage, shortenPerlShebang, LWP, LWPProtocolHttps, DataDump, JSON }:

buildPerlPackage rec {
  pname = "WWW-YoutubeViewer";
  version = "3.7.9";

  src = fetchFromGitHub {
    owner  = "trizen";
    repo   = "youtube-viewer";
    rev    = version;
    sha256 = "16p0sa91h0zpqdpqmy348g6b9qj5f6qrbzrljn157vk00cg6mx18";
  };

  nativeBuildInputs = lib.optional stdenv.isDarwin shortenPerlShebang;
  propagatedBuildInputs = [
    LWP
    LWPProtocolHttps
    DataDump
    JSON
  ];
  postInstall = lib.optionalString stdenv.isDarwin ''
    shortenPerlShebang $out/bin/youtube-viewer
  '';

  meta = with lib; {
    description = "Lightweight application for searching and streaming videos from YouTube";
    homepage = "https://github.com/trizen/youtube-viewer";
    license = with licenses; [ artistic2 ];
    maintainers = with maintainers; [ woffs ];
    mainProgram = "youtube-viewer";
  };
}