From 794158fcd54b862f3775bc8b54495a842a250b7b Mon Sep 17 00:00:00 2001 From: Théo Zimmermann Date: Mon, 5 Nov 2018 11:21:46 +0100 Subject: buildDunePackage: new support function; use it to refactor some OCaml derivations --- .../ocaml-modules/bigstringaf/default.nix | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'pkgs/development/ocaml-modules/bigstringaf') diff --git a/pkgs/development/ocaml-modules/bigstringaf/default.nix b/pkgs/development/ocaml-modules/bigstringaf/default.nix index fc9a5379b178..762e675d51ce 100644 --- a/pkgs/development/ocaml-modules/bigstringaf/default.nix +++ b/pkgs/development/ocaml-modules/bigstringaf/default.nix @@ -1,32 +1,25 @@ -{ stdenv, fetchFromGitHub, ocaml, findlib, dune, alcotest }: +{ stdenv, fetchFromGitHub, buildDunePackage, alcotest }: -if !stdenv.lib.versionAtLeast ocaml.version "4.03" -then throw "bigstringaf is not available for OCaml ${ocaml.version}" -else - -stdenv.mkDerivation rec { +buildDunePackage rec { + pname = "bigstringaf"; version = "0.3.0"; - name = "ocaml${ocaml.version}-bigstringaf-${version}"; + + minimumOCamlVersion = "4.03"; src = fetchFromGitHub { owner = "inhabitedtype"; - repo = "bigstringaf"; + repo = pname; rev = version; sha256 = "1yx6hv8rk0ldz1h6kk00rwg8abpfc376z00aifl9f5rn7xavpscs"; }; - buildInputs = [ ocaml findlib dune alcotest ]; - + buildInputs = [ alcotest ]; doCheck = true; - checkPhase = "dune runtest"; - - inherit (dune) installPhase; meta = { description = "Bigstring intrinsics and fast blits based on memcpy/memmove"; license = stdenv.lib.licenses.bsd3; maintainers = [ stdenv.lib.maintainers.vbgl ]; inherit (src.meta) homepage; - inherit (ocaml.meta) platforms; }; } -- cgit 1.4.1