summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/cstruct/ppx.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/ocaml-modules/cstruct/ppx.nix')
-rw-r--r--pkgs/development/ocaml-modules/cstruct/ppx.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/cstruct/ppx.nix b/pkgs/development/ocaml-modules/cstruct/ppx.nix
new file mode 100644
index 00000000000..9d19e1751e2
--- /dev/null
+++ b/pkgs/development/ocaml-modules/cstruct/ppx.nix
@@ -0,0 +1,13 @@
+{ stdenv, ocaml, cstruct, ppx_tools_versioned }:
+
+assert stdenv.lib.versionAtLeast ocaml.version "4.02";
+
+stdenv.mkDerivation rec {
+	name = "ocaml${ocaml.version}-ppx_cstruct-${version}";
+	inherit (cstruct) version src unpackCmd installPhase meta;
+
+	buildInputs = cstruct.buildInputs ++ [ ppx_tools_versioned ];
+	propagatedBuildInputs = [ cstruct ];
+
+	buildPhase = "jbuilder build -p ppx_cstruct";
+}