ocamlPackages.angstrom: 0.5.1 -> 0.8.1

This commit is contained in:
Vincent Laporte 2018-02-22 17:30:56 +00:00 committed by Vincent Laporte
parent 19cc36d197
commit 629a2398db

View File

@ -1,31 +1,29 @@
{ stdenv, fetchFromGitHub, ocaml, ocamlbuild, cstruct, result, findlib }: { stdenv, fetchFromGitHub, ocaml, findlib, jbuilder, alcotest, result }:
let param = if !stdenv.lib.versionAtLeast ocaml.version "4.03"
if stdenv.lib.versionAtLeast ocaml.version "4.03" then throw "angstrom is not available for OCaml ${ocaml.version}"
then { else
version = "0.5.1";
sha256 = "0rm79xyszy9aqvflcc13y9xiya82z31fzmr3b3hx91pmqviymhgc";
} else {
version = "0.4.0";
sha256 = "019s3jwhnswa914bgj1fa6q67k0bl2ahqdaqfnavcbyii8763kh2";
};
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
inherit (param) version; version = "0.8.1";
name = "ocaml-angstrom-${version}"; name = "ocaml${ocaml.version}-angstrom-${version}";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "inhabitedtype"; owner = "inhabitedtype";
repo = "angstrom"; repo = "angstrom";
rev = "${version}"; rev = "${version}";
inherit (param) sha256; sha256 = "067r3vy5lac1bfx947gy722amna3dbcak54nlh24vx87pmcq31qc";
}; };
createFindlibDestdir = true; buildInputs = [ ocaml findlib jbuilder alcotest ];
propagatedBuildInputs = [ result ];
buildInputs = [ ocaml findlib ocamlbuild ]; buildPhase = "jbuilder build -p angstrom";
propagatedBuildInputs = [ result cstruct ];
doCheck = true;
checkPhase = "jbuilder runtest -p angstrom";
inherit (jbuilder) installPhase;
meta = { meta = {
homepage = https://github.com/inhabitedtype/angstrom; homepage = https://github.com/inhabitedtype/angstrom;