diff --git a/pkgs/development/ocaml-modules/ocaml-r/default.nix b/pkgs/development/ocaml-modules/ocaml-r/default.nix new file mode 100644 index 000000000000..71e77b24ce4b --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-r/default.nix @@ -0,0 +1,31 @@ +{ lib, fetchFromGitHub, buildDunePackage, pkg-config, configurator, stdio, R }: + +buildDunePackage rec { + pname = "ocaml-r"; + version = "0.2.0"; + + src = fetchFromGitHub { + owner = "pveber"; + repo = pname; + rev = "v${version}"; + sha256 = "09gljccwjsw9693m1hm9hcyvgp3p2fvg3cfn18yyidpc2f81a4fy"; + }; + + # 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' + ''; + + buildInputs = [ configurator pkg-config R stdio ]; + + meta = { + description = "OCaml bindings for the R interpreter"; + inherit (src.meta) homepage; + license = lib.licenses.gpl3; + maintainers = [ lib.maintainers.bcdarwin ]; + }; + +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 7e12a3db3f78..68d45730d27f 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -615,6 +615,8 @@ let pgocaml_ppx = callPackage ../development/ocaml-modules/pgocaml/ppx.nix {}; + ocaml-r = callPackage ../development/ocaml-modules/ocaml-r { }; + ocaml-sat-solvers = callPackage ../development/ocaml-modules/ocaml-sat-solvers { }; ocamlscript = callPackage ../development/tools/ocaml/ocamlscript { };