diff --git a/pkgs/development/libraries/libepoxy/default.nix b/pkgs/development/libraries/libepoxy/default.nix index 3eb1d47c98d1..1636d6cd6c65 100644 --- a/pkgs/development/libraries/libepoxy/default.nix +++ b/pkgs/development/libraries/libepoxy/default.nix @@ -13,10 +13,6 @@ , x11Support ? !stdenv.isDarwin }: -let - inherit (lib) getLib optional optionalString; - -in stdenv.mkDerivation rec { pname = "libepoxy"; version = "1.5.10"; @@ -33,7 +29,7 @@ stdenv.mkDerivation rec { postPatch = '' patchShebangs src/*.py '' - + optionalString stdenv.isDarwin '' + + lib.optionalString stdenv.isDarwin '' substituteInPlace src/dispatch_common.h --replace "PLATFORM_HAS_GLX 0" "PLATFORM_HAS_GLX 1" ''; @@ -41,8 +37,9 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ meson ninja pkg-config utilmacros python3 ]; - buildInputs = lib.optionals x11Support [ + buildInputs = lib.optionals (x11Support && !stdenv.isDarwin) [ libGL + ] ++ lib.optionals x11Support [ libX11 ] ++ lib.optionals stdenv.isDarwin [ Carbon @@ -56,7 +53,7 @@ stdenv.mkDerivation rec { "-Dx11=${lib.boolToString x11Support}" ]; - env.NIX_CFLAGS_COMPILE = lib.optionalString x11Support ''-DLIBGL_PATH="${getLib libGL}/lib"''; + env.NIX_CFLAGS_COMPILE = lib.optionalString (x11Support && !stdenv.isDarwin) ''-DLIBGL_PATH="${lib.getLib libGL}/lib"''; # cgl_core and cgl_epoxy_api fail in darwin sandbox and on Hydra (because it's headless?) preCheck = lib.optionalString stdenv.isDarwin ''