2023-02-09 11:40:11 +00:00
|
|
|
{ lib, fetchurl, buildDunePackage, ocaml, findlib
|
2020-05-15 21:57:56 +00:00
|
|
|
, alcotest
|
2023-10-09 19:29:22 +00:00
|
|
|
, astring, cppo, fmt, logs, ocaml-version, camlp-streams, lwt, re, csexp
|
2022-10-30 15:09:59 +00:00
|
|
|
, gitUpdater
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "mdx";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.4.1";
|
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
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/realworldocaml/mdx/releases/download/${version}/mdx-${version}.tbz";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-GkDMkcxVPe0KIMmNQ0NUlTvbdZ7Mka02u7mn3QQSrxM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cppo ];
|
2024-01-13 08:15:51 +00:00
|
|
|
propagatedBuildInputs = [
|
2024-02-29 20:09:43 +00:00
|
|
|
astring fmt logs csexp ocaml-version camlp-streams re findlib
|
2024-01-13 08:15:51 +00:00
|
|
|
];
|
2023-02-09 11:40:11 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|