@@ -1,28 +1,19 @@
1−{ stdenv, fetchFromGitHub, which, ocaml, findlib, ocamlbuild }:
1+{ lib, fetchurl, buildDunePackage }:
22
3−if !stdenv.lib.versionAtLeast ocaml.version "4.03"
4−then throw "earley is not available for OCaml ${ocaml.version}"
5−else
6−
7−stdenv.mkDerivation rec {
8− version = "1.0.2";
9− name = "ocaml${ocaml.version}-earley-${version}";
10− src = fetchFromGitHub {
11− owner = "rlepigre";
12− repo = "ocaml-earley";
13− rev = "ocaml-earley_${version}";
14− sha256 = "110njakmx1hyq42hyr6gx6qhaxly860whfhd6r0vks4yfp68qvcx";
3+buildDunePackage rec {
4+ version = "2.0.0";
5+ pname = "earley";
6+ src = fetchurl {
7+ url = "https://github.com/rlepigre/ocaml-earley/releases/download/${version}/earley-${version}.tbz";
8+ sha256 = "1kjr0wh3lji7f493kf48rphxnlv3sygj5a8rmx9z3xkpbd7aqyyw";
159 };
1610
17− buildInputs = [ which ocaml findlib ocamlbuild ];
18−
19− createFindlibDestdir = true;
11+ minimumOCamlVersion = "4.03";
2012
2113 meta = {
2214 description = "Parser combinators based on Earley Algorithm";
23− license = stdenv.lib.licenses.cecill-b;
24− maintainers = [ stdenv.lib.maintainers.vbgl ];
25− inherit (ocaml.meta) platforms;
26− inherit (src.meta) homepage;
15+ license = lib.licenses.cecill-b;
16+ maintainers = [ lib.maintainers.vbgl ];
17+ homepage = "https://github.com/rlepigre/ocaml-earley";
2718 };
2819}