2020-12-08 21:50:14 +01:00
|
|
|
{ lib, fetchFromGitHub, buildDunePackage, pkg-config, dune-configurator, stdio, R
|
|
|
|
, alcotest
|
|
|
|
}:
|
2020-03-26 03:56:56 +01:00
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "ocaml-r";
|
2020-12-08 21:50:14 +01:00
|
|
|
version = "0.4.0";
|
|
|
|
|
|
|
|
useDune2 = true;
|
|
|
|
|
|
|
|
minimumOCamlVersion = "4.08";
|
2020-03-26 03:56:56 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pveber";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-12-08 21:50:14 +01:00
|
|
|
sha256 = "10is2s148kfh3g0pwniyzp5mh48k57ldvn8gm86469zvgxyij1ri";
|
2020-03-26 03:56:56 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# Without the following patch, stub generation fails with:
|
|
|
|
# > Fatal error: exception (Failure "not supported: osVersion")
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace stubgen/stubgen.ml --replace \
|
|
|
|
'failwithf "not supported: %s" name ()' \
|
|
|
|
'sprintf "(* not supported: %s *)" name'
|
2020-12-08 21:50:14 +01:00
|
|
|
substituteInPlace lib/config/discover.ml --replace \
|
|
|
|
' libRmath"' '"'
|
2020-03-26 03:56:56 +01:00
|
|
|
'';
|
|
|
|
|
2022-02-22 10:59:04 +01:00
|
|
|
# This currently fails with dune
|
|
|
|
strictDeps = false;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config R ];
|
|
|
|
buildInputs = [ dune-configurator stdio R ];
|
2020-12-08 21:50:14 +01:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkInputs = [ alcotest ];
|
2020-03-26 03:56:56 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "OCaml bindings for the R interpreter";
|
|
|
|
inherit (src.meta) homepage;
|
|
|
|
license = lib.licenses.gpl3;
|
|
|
|
maintainers = [ lib.maintainers.bcdarwin ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|