Skip to content

Commit

Permalink
ocamlPackages.melange: init at 4.0.1-52 + 4.0.0-51 + 4.0.0-414
Browse files Browse the repository at this point in the history
  • Loading branch information
vog committed Nov 28, 2024
1 parent ac0c0e1 commit 97d45f9
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
83 changes: 83 additions & 0 deletions pkgs/development/tools/ocaml/melange/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
buildDunePackage,
cmdliner,
cppo,
dune-build-info,
fetchurl,
jq,
lib,
makeWrapper,
menhirLib,
merlin,
nodejs,
ocaml,
ounit2,
ppxlib,
reason,
stdenv,
tree,
}:

let
pname = "melange";
versionHash =
if lib.versionAtLeast ocaml.version "5.2" then
{
version = "4.0.1-52";
hash = "sha256-kUlChqQtLX7zh90GK23ibMqyI/MIp0sMYLjkPX9vdTc=";
}
else if lib.versionAtLeast ocaml.version "5.1" then
{
version = "4.0.0-51";
hash = "sha256-940Yzp1ZXnN6mKVWY+nqKjn4qtBUJR5eHE55OTjGvdU=";
}
else
{
version = "4.0.0-414";
hash = "sha256-PILDOXYIyLvfv1sSwP6WSdCiXfpYdnct7WMw3jHBLJM=";
};
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;
};
nativeBuildInputs = [
cppo
makeWrapper
];
propagatedBuildInputs = [
cmdliner
dune-build-info
menhirLib
ppxlib
];
doCheck = true;
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
];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/ocaml-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,8 @@ let

mec = callPackage ../development/ocaml-modules/mec { };

melange = callPackage ../development/tools/ocaml/melange { };

memprof-limits = callPackage ../development/ocaml-modules/memprof-limits { };

memtrace = callPackage ../development/ocaml-modules/memtrace { };
Expand Down

0 comments on commit 97d45f9

Please sign in to comment.