From 93e319f5e43beff3256c90a98c99f16a26d4f2ef Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Thu, 29 Jun 2023 17:32:02 +0300 Subject: [PATCH] libepoxy: fix x11 support on darwin --- pkgs/development/libraries/libepoxy/default.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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 ''