nixpkgs/pkgs/development/tools/ocaml/utop/default.nix

53 lines
1.8 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, camlp4, ocaml_react
, lambdaTerm, ocaml_lwt, makeWrapper, camomile, zed, cppo, ppx_tools
2014-07-20 18:23:42 +02:00
}:
stdenv.mkDerivation rec {
2016-06-05 21:18:23 +02:00
version = "1.19.2";
2014-07-20 18:23:42 +02:00
name = "utop-${version}";
src = fetchurl {
url = "https://github.com/diml/utop/archive/${version}.tar.gz";
2016-06-05 21:18:23 +02:00
sha256 = "0hxybkqmrh0sz1yyyrgzdmxp46gda4vk22pv07s0qpfg2dpv56jh";
2014-07-20 18:23:42 +02:00
};
buildInputs = [ ocaml findlib ocamlbuild makeWrapper cppo camlp4 ppx_tools ];
2014-07-20 18:23:42 +02:00
propagatedBuildInputs = [ lambdaTerm ocaml_lwt ];
createFindlibDestdir = true;
2016-06-05 21:18:23 +02:00
configureFlags = [ "--enable-camlp4" ]
++ stdenv.lib.optional (ppx_tools != null) "--enable-interact";
2014-07-20 18:23:42 +02:00
buildPhase = ''
make
make doc
'';
postFixup =
let ocamlVersion = (builtins.parseDrvName (ocaml.name)).version;
in
''
2015-01-27 07:51:30 +01:00
for prog in "$out"/bin/*
do
wrapProgram $prog --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'
done
'';
2014-07-20 18:23:42 +02: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;
platforms = ocaml.meta.platforms or [];
2014-07-20 18:23:42 +02:00
maintainers = [
stdenv.lib.maintainers.gal_bolle
];
};
}