diff options
-rw-r--r-- | pkgs/development/tools/ocaml/js_of_ocaml-compiler/default.nix | 35 | ||||
-rw-r--r-- | pkgs/top-level/ocaml-packages.nix | 2 |
2 files changed, 37 insertions, 0 deletions
diff --git a/pkgs/development/tools/ocaml/js_of_ocaml-compiler/default.nix b/pkgs/development/tools/ocaml/js_of_ocaml-compiler/default.nix new file mode 100644 index 000000000000..11df26818c1f --- /dev/null +++ b/pkgs/development/tools/ocaml/js_of_ocaml-compiler/default.nix @@ -0,0 +1,35 @@ +{ stdenv, fetchFromGitHub, ocaml, findlib, jbuilder +, 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 { + name = "js_of_ocaml-compiler-${version}"; + version = "3.0.0"; + + src = fetchFromGitHub { + owner = "ocsigen"; + repo = "js_of_ocaml"; + rev = version; + sha256 = "17w1pqjk521jd4yp34miyif0cxjxchnw59xhj188qfl635ykb4k8"; + }; + + buildInputs = [ ocaml findlib jbuilder cmdliner cppo ]; + + propagatedBuildInputs = [ yojson ]; + + buildPhase = "jbuilder build -p js_of_ocaml-compiler"; + + inherit (jbuilder) 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; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 29f3ae51a0a3..9462eb3d3da8 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -272,6 +272,8 @@ let js_of_ocaml = callPackage ../development/tools/ocaml/js_of_ocaml { lwt = lwt2; }; + js_of_ocaml-compiler = callPackage ../development/tools/ocaml/js_of_ocaml-compiler {}; + jsonm = callPackage ../development/ocaml-modules/jsonm { }; lablgl = callPackage ../development/ocaml-modules/lablgl { }; |