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