e7ec2969af
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
51 lines
1.4 KiB
Nix
51 lines
1.4 KiB
Nix
{ lib, fetchurl, buildDunePackage, ocaml, findlib
|
|
, alcotest
|
|
, astring, cppo, fmt, logs, ocaml-version, camlp-streams, lwt, re, csexp
|
|
, gitUpdater
|
|
}:
|
|
|
|
let
|
|
# Strip optional dependencies from logs to make the closure smaller as this
|
|
# package contains a binary
|
|
logs' = logs.override { jsooSupport = false; lwtSupport = false; };
|
|
|
|
in
|
|
|
|
buildDunePackage rec {
|
|
pname = "mdx";
|
|
version = "2.3.1";
|
|
|
|
minimalOCamlVersion = "4.08";
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/realworldocaml/mdx/releases/download/${version}/mdx-${version}.tbz";
|
|
hash = "sha256-mkCkX6p41H4pOSvU/sJg0UAWysGweOSrAW6jrcCXQ/M=";
|
|
};
|
|
|
|
nativeBuildInputs = [ cppo ];
|
|
propagatedBuildInputs = [
|
|
astring fmt logs' csexp ocaml-version camlp-streams re findlib
|
|
];
|
|
checkInputs = [ alcotest lwt ];
|
|
|
|
doCheck = true;
|
|
|
|
outputs = [ "bin" "lib" "out" ];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
dune install --prefix=$bin --libdir=$lib/lib/ocaml/${ocaml.version}/site-lib ${pname}
|
|
runHook postInstall
|
|
'';
|
|
|
|
passthru.updateScript = gitUpdater { };
|
|
|
|
meta = {
|
|
description = "Executable OCaml code blocks inside markdown files";
|
|
homepage = "https://github.com/realworldocaml/mdx";
|
|
changelog = "https://github.com/realworldocaml/mdx/raw/${version}/CHANGES.md";
|
|
license = lib.licenses.isc;
|
|
maintainers = [ lib.maintainers.romildo ];
|
|
mainProgram = "ocaml-mdx";
|
|
};
|
|
}
|