summary refs log tree commit diff
path: root/pkgs/development/python-modules/rainbowstream/default.nix
blob: c5ec1d3ab4efa8db649b8f1a4f98844259c9c37a (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
{ lib, stdenv
, buildPythonPackage
, fetchPypi
, python
, pkgs
, pillow
, twitter
, pyfiglet
, requests
, arrow
, dateutil
, pysocks
, pocket
}:

buildPythonPackage rec {
  pname = "rainbowstream";
  version = "1.5.2";

  src = fetchPypi {
    inherit pname version;
    sha256 = "527d39778c55d88300fe2017913341bfa1b1f0ffdc1fe5eab57a82bf4cd2edb3";
  };

  patches = [ ./image.patch ];

  postPatch = ''
    clib=$out/${python.sitePackages}/rainbowstream/image.so
    substituteInPlace rainbowstream/c_image.py \
      --replace @CLIB@ $clib
    sed -i 's/requests.*"/requests"/' setup.py
  '';

  LC_ALL="en_US.UTF-8";

  postInstall = ''
    mkdir -p $out/lib
    cc -fPIC -shared -o $clib rainbowstream/image.c
    for prog in "$out/bin/"*; do
      wrapProgram "$prog" \
        --prefix PYTHONPATH : "$PYTHONPATH"
    done
  '';

  buildInputs =  [ pkgs.libjpeg pkgs.freetype pkgs.zlib pkgs.glibcLocales pillow twitter pyfiglet requests arrow dateutil pysocks pocket ];

  meta = with lib; {
    description = "Streaming command-line twitter client";
    homepage    = "http://www.rainbowstream.org/";
    license     = licenses.mit;
    maintainers = with maintainers; [ thoughtpolice ];
  };

}