2016-10-09 19:10:46 +01:00
|
|
|
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, camlp4, ocaml_react
|
|
|
|
, lambdaTerm, ocaml_lwt, makeWrapper, camomile, zed, cppo, ppx_tools
|
2014-07-20 17:23:42 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-02-24 19:21:29 +00:00
|
|
|
version = "1.19.3";
|
2014-07-20 17:23:42 +01:00
|
|
|
name = "utop-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2015-07-28 16:31:44 +01:00
|
|
|
url = "https://github.com/diml/utop/archive/${version}.tar.gz";
|
2017-02-24 19:21:29 +00:00
|
|
|
sha256 = "16z02vp9n97iax4fqpbi7v86r75vbabxvnd1rirh8w2miixs1g4x";
|
2014-07-20 17:23:42 +01:00
|
|
|
};
|
|
|
|
|
2016-10-09 19:10:46 +01:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild makeWrapper cppo camlp4 ppx_tools ];
|
2014-07-20 17:23:42 +01:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ lambdaTerm ocaml_lwt ];
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
2016-06-05 20:18:23 +01:00
|
|
|
configureFlags = [ "--enable-camlp4" ]
|
2017-02-24 19:21:29 +00:00
|
|
|
++ stdenv.lib.optional (ppx_tools != null && !stdenv.lib.versionAtLeast ocaml.version "4.04") "--enable-interact";
|
2015-07-28 16:31:44 +01:00
|
|
|
|
2014-07-20 17:23:42 +01:00
|
|
|
buildPhase = ''
|
|
|
|
make
|
|
|
|
make doc
|
|
|
|
'';
|
|
|
|
|
2017-04-01 06:39:13 +01:00
|
|
|
dontStrip = true;
|
|
|
|
|
2014-07-20 17:23:42 +01:00
|
|
|
postFixup =
|
2017-04-01 06:39:13 +01:00
|
|
|
let p = p: "${p}/lib/ocaml/${ocaml.version}/site-lib"; in
|
2014-07-20 17:23:42 +01:00
|
|
|
''
|
2017-04-01 06:39:13 +01:00
|
|
|
pushd $out/bin
|
|
|
|
for prog in *
|
2015-01-27 06:51:30 +00:00
|
|
|
do
|
2017-04-01 06:39:13 +01:00
|
|
|
mv $prog .$prog-wrapped
|
|
|
|
cat > $prog <<EOF
|
|
|
|
#!/bin/sh
|
|
|
|
export CAML_LD_LIBRARY_PATH=${p ocaml_lwt}/lwt:${p lambdaTerm}/lambda-term:'\$CAML_LD_LIBRARY_PATH'
|
|
|
|
export OCAMLPATH=${p ocaml_lwt}:${p ocaml_react}:${p camomile}:${p zed}:${p lambdaTerm}:"$out"/lib/ocaml/${ocaml.version}/site-lib:'\$OCAMLPATH'
|
|
|
|
${ocaml}/bin/ocamlrun $out/bin/.$prog-wrapped \$*
|
|
|
|
EOF
|
|
|
|
chmod +x $prog
|
2015-01-27 06:51:30 +00:00
|
|
|
done
|
2017-04-01 06:39:13 +01:00
|
|
|
popd
|
2015-01-27 06:51:30 +00:00
|
|
|
'';
|
2014-07-20 17:23:42 +01:00
|
|
|
|
|
|
|
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;
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2014-07-20 17:23:42 +01:00
|
|
|
maintainers = [
|
|
|
|
stdenv.lib.maintainers.gal_bolle
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|