2023-02-09 11:40:11 +00:00
|
|
|
{ lib, fetchurl, buildDunePackage, ocaml, findlib
|
2020-05-15 21:57:56 +00:00
|
|
|
, alcotest
|
2023-02-02 18:25:31 +00:00
|
|
|
, astring, cppo, fmt, logs, ocaml-version, odoc-parser, lwt, re, csexp
|
2022-10-30 15:09:59 +00:00
|
|
|
, gitUpdater
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "mdx";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "2.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
minimalOCamlVersion = "4.08";
|
2023-02-02 18:25:31 +00:00
|
|
|
duneVersion = "3";
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/realworldocaml/mdx/releases/download/${version}/mdx-${version}.tbz";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-MqCDmBAK/S0ueYi8O0XJtplxJx96twiFHe04Q8lHBmE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cppo ];
|
2023-02-09 11:40:11 +00:00
|
|
|
propagatedBuildInputs = [ astring fmt logs csexp ocaml-version odoc-parser re findlib ];
|
|
|
|
checkInputs = [ alcotest lwt ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
doCheck = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
passthru.updateScript = gitUpdater { };
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "Executable OCaml code blocks inside markdown files";
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://github.com/realworldocaml/mdx";
|
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 ];
|
2022-06-16 17:23:12 +00:00
|
|
|
mainProgram = "ocaml-mdx";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|