ocamlPackages.base_quickcheck: 0.17.0 → 0.17.1 ocamlPackages.optcomp: 0.17.0 → 0.17.1 ocamlPackages.ppx_bench: 0.17.0 → 0.17.1 ocamlPackages.ppx_bin_prot: 0.17.0 → 0.17.1 ocamlPackages.ppx_deriving: 6.0.3 → 6.1.0 ocamlPackages.ppx_deriving_qcheck: 0.6 → 0.7 ocamlPackages.ppx_deriving_yaml: 0.3.0 → 0.4.1 ocamlPackages.ppx_deriving_yojson: 3.9.0 → 3.10.0 ocamlPackages.ppx_diff: 0.17.0 → 0.17.1 ocamlPackages.ppx_expect: 0.17.2 → 0.17.3 ocamlPackages.ppx_globalize: 0.17.0 → 0.17.2 ocamlPackages.ppx_inline_test: 0.17.0 → 0.17.1 ocamlPackages.ppx_let: 0.17.0 → 0.17.1 ocamlPackages.ppx_stable: 0.17.0 → 0.17.1 ocamlPackages.ppx_tydi: 0.17.0 → 0.17.1 ocamlPackages.ppx_typeprep_conv: 0.17.0 → 0.17.1 ocamlPackages.ppx_variants_conv: 0.17.0 → 0.17.1 ocamlPackages.sexp_conv: 0.17.0 → 0.17.1 ocamlPackages.sexp_message: 0.17.2 → 0.17.4 reason: 3.15.0 → 3.16.0 ocamlPackages.bisect_ppx: make compatible with ppxlib 0.36 ocamlPackages.config: make compatible with ppxlib 0.36 ocamlPackages.lwt_ppx: make compatible with ppxlib 0.36 ocamlPackages.melange: make compatible with ppxlib 0.36 ocamlPackages.ppx_bitstring: make compatible with ppxlib 0.36 ocamlPackages.ppx_repr: make compatible with ppxlib 0.36 ocamlPackages.bistro: mark as broken ocamlPackages.dream-html: mark as broken ocamlPackages.ocsigen-ppx-rpc: mark as broken ocamlPackages.ppx_deriving_cmdliner: mark as broken ocamlPackages.reason-react-ppx: mark as broken
102 lines
2.2 KiB
Nix
102 lines
2.2 KiB
Nix
{
|
|
buildDunePackage,
|
|
cmdliner,
|
|
cppo,
|
|
dune-build-info,
|
|
fetchurl,
|
|
fetchpatch,
|
|
jq,
|
|
lib,
|
|
makeWrapper,
|
|
menhirLib,
|
|
merlin,
|
|
nodejs,
|
|
ocaml,
|
|
ounit2,
|
|
ppxlib,
|
|
reason,
|
|
stdenv,
|
|
tree,
|
|
}:
|
|
|
|
let
|
|
pname = "melange";
|
|
versionHash =
|
|
if lib.versionAtLeast ocaml.version "5.3" then
|
|
{
|
|
version = "5.1.0-53";
|
|
hash = "sha256-96rDDzul/v+Dc+IWTNtbOKWUV8rf7HS1ZMK2LQNcpKk=";
|
|
}
|
|
else if lib.versionAtLeast ocaml.version "5.2" then
|
|
{
|
|
version = "5.1.0-52";
|
|
hash = "sha256-EGIInGCo3JADYyE4mLw5Fzkm4OB+V9yi2ayV0lVq3v0=";
|
|
}
|
|
else if lib.versionAtLeast ocaml.version "5.1" then
|
|
{
|
|
version = "5.1.0-51";
|
|
hash = "sha256-DIF8vZLEKsFf6m5tl1/T6zqjHyKxDMois2h//tDhsJI=";
|
|
}
|
|
else if lib.versionAtLeast ocaml.version "5.0" then
|
|
throw "melange is not available for OCaml ${ocaml.version}"
|
|
else
|
|
{
|
|
version = "5.1.0-414";
|
|
hash = "sha256-Sv1XyOqCNhICTsXzetXh/zqX/tdTupYZ0Q1nZRLfpe0=";
|
|
};
|
|
version = versionHash.version;
|
|
hash = versionHash.hash;
|
|
in
|
|
buildDunePackage {
|
|
inherit pname;
|
|
inherit version;
|
|
minimalOCamlVersion = "4.14";
|
|
src = fetchurl {
|
|
url = "https://github.com/melange-re/${pname}/releases/download/${version}/${pname}-${version}.tbz";
|
|
inherit hash;
|
|
};
|
|
patches = lib.optional (lib.versionAtLeast ppxlib.version "0.36") (fetchpatch {
|
|
url = "https://patch-diff.githubusercontent.com/raw/melange-re/melange/pull/1352.patch";
|
|
hash = "sha256-PMf66nB743nzW4/xblHjNZFv1BS8xC9maD+eCDDUWAY=";
|
|
excludes = [
|
|
"*.opam"
|
|
"*.template"
|
|
];
|
|
});
|
|
nativeBuildInputs = [
|
|
cppo
|
|
makeWrapper
|
|
];
|
|
buildInputs = [
|
|
cmdliner
|
|
dune-build-info
|
|
];
|
|
propagatedBuildInputs = [
|
|
menhirLib
|
|
ppxlib
|
|
];
|
|
doCheck = false;
|
|
nativeCheckInputs = [
|
|
jq
|
|
merlin
|
|
nodejs
|
|
reason
|
|
tree
|
|
];
|
|
checkInputs = [
|
|
ounit2
|
|
];
|
|
postInstall = ''
|
|
wrapProgram "$out/bin/melc" --set MELANGELIB "$OCAMLFIND_DESTDIR/melange/melange:$OCAMLFIND_DESTDIR/melange/js/melange"
|
|
'';
|
|
meta = {
|
|
description = "Toolchain to produce JS from Reason/OCaml";
|
|
homepage = "https://melange.re/";
|
|
mainProgram = "melc";
|
|
license = lib.licenses.lgpl3;
|
|
maintainers = [
|
|
lib.maintainers.vog
|
|
];
|
|
};
|
|
}
|