ocaml: adds an argument to enable flambda

This commit is contained in:
Vincent Laporte 2017-12-20 22:43:24 +00:00 committed by Vincent Laporte
parent 76c146c990
commit efcb39233d

View file

@ -10,14 +10,18 @@ let
safeX11 = stdenv: !(stdenv.isArm || stdenv.isMips); safeX11 = stdenv: !(stdenv.isArm || stdenv.isMips);
in in
{ stdenv, fetchurl, ncurses, buildEnv, libX11, xproto, useX11 ? safeX11 stdenv }: { stdenv, fetchurl, ncurses, buildEnv
, libX11, xproto, useX11 ? safeX11 stdenv
, flambdaSupport ? false
}:
assert useX11 -> !stdenv.isArm && !stdenv.isMips; assert useX11 -> !stdenv.isArm && !stdenv.isMips;
assert flambdaSupport -> stdenv.lib.versionAtLeast version "4.03";
let let
useNativeCompilers = !stdenv.isMips; useNativeCompilers = !stdenv.isMips;
inherit (stdenv.lib) optionals optionalString; inherit (stdenv.lib) optional optionals optionalString;
name = "ocaml-${version}"; name = "ocaml${optionalString flambdaSupport "+flambda"}-${version}";
in in
stdenv.mkDerivation (args // rec { stdenv.mkDerivation (args // rec {
@ -36,7 +40,9 @@ stdenv.mkDerivation (args // rec {
prefixKey = "-prefix "; prefixKey = "-prefix ";
configureFlags = optionals useX11 [ "-x11lib" x11lib configureFlags = optionals useX11 [ "-x11lib" x11lib
"-x11include" x11inc ]; "-x11include" x11inc ]
++ optional flambdaSupport "-flambda"
;
buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt"; buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt";
buildInputs = [ncurses] ++ optionals useX11 [ libX11 xproto ]; buildInputs = [ncurses] ++ optionals useX11 [ libX11 xproto ];