From 08f59327291df52f3644744a6b373513e502f880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 12 Aug 2014 21:53:02 +0200 Subject: [PATCH] ocaml: refactor the useX11 check to actually work --- pkgs/development/compilers/ocaml/4.01.0.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/ocaml/4.01.0.nix b/pkgs/development/compilers/ocaml/4.01.0.nix index 0f8ed7deaa4b..0f68014fad64 100644 --- a/pkgs/development/compilers/ocaml/4.01.0.nix +++ b/pkgs/development/compilers/ocaml/4.01.0.nix @@ -1,12 +1,16 @@ -{ stdenv, fetchurl, ncurses, buildEnv, libX11, xproto, - useX11 ? (!stdenv.isArm && !stdenv.isMips) }: +let + safeX11 = stdenv: !(stdenv.isArm || stdenv.isMips); +in + +{ stdenv, fetchurl, ncurses, buildEnv, libX11, xproto, useX11 ? safeX11 stdenv }: + +if useX11 && !(safeX11 stdenv) + then throw "x11 not available in ocaml with arm or mips arch" + else # let the indentation flow let useNativeCompilers = !stdenv.isMips; inherit (stdenv.lib) optionals optionalString; - x11Ok = if useX11 && (!stdenv.isArm && !stdenv.isMips) - then throw "x11 not available in ocaml with arm or mips arch" - else true; in stdenv.mkDerivation rec {