buildDunePackage: new support function; use it to refactor some OCaml derivations

This commit is contained in:
Théo Zimmermann
2018-11-07 10:08:03 +01:00
parent 5fc73fd52e
commit 794158fcd5
64 changed files with 506 additions and 828 deletions
@@ -1,13 +1,11 @@
{ stdenv, ocaml, cstruct, ppx_tools_versioned }:
{ buildDunePackage, cstruct, ppx_tools_versioned }:
assert stdenv.lib.versionAtLeast ocaml.version "4.02";
buildDunePackage {
pname = "ppx_cstruct";
inherit (cstruct) version src unpackCmd meta;
stdenv.mkDerivation rec {
name = "ocaml${ocaml.version}-ppx_cstruct-${version}";
inherit (cstruct) version src unpackCmd installPhase meta;
minimumOCamlVersion = "4.02";
buildInputs = cstruct.buildInputs ++ [ ppx_tools_versioned ];
buildInputs = [ ppx_tools_versioned ];
propagatedBuildInputs = [ cstruct ];
buildPhase = "dune build -p ppx_cstruct";
}