aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/tools/ocaml/js_of_ocaml
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2017-08-27 14:29:57 +0000
committerVincent Laporte <Vincent.Laporte@gmail.com>2017-08-27 14:29:57 +0000
commitef2c0f317a64bc43a8052296c903087ce4442c9e (patch)
tree57b26623cf0ec36a3ed75166d79ec99c7c23135d /pkgs/development/tools/ocaml/js_of_ocaml
parentaea7216cf8f20e97b27f25f5d501ac9595d62376 (diff)
js_of_ocaml-compiler: move
Diffstat (limited to 'pkgs/development/tools/ocaml/js_of_ocaml')
-rw-r--r--pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix b/pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix
new file mode 100644
index 00000000000..11df26818c1
--- /dev/null
+++ b/pkgs/development/tools/ocaml/js_of_ocaml/compiler.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;
+ };
+}