1{ lib
2, buildPythonPackage
3, fetchPypi
4, isPyPy
5, isPy27
6, readline
7, R
8, pcre
9, lzma
10, bzip2
11, zlib
12, icu
13, singledispatch
14, six
15, jinja2
16, pytest
17}:
18
19buildPythonPackage rec {
20 version = if isPy27 then
21 "2.8.6" # python2 support dropped in 2.9.x
22 else
23 "2.9.3";
24 pname = "rpy2";
25 disabled = isPyPy;
26 src = fetchPypi {
27 inherit version pname;
28 sha256 = if isPy27 then
29 "162zki5c1apgv6qbafi7n66y4hgpgp43xag7q75qb6kv99ri6k80" # 2.8.x
30 else
31 "1b72958e683339ea0c3bd9f73738e9ece2da8da8008a10e2e0c68fc7864e9361"; # 2.9.x
32 };
33 buildInputs = [
34 readline
35 R
36 pcre
37 lzma
38 bzip2
39 zlib
40 icu
41 ];
42 propagatedBuildInputs = [
43 singledispatch
44 six
45 jinja2
46 ];
47 checkInputs = [ pytest ];
48 # Tests fail with `assert not _relpath.startswith('..'), "Path must be within the project"`
49 # in the unittest `loader.py`. I don't know what causes this.
50 doCheck = false;
51 # without this tests fail when looking for libreadline.so
52 LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
53
54 meta = {
55 homepage = http://rpy.sourceforge.net/rpy2;
56 description = "Python interface to R";
57 license = lib.licenses.gpl2Plus;
58 platforms = lib.platforms.linux;
59 maintainers = with lib.maintainers; [ joelmo ];
60 };
61 }