summary refs log tree commit diff
path: root/pkgs/development/tools/ocaml/utop/default.nix
diff options
context:
space:
mode:
authorFlorent Becker <florent.becker@ens-lyon.org>2014-07-20 18:23:42 +0200
committerMichael Raskin <7c6f434c@mail.ru>2014-08-30 19:37:15 +0400
commitd7b67d8cfad6f9021f2eacee4402d6bb51d18b7e (patch)
tree472030b0b279c4516710bf2b022e113494d73bbc /pkgs/development/tools/ocaml/utop/default.nix
parent328469aa06539b6917bca1374ab9a621a0b0ed8a (diff)
downloadnixpkgs-d7b67d8cfad6f9021f2eacee4402d6bb51d18b7e.tar
nixpkgs-d7b67d8cfad6f9021f2eacee4402d6bb51d18b7e.tar.gz
nixpkgs-d7b67d8cfad6f9021f2eacee4402d6bb51d18b7e.tar.bz2
nixpkgs-d7b67d8cfad6f9021f2eacee4402d6bb51d18b7e.tar.lz
nixpkgs-d7b67d8cfad6f9021f2eacee4402d6bb51d18b7e.tar.xz
nixpkgs-d7b67d8cfad6f9021f2eacee4402d6bb51d18b7e.tar.zst
nixpkgs-d7b67d8cfad6f9021f2eacee4402d6bb51d18b7e.zip
add utop (improved ocaml toplevel)
Diffstat (limited to 'pkgs/development/tools/ocaml/utop/default.nix')
-rw-r--r--pkgs/development/tools/ocaml/utop/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/development/tools/ocaml/utop/default.nix b/pkgs/development/tools/ocaml/utop/default.nix
new file mode 100644
index 00000000000..1b99c4d4d43
--- /dev/null
+++ b/pkgs/development/tools/ocaml/utop/default.nix
@@ -0,0 +1,46 @@
+{stdenv, fetchurl, ocaml, findlib, lambdaTerm, ocaml_lwt, makeWrapper,
+ ocaml_react, camomile, zed
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.14";
+  name = "utop-${version}";
+
+  src = fetchurl {
+    url = https://github.com/diml/utop/archive/1.14.tar.gz;
+    sha256 = "17dqinvdrpba2fjs7sl6gxs47rrx6j8a5bbjhc7flp6bdls898zk";
+  };
+
+  buildInputs = [ ocaml findlib makeWrapper];
+
+  propagatedBuildInputs = [ lambdaTerm ocaml_lwt ];
+
+  createFindlibDestdir = true;
+
+  buildPhase = ''
+    make
+    make doc
+    '';
+
+  postFixup =
+  let ocamlVersion = (builtins.parseDrvName (ocaml.name)).version;
+  in
+   ''
+    wrapProgram "$out"/bin/utop --set CAML_LD_LIBRARY_PATH "${ocaml_lwt}"/lib/ocaml/${ocamlVersion}/site-lib/lwt/:"${lambdaTerm}"/lib/ocaml/${ocamlVersion}/site-lib/lambda-term/:'$CAML_LD_LIBRARY_PATH' --set OCAMLPATH "${ocaml_lwt}"/lib/ocaml/${ocamlVersion}/site-lib:${ocaml_react}/lib/ocaml/${ocamlVersion}/site-lib:${camomile}/lib/ocaml/${ocamlVersion}/site-lib:${zed}/lib/ocaml/${ocamlVersion}/site-lib:${lambdaTerm}/lib/ocaml/${ocamlVersion}/site-lib:"$out"/lib/ocaml/${ocamlVersion}/site-lib:'$OCAMLPATH'
+    '';
+
+  meta = {
+    description = "Universal toplevel for OCaml";
+    longDescription = ''
+    utop is an improved toplevel for OCaml. It can run in a terminal or in Emacs. It supports line edition, history, real-time and context sensitive completion, colors, and more.
+
+    It integrates with the tuareg mode in Emacs.
+    '';
+    homepage = https://github.com/diml/utop;
+    license = stdenv.lib.licenses.bsd3;
+    platforms = ocaml.meta.platforms;
+    maintainers = [
+      stdenv.lib.maintainers.gal_bolle
+    ];
+  };
+}