nixpkgs-suyu/pkgs/development/ocaml-modules/mdx/default.nix
2020-05-10 09:33:22 +02:00

35 lines
1.1 KiB
Nix

{ lib, fetchurl, buildDunePackage, opaline, ocaml
, alcotest
, astring, cmdliner, cppo, fmt, logs, ocaml-migrate-parsetree, ocaml-version, ocaml_lwt, pandoc, re }:
buildDunePackage rec {
pname = "mdx";
version = "1.6.0";
src = fetchurl {
url = "https://github.com/realworldocaml/mdx/releases/download/${version}/mdx-${version}.tbz";
sha256 = "18m4ay226dwbgnwp3ia6bfcm033dvp9yby0lbddqn8ak374m2k3b";
};
nativeBuildInputs = [ cppo ];
buildInputs = [ cmdliner ];
propagatedBuildInputs = [ astring fmt logs ocaml-migrate-parsetree ocaml-version re ];
checkInputs = [ alcotest 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 ];
};
}