depot/pkgs/development/ocaml-modules/mdx/default.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

44 lines
1.2 KiB
Nix

{ lib, fetchurl, buildDunePackage, ocaml, findlib
, alcotest
, astring, cppo, fmt, logs, ocaml-version, camlp-streams, lwt, re, csexp
, gitUpdater
}:
buildDunePackage rec {
pname = "mdx";
version = "2.4.1";
minimalOCamlVersion = "4.08";
src = fetchurl {
url = "https://github.com/realworldocaml/mdx/releases/download/${version}/mdx-${version}.tbz";
hash = "sha256-GkDMkcxVPe0KIMmNQ0NUlTvbdZ7Mka02u7mn3QQSrxM=";
};
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";
};
}