1{
2 lib,
3 fetchFromGitHub,
4 fetchpatch,
5 buildDunePackage,
6 pkg-config,
7 dune-configurator,
8 stdio,
9 R,
10 alcotest,
11}:
12
13buildDunePackage rec {
14 pname = "ocaml-r";
15 version = "0.6.0";
16
17 duneVersion = "3";
18
19 minimalOCamlVersion = "4.08";
20
21 src = fetchFromGitHub {
22 owner = "pveber";
23 repo = pname;
24 rev = "v${version}";
25 sha256 = "sha256-jPyVMxjeh9+xu0dD1gelAxcOhxouKczyvzVoKZ5oSrs=";
26 };
27
28 # Finds R and Rmathlib separately
29 patches = [
30 (fetchpatch {
31 url = "https://github.com/pveber/ocaml-r/commit/aa96dc5.patch";
32 sha256 = "sha256-xW33W2ciesyUkDKEH08yfOXv0wP0V6X80or2/n2Nrb4=";
33 })
34 ];
35
36 nativeBuildInputs = [
37 pkg-config
38 R
39 ];
40 buildInputs = [
41 dune-configurator
42 stdio
43 R
44 ];
45
46 doCheck = true;
47 checkInputs = [ alcotest ];
48
49 meta = {
50 description = "OCaml bindings for the R interpreter";
51 inherit (src.meta) homepage;
52 license = lib.licenses.gpl3;
53 maintainers = [ lib.maintainers.bcdarwin ];
54 };
55
56}