summary refs log tree commit diff
path: root/pkgs/tools/misc/venus/default.nix
blob: 534a500c7bccc8200a9823650c739476348ba174 (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
{ stdenv, fetchFromGitHub, python, pythonPackages, libxslt, libxml2, makeWrapper }:

stdenv.mkDerivation rec {
  pname = "venus";
  version = "unstable-2011-02-18";

  src = fetchFromGitHub {
    owner = "rubys";
    repo = "venus";
    rev = "9de21094a8cf565bdfcf75688e121a5ad1f5397b";
    sha256 = "10yyx4jaxxbwhica12aiw119aywghcr7b24gs9lrmafpa6xd3an2";
  };

  preConfigure = ''
    substituteInPlace tests/test_spider.py \
        --replace "urllib.urlopen('http://127.0.0.1:%d/' % _PORT).read()" "" \
        --replace "[200,200,200,200,404]" "[200,200,200,404]"
    substituteInPlace planet.py \
        --replace "#!/usr/bin/env python" "#!${python}/bin/python"
    substituteInPlace tests/test_apply.py \
        --replace "'xsltproc" "'${libxslt.bin}/bin/xsltproc"
    substituteInPlace planet/shell/xslt.py \
        --replace "'xsltproc" "'${libxslt.bin}/bin/xsltproc"
  '';

  doCheck = true;
  checkPhase = "python runtests.py";

  buildInputs = [ python libxslt
    libxml2 pythonPackages.genshi pythonPackages.lxml makeWrapper ];

  installPhase = ''
    mkdir -p $out/bin
    cp -R ./* $out/
    ln -s $out/planet.py $out/bin/venus-planet
    wrapProgram $out/planet.py \
        --prefix PYTHONPATH : $PYTHONPATH:${pythonPackages.lxml}/lib/${python.libPrefix}/site-packages:${pythonPackages.genshi}/lib/${python.libPrefix}/site-packages
    python runtests.py
  '';

  meta = {
    description = "News feed reader";
    longDescription = ''
      Planet Venus is an awesome ‘river of news’ feed reader. It downloads news
      feeds published by web sites and aggregates their content together into a
      single combined feed, latest news first.
    '';
    homepage = http://intertwingly.net/code/venus/docs/index.html;
    license = stdenv.lib.licenses.psfl;
    platforms = stdenv.lib.platforms.all;
    maintainers = [];
  };
}