From 9b76c5e17a1440287235173aadf7fac74b756789 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sat, 23 Nov 2019 07:19:42 +0000 Subject: [PATCH] OCaml: fix configure flags for flambda support The configure program for OCaml has been using a new set of command-line arguments from version 4.08. This is a small refactoring to ease dealing with the two sets. --- pkgs/development/compilers/ocaml/generic.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/ocaml/generic.nix b/pkgs/development/compilers/ocaml/generic.nix index 9557d0a79aeb..4b68094647a7 100644 --- a/pkgs/development/compilers/ocaml/generic.nix +++ b/pkgs/development/compilers/ocaml/generic.nix @@ -41,11 +41,15 @@ stdenv.mkDerivation (args // { }; prefixKey = "-prefix "; - configureFlags = optionals useX11 ( - if stdenv.lib.versionAtLeast version "4.08" - then [ "--x-libraries=${x11lib}" "--x-includes=${x11inc}"] - else [ "-x11lib" x11lib "-x11include" x11inc ]) - ++ optional flambdaSupport "-flambda" + configureFlags = + let flags = new: old: + if stdenv.lib.versionAtLeast version "4.08" + then new else old + ; in + optionals useX11 (flags + [ "--x-libraries=${x11lib}" "--x-includes=${x11inc}"] + [ "-x11lib" x11lib "-x11include" x11inc ]) + ++ optional flambdaSupport (flags "--enable-flambda" "-flambda") ; buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt";