From efcb39233debaa9aa2d382c1710811bd71afda15 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Wed, 20 Dec 2017 22:43:24 +0000 Subject: [PATCH] ocaml: adds an argument to enable flambda --- pkgs/development/compilers/ocaml/generic.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/ocaml/generic.nix b/pkgs/development/compilers/ocaml/generic.nix index 17b3033c31df..03ae6e518d0b 100644 --- a/pkgs/development/compilers/ocaml/generic.nix +++ b/pkgs/development/compilers/ocaml/generic.nix @@ -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 ];