about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/mstruct
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2017-07-01 11:50:24 +0000
committerVincent Laporte <Vincent.Laporte@gmail.com>2017-07-01 11:52:18 +0000
commit4338ddd0f95fef1dffb1342651d49a4a0b60a8dc (patch)
tree5465d661d07862279e8c916a30727d0647779d08 /pkgs/development/ocaml-modules/mstruct
parent6875115b8e0ab94a00bc3c6f4c37857effcf6055 (diff)
downloadnixlib-4338ddd0f95fef1dffb1342651d49a4a0b60a8dc.tar
nixlib-4338ddd0f95fef1dffb1342651d49a4a0b60a8dc.tar.gz
nixlib-4338ddd0f95fef1dffb1342651d49a4a0b60a8dc.tar.bz2
nixlib-4338ddd0f95fef1dffb1342651d49a4a0b60a8dc.tar.lz
nixlib-4338ddd0f95fef1dffb1342651d49a4a0b60a8dc.tar.xz
nixlib-4338ddd0f95fef1dffb1342651d49a4a0b60a8dc.tar.zst
nixlib-4338ddd0f95fef1dffb1342651d49a4a0b60a8dc.zip
ocamlPackages.mstruct: init at 1.3.3
Mstruct is a thin mutable layer on top of cstruct

Homepage: https://github.com/mirage/ocaml-mstruct
Diffstat (limited to 'pkgs/development/ocaml-modules/mstruct')
-rw-r--r--pkgs/development/ocaml-modules/mstruct/default.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/mstruct/default.nix b/pkgs/development/ocaml-modules/mstruct/default.nix
new file mode 100644
index 000000000000..958cbdc554e8
--- /dev/null
+++ b/pkgs/development/ocaml-modules/mstruct/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, ocaml, findlib, jbuilder, opam
+, cstruct
+}:
+
+if !stdenv.lib.versionAtLeast ocaml.version "4.02"
+then throw "mstruct is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+	version = "1.3.3";
+	name = "ocaml${ocaml.version}-mstruct-${version}";
+
+	src = fetchFromGitHub {
+		owner = "mirage";
+		repo = "ocaml-mstruct";
+		rev = "v${version}";
+		sha256 = "1rxjzkg6156vl6yazbk1h0ndqj80wym5aliaapijf60apqqmsp4s";
+	};
+
+	buildInputs = [ ocaml findlib jbuilder opam ];
+
+	propagatedBuildInputs = [ cstruct ];
+
+	inherit (jbuilder) installPhase;
+
+	meta = {
+		description = "A thin mutable layer on top of cstruct";
+		license = stdenv.lib.licenses.isc;
+		maintainers = [ stdenv.lib.maintainers.vbgl ];
+		inherit (src.meta) homepage;
+		inherit (ocaml.meta) platforms;
+	};
+}