@@ -1,82 +1,7 @@
1−let
2− safeX11 = stdenv: !(stdenv.isArm || stdenv.isMips);
3−in
4−
5−{ stdenv, fetchurl, ncurses, buildEnv, libX11, xproto, useX11 ? safeX11 stdenv }:
6−
7−if useX11 && !(safeX11 stdenv)
8− then throw "x11 not available in ocaml with arm or mips arch"
9− else # let the indentation flow
10−
11−let
12− useNativeCompilers = !stdenv.isMips;
13− inherit (stdenv.lib) optionals optionalString;
14−in
15−
16−stdenv.mkDerivation rec {
17−
18− x11env = buildEnv { name = "x11env"; paths = [libX11 xproto]; };
19− x11lib = x11env + "/lib";
20− x11inc = x11env + "/include";
21−
22− name = "ocaml-4.01.0";
23−
24− src = fetchurl {
25− url = "http://caml.inria.fr/pub/distrib/ocaml-4.01/${name}.tar.bz2";
26− sha256 = "b1ca708994180236917ae79e17606da5bd334ca6acd6873a550027e1c0ec874a";
27− };
28−
1+import ./generic.nix rec {
2+ major_version = "4";
3+ minor_version = "01";
4+ patch_version = "0";
295 patches = [ ./fix-clang-build-on-osx.diff ];
30−
31− prefixKey = "-prefix ";
32− configureFlags = ["-no-tk"] ++ optionals useX11 [ "-x11lib" x11lib
33− "-x11include" x11inc ];
34−
35− buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt";
36− buildInputs = [ncurses] ++ optionals useX11 [ libX11 xproto ];
37− installTargets = "install" + optionalString useNativeCompilers " installopt";
38− preConfigure = ''
39− CAT=$(type -tp cat)
40− sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang
41− '';
42− postBuild = ''
43− mkdir -p $out/include
44− ln -sv $out/lib/ocaml/caml $out/include/caml
45− '';
46−
47− passthru = {
48− nativeCompilers = useNativeCompilers;
49− };
50−
51− meta = with stdenv.lib; {
52− homepage = http://caml.inria.fr/ocaml;
53− branch = "4.01";
54− license = with licenses; [
55− qpl /* compiler */
56− lgpl2 /* library */
57− ];
58− description = "Most popular variant of the Caml language";
59−
60− longDescription =
61− ''
62− OCaml is the most popular variant of the Caml language. From a
63− language standpoint, it extends the core Caml language with a
64− fully-fledged object-oriented layer, as well as a powerful module
65− system, all connected by a sound, polymorphic type system featuring
66− type inference.
67−
68− The OCaml system is an industrial-strength implementation of this
69− language, featuring a high-performance native-code compiler (ocamlopt)
70− for 9 processor architectures (IA32, PowerPC, AMD64, Alpha, Sparc,
71− Mips, IA64, HPPA, StrongArm), as well as a bytecode compiler (ocamlc)
72− and an interactive read-eval-print loop (ocaml) for quick development
73− and portability. The OCaml distribution includes a comprehensive
74− standard library, a replay debugger (ocamldebug), lexer (ocamllex) and
75− parser (ocamlyacc) generators, a pre-processor pretty-printer (camlp4)
76− and a documentation generator (ocamldoc).
77− '';
78−
79− platforms = with platforms; linux ++ darwin;
80− };
81−
6+ sha256 = "03d7ida94s1gpr3gadf4jyhmh5rrszd5s4m4z59daaib25rvfyv7";
827}