about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules/mdx/default.nix
blob: 43c6c8e41fa734754949d6612a78cef261170e1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ lib, fetchurl, buildDunePackage, opaline, ocaml
, astring, cmdliner, cppo, fmt, logs, ocaml-migrate-parsetree, ocaml-version, ocaml_lwt, pandoc, re }:

buildDunePackage rec {
  pname = "mdx";
  version = "1.5.0";

  src = fetchurl {
    url = "https://github.com/realworldocaml/mdx/releases/download/1.5.0/mdx-1.5.0.tbz";
    sha256 = "0g45plf4z7d178gp0bx7842fwbd3m19679yfph3s95da6mrfm3xn";
  };

  nativeBuildInputs = [ cppo ];
  buildInputs = [ cmdliner ];
  propagatedBuildInputs = [ astring fmt logs ocaml-migrate-parsetree ocaml-version re ];
  checkInputs = lib.optionals doCheck [ ocaml_lwt pandoc ];

  doCheck = true;

  dontStrip = lib.versions.majorMinor ocaml.version == "4.04";

  outputs = [ "bin" "lib" "out" ];

  installPhase = ''
    ${opaline}/bin/opaline -prefix $bin -libdir $lib/lib/ocaml/${ocaml.version}/site-lib
  '';

  meta = {
    homepage = https://github.com/realworldocaml/mdx;
    description = "Executable OCaml code blocks inside markdown files";
    license = lib.licenses.isc;
    maintainers = [ lib.maintainers.romildo ];
  };
}