1 { lib, stdenv, fetchurl, ncurses, xlibsWrapper }:
4 useX11 = !stdenv.isAarch32 && !stdenv.isMips;
5 useNativeCompilers = !stdenv.isMips;
6 inherit (lib) optional optionals optionalString;
9 stdenv.mkDerivation rec {
14 url = "https://caml.inria.fr/pub/distrib/ocaml-4.00/${pname}-${version}.tar.bz2";
15 sha256 = "33c3f4acff51685f5bfd7c260f066645e767d4e865877bf1613c176a77799951";
18 prefixKey = "-prefix ";
19 configureFlags = [ "-no-tk" ] ++ optionals useX11 [ "-x11lib" xlibsWrapper ];
20 buildFlags = [ "world" ] ++ optionals useNativeCompilers [ "bootstrap" "world.opt" ];
21 buildInputs = [ ncurses ] ++ optional useX11 xlibsWrapper;
22 installTargets = "install" + optionalString useNativeCompilers " installopt";
25 sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang
29 ln -sv $out/lib/ocaml/caml $out/include/caml
33 nativeCompilers = useNativeCompilers;
37 homepage = "http://caml.inria.fr/ocaml";
39 license = with licenses; [
43 description = "Most popular variant of the Caml language";
47 OCaml is the most popular variant of the Caml language. From a
48 language standpoint, it extends the core Caml language with a
49 fully-fledged object-oriented layer, as well as a powerful module
50 system, all connected by a sound, polymorphic type system featuring
53 The OCaml system is an industrial-strength implementation of this
54 language, featuring a high-performance native-code compiler (ocamlopt)
55 for 9 processor architectures (IA32, PowerPC, AMD64, Alpha, Sparc,
56 Mips, IA64, HPPA, StrongArm), as well as a bytecode compiler (ocamlc)
57 and an interactive read-eval-print loop (ocaml) for quick development
58 and portability. The OCaml distribution includes a comprehensive
59 standard library, a replay debugger (ocamldebug), lexer (ocamllex) and
60 parser (ocamlyacc) generators, a pre-processor pretty-printer (camlp4)
61 and a documentation generator (ocamldoc).
64 platforms = with platforms; linux;