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

This commit is contained in:
Théo Zimmermann
2018-11-05 11:21:46 +01:00
parent 5fc73fd52e
commit 794158fcd5
64 changed files with 506 additions and 828 deletions

View File

@@ -1,31 +1,22 @@
{ stdenv, fetchFromGitHub, ocaml, findlib, dune
, ppx_tools_versioned
, ounit
}:
{ stdenv, fetchFromGitHub, buildDunePackage, ppx_tools_versioned, ounit }:
stdenv.mkDerivation rec {
name = "ocaml${ocaml.version}-bitstring-${version}";
buildDunePackage rec {
pname = "bitstring";
version = "3.0.0";
src = fetchFromGitHub {
owner = "xguerin";
repo = "bitstring";
repo = pname;
rev = "v${version}";
sha256 = "0r49qax7as48jgknzaq6p9rbpmrvnmlic713wzz5bj60j5h0396f";
};
buildInputs = [ ocaml findlib dune ppx_tools_versioned ounit ];
buildPhase = "jbuilder build";
buildInputs = [ ppx_tools_versioned ounit ];
doCheck = true;
checkPhase = "jbuilder runtest";
inherit (dune) installPhase;
meta = with stdenv.lib; {
description = "This library adds Erlang-style bitstrings and matching over bitstrings as a syntax extension and library for OCaml";
homepage = https://github.com/xguerin/bitstring;
inherit (ocaml.meta) platforms;
license = licenses.lgpl21Plus;
maintainers = [ maintainers.maurer ];
};