ocaml: adds an argument to enable flambda
This commit is contained in:
parent
76c146c990
commit
efcb39233d
1 changed files with 10 additions and 4 deletions
|
@ -10,14 +10,18 @@ let
|
|||
safeX11 = stdenv: !(stdenv.isArm || stdenv.isMips);
|
||||
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 flambdaSupport -> stdenv.lib.versionAtLeast version "4.03";
|
||||
|
||||
let
|
||||
useNativeCompilers = !stdenv.isMips;
|
||||
inherit (stdenv.lib) optionals optionalString;
|
||||
name = "ocaml-${version}";
|
||||
inherit (stdenv.lib) optional optionals optionalString;
|
||||
name = "ocaml${optionalString flambdaSupport "+flambda"}-${version}";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation (args // rec {
|
||||
|
@ -36,7 +40,9 @@ stdenv.mkDerivation (args // rec {
|
|||
|
||||
prefixKey = "-prefix ";
|
||||
configureFlags = optionals useX11 [ "-x11lib" x11lib
|
||||
"-x11include" x11inc ];
|
||||
"-x11include" x11inc ]
|
||||
++ optional flambdaSupport "-flambda"
|
||||
;
|
||||
|
||||
buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt";
|
||||
buildInputs = [ncurses] ++ optionals useX11 [ libX11 xproto ];
|
||||
|
|
Loading…
Reference in a new issue