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/faraday/default.nix | |
parent | 5fc73fd52e7e9aa56911d152e3a5c49de8a18f61 (diff) |
buildDunePackage: new support function; use it to refactor some OCaml derivations
Diffstat (limited to 'pkgs/development/ocaml-modules/faraday/default.nix')
-rw-r--r-- | pkgs/development/ocaml-modules/faraday/default.nix | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/pkgs/development/ocaml-modules/faraday/default.nix b/pkgs/development/ocaml-modules/faraday/default.nix index 6af808654f530..34c8fcbfcbcd0 100644 --- a/pkgs/development/ocaml-modules/faraday/default.nix +++ b/pkgs/development/ocaml-modules/faraday/default.nix @@ -1,34 +1,25 @@ -{ stdenv, fetchFromGitHub, ocaml, findlib, dune, alcotest }: +{ stdenv, fetchFromGitHub, buildDunePackage, alcotest }: -if !stdenv.lib.versionAtLeast ocaml.version "4.02" -then throw "faraday is not available for OCaml ${ocaml.version}" -else - -stdenv.mkDerivation rec { - name = "ocaml${ocaml.version}-faraday-${version}"; +buildDunePackage rec { + pname = "faraday"; version = "0.5.0"; + minimumOCamlVersion = "4.02"; + src = fetchFromGitHub { owner = "inhabitedtype"; - repo = "faraday"; + repo = pname; rev = version; sha256 = "1kql0il1frsbx6rvwqd7ahi4m14ik6la5an6c2w4x7k00ndm4d7n"; }; - buildInputs = [ ocaml findlib dune alcotest ]; - - buildPhase = "dune build -p faraday"; - + buildInputs = [ alcotest ]; doCheck = true; - checkPhase = "jbuilder runtest"; - - inherit (dune) installPhase; meta = { description = "Serialization library built for speed and memory efficiency"; license = stdenv.lib.licenses.bsd3; maintainers = [ stdenv.lib.maintainers.vbgl ]; inherit (src.meta) homepage; - inherit (ocaml.meta) platforms; }; } |