summary refs log tree commit diff
path: root/pkgs/applications/misc/yarssr/default.nix
blob: d031f63a097a1a9512ccf0cc68c9f079b29ab86b (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{ fetchFromGitHub, stdenv, lib, gettext, gtk2, makeWrapper, perlPackages, gnome2 }:

let
  perlDeps = with perlPackages; [
    Glib
    Gtk2
    Gnome2
    Pango
    Cairo
    Gnome2Canvas
    Gnome2VFS
    Gtk2GladeXML
    Gtk2TrayIcon
    XMLLibXML
    XMLSAXBase
    XMLParser
    XMLRSS
    HTMLParser
    DateTime
    DateTimeFormatMail
    DateTimeFormatW3CDTF
    DateTimeLocale
    DateTimeTimeZone
    ParamsValidate
    ModuleImplementation
    ModuleRuntime
    TryTiny
    ClassSingleton
    URI
    AnyEvent
    AnyEventHTTP
    commonsense
    FileSlurp
    JSON
    Guard
    LocaleGettext
  ];
  libs = [
    stdenv.cc.cc.lib
    gtk2
  ];
in
stdenv.mkDerivation {
  version = "unstable-2017-12-01";
  pname = "yarssr";

  src = fetchFromGitHub {
    owner = "JGRennison";
    repo = "yarssr";
    rev = "e70eb9fc6563599bfb91c6de6a79654de531c18d";
    sha256 = "0x7hz8x8qyp3i1vb22zhcnvwxm3jhmmmlr22jqc5b09vpmbw1l45";
  };

  nativeBuildInputs = [ perlPackages.perl gettext makeWrapper ];
  buildInputs = perlDeps ++ [ gnome2.libglade ];
  propagatedBuildInputs = libs ++ perlDeps;

  installPhase = ''
    DESTDIR=$out make install
    mv $out/usr/* $out/
    rm -R $out/usr
    sed -i -r "s!use lib [^;]+;!use lib '$out/share/yarssr';!" $out/bin/yarssr
    sed -i -r "s!$Yarssr::PREFIX = [^;]+;!$Yarssr::PREFIX = '$out';!" $out/bin/yarssr
    sed -i -r "s!use Yarssr::Browser;!!" $out/share/yarssr/Yarssr/GUI.pm
    chmod a+x $out/bin/yarssr
  '';

  postFixup = ''
    wrapProgram $out/bin/yarssr \
      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath libs} \
      --set PERL5LIB "${perlPackages.makePerlPath perlDeps}"
  '';

  meta = with lib; {
    homepage = "https://github.com/tsyrogit/zxcvbn-c";
    description = "A fork of Yarssr (a RSS reader for the GNOME Tray) from http://yarssr.sf.net with various fixes";
    license = licenses.gpl1;
    platforms = platforms.linux;
    maintainers = with maintainers; [ xurei ];
  };
}