summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/cstruct/sexp.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/ocaml-modules/cstruct/sexp.nix')
-rw-r--r--pkgs/development/ocaml-modules/cstruct/sexp.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/cstruct/sexp.nix b/pkgs/development/ocaml-modules/cstruct/sexp.nix
new file mode 100644
index 00000000000..b04810e4803
--- /dev/null
+++ b/pkgs/development/ocaml-modules/cstruct/sexp.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, ocaml, alcotest, cstruct, sexplib }:
+
+if !lib.versionAtLeast (cstruct.version or "1") "3"
+then cstruct
+else
+
+buildDunePackage rec {
+  pname = "cstruct-sexp";
+  inherit (cstruct) version src useDune2 meta;
+
+  minimumOCamlVersion = "4.03";
+
+  # alcotest is only available on OCaml >= 4.05 due to fmt
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+  checkInputs = [ alcotest ];
+
+  propagatedBuildInputs = [ cstruct sexplib ];
+}