2023-02-02 18:25:31 +00:00
|
|
|
{ lib, fetchurl, buildDunePackage, ocaml
|
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-02-02 18:25:31 +00:00
|
|
|
version = "2.2.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
|
|
|
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";
|
|
|
|
hash = "sha256-8J7XM/5EYWBfApdzdIpjU9Ablb5l65hrzOF9bdr1Cdg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cppo ];
|
2023-02-02 18:25:31 +00:00
|
|
|
propagatedBuildInputs = [ astring fmt logs csexp ocaml-version odoc-parser re ];
|
|
|
|
nativeCheckInputs = [ 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
|
|
|
};
|
|
|
|
}
|