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