diff options
author | Théo Zimmermann <theo.zimmermann@univ-paris-diderot.fr> | 2018-11-05 11:21:46 +0100 |
---|---|---|
committer | Théo Zimmermann <theo.zimmermann@univ-paris-diderot.fr> | 2018-11-07 10:08:03 +0100 |
commit | 794158fcd54b862f3775bc8b54495a842a250b7b (patch) | |
tree | 333ef218a45bf9ca5d20186dc67bb9bd5209aca3 /pkgs/development/ocaml-modules/ppx_derivers | |
parent | 5fc73fd52e7e9aa56911d152e3a5c49de8a18f61 (diff) |
buildDunePackage: new support function; use it to refactor some OCaml derivations
Diffstat (limited to 'pkgs/development/ocaml-modules/ppx_derivers')
-rw-r--r-- | pkgs/development/ocaml-modules/ppx_derivers/default.nix | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/pkgs/development/ocaml-modules/ppx_derivers/default.nix b/pkgs/development/ocaml-modules/ppx_derivers/default.nix index edd08606761..0482e04b1c4 100644 --- a/pkgs/development/ocaml-modules/ppx_derivers/default.nix +++ b/pkgs/development/ocaml-modules/ppx_derivers/default.nix @@ -1,29 +1,22 @@ -{ stdenv, fetchFromGitHub, ocaml, findlib, dune }: +{ stdenv, fetchFromGitHub, buildDunePackage }: -if !stdenv.lib.versionAtLeast ocaml.version "4.02" -then throw "ppx_derivers is not available for OCaml ${ocaml.version}" -else - -stdenv.mkDerivation rec { - name = "ocaml${ocaml.version}-ppx_derivers-${version}"; +buildDunePackage rec { + pname = "ppx_derivers"; version = "1.2"; + minimumOCamlVersion = "4.02"; + src = fetchFromGitHub { owner = "diml"; - repo = "ppx_derivers"; + repo = pname; rev = version; sha256 = "0bnhihl1w31as5w2czly1v3d6pbir9inmgsjg2cj6aaj9v1dzd85"; }; - buildInputs = [ ocaml findlib dune ]; - - inherit (dune) installPhase; - meta = { description = "Shared [@@deriving] plugin registry"; license = stdenv.lib.licenses.bsd3; maintainers = [ stdenv.lib.maintainers.vbgl ]; inherit (src.meta) homepage; - inherit (ocaml.meta) platforms; }; } |