2019-12-07 06:54:48 +00:00
|
|
|
{ lib, fetchurl, buildDunePackage, opaline, ocaml
|
2020-05-10 07:33:22 +00:00
|
|
|
, alcotest
|
2020-07-26 12:09:09 +00:00
|
|
|
, astring, cmdliner, cppo, fmt, logs, ocaml-migrate-parsetree, ocaml-version, odoc, ocaml_lwt, pandoc, re }:
|
2019-06-18 14:26:38 +00:00
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "mdx";
|
2020-07-26 12:09:09 +00:00
|
|
|
version = "1.7.0";
|
|
|
|
useDune2 = true;
|
2019-06-18 14:26:38 +00:00
|
|
|
|
2019-12-07 06:54:48 +00:00
|
|
|
src = fetchurl {
|
2020-05-10 07:33:22 +00:00
|
|
|
url = "https://github.com/realworldocaml/mdx/releases/download/${version}/mdx-${version}.tbz";
|
2020-07-26 12:09:09 +00:00
|
|
|
sha256 = "0vpc30sngl3vpychrfvjwyi93mk311x3f2azlkxasgcj69fq03i7";
|
2019-06-18 14:26:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cppo ];
|
2019-12-07 06:54:48 +00:00
|
|
|
buildInputs = [ cmdliner ];
|
2020-07-26 12:09:09 +00:00
|
|
|
propagatedBuildInputs = [ astring fmt logs ocaml-migrate-parsetree ocaml-version odoc re ];
|
2020-05-10 07:33:22 +00:00
|
|
|
checkInputs = [ alcotest ocaml_lwt pandoc ];
|
2019-09-20 05:28:52 +00:00
|
|
|
|
2019-12-07 06:54:48 +00:00
|
|
|
doCheck = true;
|
2019-06-18 14:26:38 +00:00
|
|
|
|
2019-12-07 06:54:48 +00:00
|
|
|
outputs = [ "bin" "lib" "out" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
${opaline}/bin/opaline -prefix $bin -libdir $lib/lib/ocaml/${ocaml.version}/site-lib
|
|
|
|
'';
|
|
|
|
|
2019-06-18 14:26:38 +00:00
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/realworldocaml/mdx";
|
2019-06-18 14:26:38 +00:00
|
|
|
description = "Executable OCaml code blocks inside markdown files";
|
2019-09-20 05:28:52 +00:00
|
|
|
license = lib.licenses.isc;
|
|
|
|
maintainers = [ lib.maintainers.romildo ];
|
2019-06-18 14:26:38 +00:00
|
|
|
};
|
|
|
|
}
|