1{ stdenv, fetchurl, python, pythonPackages, libxslt, libxml2, makeWrapper }:
2
3let
4 rev = "9de21094a8cf565bdfcf75688e121a5ad1f5397b";
5in
6
7stdenv.mkDerivation rec {
8 name = "venus-${rev}";
9
10 src = fetchurl {
11 url = "https://github.com/rubys/venus/tarball/${rev}";
12 name = "${name}.tar.bz";
13 sha256 = "0lsc9d83grbi3iwm8ppaig4h9vbmd5h4vvz83lmpnyp7zqfka7dy";
14 };
15
16 preConfigure = ''
17 substituteInPlace tests/test_spider.py \
18 --replace "urllib.urlopen('http://127.0.0.1:%d/' % _PORT).read()" "" \
19 --replace "[200,200,200,200,404]" "[200,200,200,404]"
20 substituteInPlace planet.py \
21 --replace "#!/usr/bin/env python" "#!${python}/bin/python"
22 substituteInPlace tests/test_apply.py \
23 --replace "'xsltproc" "'${libxslt}/bin/xsltproc"
24 substituteInPlace planet/shell/xslt.py \
25 --replace "'xsltproc" "'${libxslt}/bin/xsltproc"
26 '';
27
28 doCheck = true;
29 checkPhase = "python runtests.py";
30
31 buildInputs = [ python python.modules.bsddb libxslt
32 libxml2 pythonPackages.genshi pythonPackages.lxml makeWrapper ];
33
34 installPhase = ''
35 mkdir -p $out/bin
36 cp -R ./* $out/
37 ln -s $out/planet.py $out/bin/venus-planet
38 wrapProgram $out/planet.py \
39 --prefix PYTHONPATH : $PYTHONPATH:${pythonPackages.lxml}/lib/${python.libPrefix}/site-packages:${pythonPackages.genshi}/lib/${python.libPrefix}/site-packages
40 python runtests.py
41 '';
42
43 meta = {
44 description = "News feed reader";
45 longDescription = ''
46 Planet Venus is an awesome ‘river of news’ feed reader. It downloads news
47 feeds published by web sites and aggregates their content together into a
48 single combined feed, latest news first.
49 '';
50 homepage = "http://intertwingly.net/code/venus/docs/index.html";
51 license = stdenv.lib.licenses.psfl;
52 platforms = stdenv.lib.platforms.all;
53 maintainers = [ stdenv.lib.maintainers.garbas ];
54 };
55}