git.iko.soy/typeable/nixpkgs
on master help sign in
ocaml : add 4.03 compiler
commit08b85f5f9917cad708faab7fc81b1c155d478328 authorThéophane Hufschmitt <theophane.hufschmitt@polytechnique.org> dateWed 13 Jul 2016, 14:52 (10 years ago) parent2cb301d
5 files changed+109−159
pkgs/development/compilers/ocaml/4.01.0.nix+5−80 pkgs/development/compilers/ocaml/4.02.nix+5−78 pkgs/development/compilers/ocaml/4.03.nix+6 pkgs/development/compilers/ocaml/generic.nix+89 pkgs/top-level/all-packages.nix+4−1
pkgs/development/compilers/ocaml/4.01.0.nix+5−80
@@ -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}
pkgs/development/compilers/ocaml/4.02.nix+5−78
@@ -1,80 +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−assert useX11 -> !stdenv.isArm && !stdenv.isMips;
8−
9−let
10− useNativeCompilers = !stdenv.isMips;
11− inherit (stdenv.lib) optionals optionalString;
12−in
13−
14−stdenv.mkDerivation rec {
15−
16− x11env = buildEnv { name = "x11env"; paths = [libX11 xproto]; };
17− x11lib = x11env + "/lib";
18− x11inc = x11env + "/include";
19−
20− name = "ocaml-4.02.3";
21−
22− src = fetchurl {
23− url = "http://caml.inria.fr/pub/distrib/ocaml-4.02/${name}.tar.xz";
24− sha256 = "1qwwvy8nzd87hk8rd9sm667nppakiapnx4ypdwcrlnav2dz6kil3";
25− };
26−
1+import ./generic.nix rec {
2+ major_version = "4";
3+ minor_version = "02";
4+ patch_version = "0";
275 patches = [ ./ocamlbuild.patch ];
28−
29− prefixKey = "-prefix ";
30− configureFlags = optionals useX11 [ "-x11lib" x11lib
31− "-x11include" x11inc ];
32−
33− buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt";
34− buildInputs = [ncurses] ++ optionals useX11 [ libX11 xproto ];
35− installTargets = "install" + optionalString useNativeCompilers " installopt";
36− preConfigure = ''
37− CAT=$(type -tp cat)
38− sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang
39− '';
40− postBuild = ''
41− mkdir -p $out/include
42− ln -sv $out/lib/ocaml/caml $out/include/caml
43− '';
44−
45− passthru = {
46− nativeCompilers = useNativeCompilers;
47− };
48−
49− meta = with stdenv.lib; {
50− homepage = http://caml.inria.fr/ocaml;
51− branch = "4.02";
52− license = with licenses; [
53− qpl /* compiler */
54− lgpl2 /* library */
55− ];
56− description = "Most popular variant of the Caml language";
57−
58− longDescription =
59− ''
60− OCaml is the most popular variant of the Caml language. From a
61− language standpoint, it extends the core Caml language with a
62− fully-fledged object-oriented layer, as well as a powerful module
63− system, all connected by a sound, polymorphic type system featuring
64− type inference.
65−
66− The OCaml system is an industrial-strength implementation of this
67− language, featuring a high-performance native-code compiler (ocamlopt)
68− for 9 processor architectures (IA32, PowerPC, AMD64, Alpha, Sparc,
69− Mips, IA64, HPPA, StrongArm), as well as a bytecode compiler (ocamlc)
70− and an interactive read-eval-print loop (ocaml) for quick development
71− and portability. The OCaml distribution includes a comprehensive
72− standard library, a replay debugger (ocamldebug), lexer (ocamllex) and
73− parser (ocamlyacc) generators, a pre-processor pretty-printer (camlp4)
74− and a documentation generator (ocamldoc).
75− '';
76−
77− platforms = with platforms; linux ++ darwin;
78− };
79−
6+ sha256 = "1qwwvy8nzd87hk8rd9sm667nppakiapnx4ypdwcrlnav2dz6kil3";
807}
pkgs/development/compilers/ocaml/4.03.nixnew file+6
@@ -0,0 +1,6 @@
1+import ./generic.nix rec {
2+ major_version = "4";
3+ minor_version = "03";
4+ patch_version = "0";
5+ sha256 = "09p3iwwi55r6rbrpyp8f0wmkb0ppcgw67yxw6yfky60524wayp39";
6+}
pkgs/development/compilers/ocaml/generic.nixnew file+89
@@ -0,0 +1,89 @@
1+{ minor_version, major_version, patch_version
2+, url ? null
3+, sha256, ...}@args:
4+let
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);
11+in
12+
13+{ stdenv, fetchurl, ncurses, buildEnv, libX11, xproto, useX11 ? safeX11 stdenv }:
14+
15+assert useX11 -> !stdenv.isArm && !stdenv.isMips;
16+
17+let
18+ useNativeCompilers = !stdenv.isMips;
19+ inherit (stdenv.lib) optionals optionalString;
20+ name = "ocaml-${version}";
21+in
22+
23+stdenv.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+
31+ src = fetchurl {
32+ url = real_url;
33+ inherit sha256;
34+ };
35+
36+ prefixKey = "-prefix ";
37+ configureFlags = optionals useX11 [ "-x11lib" x11lib
38+ "-x11include" x11inc ];
39+
40+ buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt";
41+ buildInputs = [ncurses] ++ optionals useX11 [ libX11 xproto ];
42+ installTargets = "install" + optionalString useNativeCompilers " installopt";
43+ preConfigure = ''
44+ CAT=$(type -tp cat)
45+ sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang
46+ '';
47+ postBuild = ''
48+ mkdir -p $out/include
49+ ln -sv $out/lib/ocaml/caml $out/include/caml
50+ '';
51+
52+ passthru = {
53+ nativeCompilers = useNativeCompilers;
54+ };
55+
56+ meta = with stdenv.lib; {
57+ homepage = http://caml.inria.fr/ocaml;
58+ branch = "4.03";
59+ license = with licenses; [
60+ qpl /* compiler */
61+ lgpl2 /* library */
62+ ];
63+ description = "Most popular variant of the Caml language";
64+
65+ longDescription =
66+ ''
67+ OCaml is the most popular variant of the Caml language. From a
68+ language standpoint, it extends the core Caml language with a
69+ fully-fledged object-oriented layer, as well as a powerful module
70+ system, all connected by a sound, polymorphic type system featuring
71+ type inference.
72+
73+ The OCaml system is an industrial-strength implementation of this
74+ language, featuring a high-performance native-code compiler (ocamlopt)
75+ for 9 processor architectures (IA32, PowerPC, AMD64, Alpha, Sparc,
76+ Mips, IA64, HPPA, StrongArm), as well as a bytecode compiler (ocamlc)
77+ and an interactive read-eval-print loop (ocaml) for quick development
78+ and portability. The OCaml distribution includes a comprehensive
79+ standard library, a replay debugger (ocamldebug), lexer (ocamllex) and
80+ parser (ocamlyacc) generators, a pre-processor pretty-printer (camlp4)
81+ and a documentation generator (ocamldoc).
82+ '';
83+
84+ platforms = with platforms; linux ++ darwin;
85+ };
86+
87+})
88+
89+
pkgs/top-level/all-packages.nix+4−1
@@ -4957,6 +4957,8 @@ in
49574957
49584958 ocaml_4_02 = callPackage ../development/compilers/ocaml/4.02.nix { };
49594959
4960+ ocaml_4_03 = callPackage ../development/compilers/ocaml/4.03.nix { };
4961+
49604962 orc = callPackage ../development/compilers/orc { };
49614963
49624964 metaocaml_3_09 = callPackage ../development/compilers/ocaml/metaocaml-3.09.nix { };
@@ -5439,7 +5441,8 @@ in
54395441 ocamlPackages_4_00_1 = mkOcamlPackages ocaml_4_00_1 pkgs.ocamlPackages_4_00_1;
54405442 ocamlPackages_4_01_0 = mkOcamlPackages ocaml_4_01_0 pkgs.ocamlPackages_4_01_0;
54415443 ocamlPackages_4_02 = mkOcamlPackages ocaml_4_02 pkgs.ocamlPackages_4_02;
5442− ocamlPackages_latest = ocamlPackages_4_02;
5444+ ocamlPackages_4_03 = mkOcamlPackages ocaml_4_03 pkgs.ocamlPackages_4_03;
5445+ ocamlPackages_latest = ocamlPackages_4_03;
54435446
54445447 ocaml_make = callPackage ../development/ocaml-modules/ocamlmake { };
54455448