nixpkgs/pkgs/development/ocaml-modules/mdx/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, fetchurl, buildDunePackage, ocaml, findlib
2020-05-10 07:33:22 +00:00
, alcotest
2023-01-28 07:09:53 +00:00
, astring, cppo, fmt, logs, ocaml-version, odoc-parser, lwt, re, csexp
2022-10-23 11:08:32 +00:00
, gitUpdater
}:
2019-06-18 14:26:38 +00:00
buildDunePackage rec {
pname = "mdx";
2023-01-28 07:09:53 +00:00
version = "2.2.1";
2019-06-18 14:26:38 +00:00
minimalOCamlVersion = "4.08";
2023-01-28 07:09:53 +00:00
duneVersion = "3";
2023-01-28 07:09:53 +00:00
src = fetchurl {
url = "https://github.com/realworldocaml/mdx/releases/download/${version}/mdx-${version}.tbz";
hash = "sha256-8J7XM/5EYWBfApdzdIpjU9Ablb5l65hrzOF9bdr1Cdg=";
2019-06-18 14:26:38 +00:00
};
nativeBuildInputs = [ cppo ];
propagatedBuildInputs = [ astring fmt logs csexp ocaml-version odoc-parser re findlib ];
checkInputs = [ alcotest lwt ];
2023-01-28 07:09:53 +00:00
doCheck = true;
2019-06-18 14:26:38 +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
'';
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";
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";
2019-06-18 14:26:38 +00:00
};
}