2021-07-24 12:14:16 +00:00
|
|
|
{ lib, fetchurl, buildDunePackage, ocaml
|
2020-05-15 21:57:56 +00:00
|
|
|
, alcotest
|
2021-09-18 10:52:07 +00:00
|
|
|
, astring, cmdliner, cppo, fmt, logs, ocaml-version, odoc-parser, ocaml_lwt, re, result, csexp
|
2021-02-13 14:23:35 +00:00
|
|
|
, pandoc}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "mdx";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "1.11.0";
|
2020-08-20 17:08:02 +00:00
|
|
|
useDune2 = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-05-15 21:57:56 +00:00
|
|
|
url = "https://github.com/realworldocaml/mdx/releases/download/${version}/mdx-${version}.tbz";
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "1hk8ffh3d9hiibrj6691khnbmjnfs9psmiawnrbgi0577bw030wx";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cppo ];
|
|
|
|
buildInputs = [ cmdliner ];
|
2021-09-18 10:52:07 +00:00
|
|
|
propagatedBuildInputs = [ astring fmt logs result csexp ocaml-version odoc-parser re ];
|
2020-05-15 21:57:56 +00:00
|
|
|
checkInputs = [ alcotest ocaml_lwt pandoc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
outputs = [ "bin" "lib" "out" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-07-24 12:14:16 +00:00
|
|
|
runHook preInstall
|
|
|
|
dune install --prefix=$bin --libdir=$lib/lib/ocaml/${ocaml.version}/site-lib ${pname}
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/realworldocaml/mdx";
|
|
|
|
description = "Executable OCaml code blocks inside markdown files";
|
2021-09-18 10:52:07 +00:00
|
|
|
changelog = "https://github.com/realworldocaml/mdx/raw/${version}/CHANGES.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = lib.licenses.isc;
|
|
|
|
maintainers = [ lib.maintainers.romildo ];
|
|
|
|
};
|
|
|
|
}
|