Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / compilers / ocaml / 4.00.1.nix
blob93e08740ddd822c9f1fa98db3a7df1c3ea8074c9
1 { lib, stdenv, fetchurl, ncurses, xlibsWrapper }:
3 let
4    useX11 = !stdenv.isAarch32 && !stdenv.isMips;
5    useNativeCompilers = !stdenv.isMips;
6    inherit (lib) optional optionals optionalString;
7 in
9 stdenv.mkDerivation rec {
10   pname = "ocaml";
11   version = "4.00.1";
13   src = fetchurl {
14     url = "https://caml.inria.fr/pub/distrib/ocaml-4.00/${pname}-${version}.tar.bz2";
15     sha256 = "33c3f4acff51685f5bfd7c260f066645e767d4e865877bf1613c176a77799951";
16   };
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";
23   preConfigure = ''
24     CAT=$(type -tp cat)
25     sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang
26   '';
27   postBuild = ''
28     mkdir -p $out/include
29     ln -sv $out/lib/ocaml/caml $out/include/caml
30   '';
32   passthru = {
33     nativeCompilers = useNativeCompilers;
34   };
36   meta = with lib; {
37     homepage = "http://caml.inria.fr/ocaml";
38     branch = "4.00";
39     license = with licenses; [
40       qpl /* compiler */
41       lgpl2 /* library */
42     ];
43     description = "Most popular variant of the Caml language";
45     longDescription =
46       ''
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
51         type inference.
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).
62       '';
64     platforms = with platforms; linux;
65   };