2018-04-11 23:43:43 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, isPyPy
|
2018-06-27 08:55:01 +01:00
|
|
|
, isPy27
|
2018-04-11 23:43:43 +01:00
|
|
|
, readline
|
|
|
|
, R
|
|
|
|
, pcre
|
|
|
|
, lzma
|
|
|
|
, bzip2
|
|
|
|
, zlib
|
|
|
|
, icu
|
|
|
|
, singledispatch
|
|
|
|
, six
|
|
|
|
, jinja2
|
|
|
|
, pytest
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2018-06-27 08:55:01 +01:00
|
|
|
version = if isPy27 then
|
|
|
|
"2.8.6" # python2 support dropped in 2.9.x
|
|
|
|
else
|
2018-10-24 08:02:46 +01:00
|
|
|
"2.9.4";
|
2018-04-11 23:43:43 +01:00
|
|
|
pname = "rpy2";
|
|
|
|
disabled = isPyPy;
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit version pname;
|
2018-06-27 08:55:01 +01:00
|
|
|
sha256 = if isPy27 then
|
|
|
|
"162zki5c1apgv6qbafi7n66y4hgpgp43xag7q75qb6kv99ri6k80" # 2.8.x
|
|
|
|
else
|
2018-10-24 08:02:46 +01:00
|
|
|
"0bl1d2qhavmlrvalir9hmkjh74w21vzkvc2sg3cbb162s10zfmxy"; # 2.9.x
|
2018-04-11 23:43:43 +01:00
|
|
|
};
|
|
|
|
buildInputs = [
|
|
|
|
readline
|
|
|
|
R
|
|
|
|
pcre
|
|
|
|
lzma
|
|
|
|
bzip2
|
|
|
|
zlib
|
|
|
|
icu
|
|
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
singledispatch
|
|
|
|
six
|
|
|
|
jinja2
|
|
|
|
];
|
|
|
|
checkInputs = [ pytest ];
|
|
|
|
# Tests fail with `assert not _relpath.startswith('..'), "Path must be within the project"`
|
|
|
|
# in the unittest `loader.py`. I don't know what causes this.
|
|
|
|
doCheck = false;
|
|
|
|
# without this tests fail when looking for libreadline.so
|
|
|
|
LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://rpy.sourceforge.net/rpy2;
|
|
|
|
description = "Python interface to R";
|
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
maintainers = with lib.maintainers; [ joelmo ];
|
|
|
|
};
|
|
|
|
}
|