summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/cstruct/1.9.0.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/ocaml-modules/cstruct/1.9.0.nix')
-rw-r--r--pkgs/development/ocaml-modules/cstruct/1.9.0.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/cstruct/1.9.0.nix b/pkgs/development/ocaml-modules/cstruct/1.9.0.nix
new file mode 100644
index 000000000000..25f84826ec18
--- /dev/null
+++ b/pkgs/development/ocaml-modules/cstruct/1.9.0.nix
@@ -0,0 +1,36 @@
+{ stdenv, writeText, fetchFromGitHub, ocaml, ocamlbuild, ocplib-endian, sexplib, findlib, ppx_tools
+, async ? null, lwt ? null
+}:
+
+assert stdenv.lib.versionAtLeast ocaml.version "4.01";
+
+let version = "1.9.0"; in
+
+let opt = b: "--${if b != null then "en" else "dis"}able"; in
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-cstruct-${version}";
+
+  src = fetchFromGitHub {
+    owner = "mirage";
+    repo = "ocaml-cstruct";
+    rev = "v${version}";
+    sha256 = "1c1j21zgmxi9spq23imy7byn50qr7hlds1cfpzxlsx9dp309jngy";
+  };
+
+  configureFlags = [ "${opt lwt}-lwt" "${opt async}-async" "${opt ppx_tools}-ppx" ];
+
+  buildInputs = [ ocaml findlib ocamlbuild ppx_tools lwt async ];
+  propagatedBuildInputs = [ ocplib-endian sexplib ];
+
+  createFindlibDestdir = true;
+  dontStrip = true;
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/mirage/ocaml-cstruct;
+    description = "Map OCaml arrays onto C-like structs";
+    license = stdenv.lib.licenses.isc;
+    maintainers = [ maintainers.vbgl maintainers.ericbmerritt ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}