3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix

36 lines
857 B
Nix
Raw Normal View History

2018-09-05 17:11:47 +01:00
{ stdenv, fetchFromGitHub, ocaml, findlib, dune
, cmdliner, cppo, yojson
}:
if !stdenv.lib.versionAtLeast ocaml.version "4.02"
then throw "js_of_ocaml-compiler is not available for OCaml ${ocaml.version}"
else
stdenv.mkDerivation rec {
pname = "js_of_ocaml-compiler";
version = "3.3.0";
src = fetchFromGitHub {
owner = "ocsigen";
repo = "js_of_ocaml";
rev = version;
sha256 = "0bg8x2s3f24c8ia2g293ikd5yg0yjw3hkdgdql59c8k2amqin8f8";
};
2018-09-05 17:11:47 +01:00
buildInputs = [ ocaml findlib dune cmdliner cppo ];
propagatedBuildInputs = [ yojson ];
2018-09-05 17:11:47 +01:00
buildPhase = "dune build -p js_of_ocaml-compiler";
2018-09-05 17:11:47 +01:00
inherit (dune) installPhase;
meta = {
description = "Compiler from OCaml bytecode to Javascript";
license = stdenv.lib.licenses.gpl2;
maintainers = [ stdenv.lib.maintainers.vbgl ];
inherit (src.meta) homepage;
inherit (ocaml.meta) platforms;
};
}