ocaml: refactor the useX11 check to actually work

This commit is contained in:
Vladimír Čunát 2014-08-12 21:53:02 +02:00
parent 141b5d961f
commit 08f5932729

View File

@ -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 {