diff --git a/pkgs/development/ocaml-modules/cmarkit/default.nix b/pkgs/development/ocaml-modules/cmarkit/default.nix new file mode 100644 index 00000000000..5015807361f --- /dev/null +++ b/pkgs/development/ocaml-modules/cmarkit/default.nix @@ -0,0 +1,48 @@ +{ lib +, stdenv +, cmdliner +, fetchurl +, findlib +, ocaml +, ocamlbuild +, topkg +}: + +if lib.versionOlder ocaml.version "4.14.0" +then throw "cmarkit is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "cmarkit"; + version = "0.1.0"; + + src = fetchurl { + url = "https://erratique.ch/software/cmarkit/releases/cmarkit-${version}.tbz"; + hash = "sha256-pLPCLlwJt5W5R92HPY8gGpisyjlbSaaEe0HLuJlkjuY="; + }; + + nativeBuildInputs = [ + ocaml + findlib + ocamlbuild + topkg + ]; + + buildInputs = [ + topkg + cmdliner + ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + meta = with lib; { + description = "CommonMark parser and renderer for OCaml"; + homepage = "https://erratique.ch/software/cmarkit"; + changelog = "https://github.com/dbuenzli/cmarkit/blob/v${version}/CHANGES.md"; + license = licenses.isc; + maintainers = [ maintainers.marsam ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 7f305b79e92..ef5f5d1e7aa 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -196,6 +196,8 @@ let class_group_vdf = callPackage ../development/ocaml-modules/class_group_vdf { }; + cmarkit = callPackage ../development/ocaml-modules/cmarkit { }; + # The 1.1.0 release broke a lot of packages and is not compatible with # OCaml < 4.08. cmdliner =