diff --git a/pkgs/development/compilers/ocaml/4.01.0.nix b/pkgs/development/compilers/ocaml/4.01.0.nix index 0f8ed7deaa4..0f68014fad6 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 {