2022-03-01 15:42:22 +00:00
|
|
|
{ lib, fetchurl, buildDunePackage, ocaml, findlib
|
2020-05-10 07:33:22 +00:00
|
|
|
, alcotest
|
2023-09-28 06:41:45 +00:00
|
|
|
, astring, cppo, fmt, logs, ocaml-version, camlp-streams, lwt, re, csexp
|
2022-10-23 11:08:32 +00:00
|
|
|
, gitUpdater
|
|
|
|
}:
|
2019-06-18 14:26:38 +00:00
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "mdx";
|
2024-03-14 08:14:35 +00:00
|
|
|
version = "2.4.1";
|
2019-06-18 14:26:38 +00:00
|
|
|
|
2022-02-24 16:43:54 +00:00
|
|
|
minimalOCamlVersion = "4.08";
|
|
|
|
|
2023-01-28 07:09:53 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/realworldocaml/mdx/releases/download/${version}/mdx-${version}.tbz";
|
2024-03-14 08:14:35 +00:00
|
|
|
hash = "sha256-GkDMkcxVPe0KIMmNQ0NUlTvbdZ7Mka02u7mn3QQSrxM=";
|
2019-06-18 14:26:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cppo ];
|
2023-07-04 11:56:44 +00:00
|
|
|
propagatedBuildInputs = [
|
2024-02-20 22:23:33 +00:00
|
|
|
astring fmt logs csexp ocaml-version camlp-streams re findlib
|
2023-07-04 11:56:44 +00:00
|
|
|
];
|
2022-03-01 15:42:22 +00:00
|
|
|
checkInputs = [ alcotest lwt ];
|
2019-09-20 05:28:52 +00:00
|
|
|
|
2023-01-28 07:09:53 +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 = ''
|
2021-07-21 11:03:52 +00: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
|
|
|
'';
|
|
|
|
|
2022-10-23 11:08:32 +00:00
|
|
|
passthru.updateScript = gitUpdater { };
|
|
|
|
|
2019-06-18 14:26:38 +00:00
|
|
|
meta = {
|
|
|
|
description = "Executable OCaml code blocks inside markdown files";
|
2022-05-18 00:57:46 +00:00
|
|
|
homepage = "https://github.com/realworldocaml/mdx";
|
2021-09-11 04:20:00 +00:00
|
|
|
changelog = "https://github.com/realworldocaml/mdx/raw/${version}/CHANGES.md";
|
2019-09-20 05:28:52 +00:00
|
|
|
license = lib.licenses.isc;
|
|
|
|
maintainers = [ lib.maintainers.romildo ];
|
2022-05-18 00:57:46 +00:00
|
|
|
mainProgram = "ocaml-mdx";
|
2019-06-18 14:26:38 +00:00
|
|
|
};
|
|
|
|
}
|