From a0efdd21a1c4579642fb2ea1d24e541564ca792a Mon Sep 17 00:00:00 2001 From: Samuel Evans-Powell Date: Thu, 7 Dec 2023 11:58:17 +0800 Subject: [PATCH] vulkan-loader: Fix MinGW build - Fix mingwW64 build of vulkan-loader by not including X/wayland libraries on windows. Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com> --- pkgs/development/libraries/vulkan-loader/default.nix | 4 ++-- pkgs/development/tools/misc/pkg-config/default.nix | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/vulkan-loader/default.nix b/pkgs/development/libraries/vulkan-loader/default.nix index 163cea7565c0..068c1d3d2c2a 100644 --- a/pkgs/development/libraries/vulkan-loader/default.nix +++ b/pkgs/development/libraries/vulkan-loader/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ vulkan-headers ] - ++ lib.optionals (!stdenv.isDarwin) [ libX11 libxcb libXrandr wayland ]; + ++ lib.optionals stdenv.isLinux [ libX11 libxcb libXrandr wayland ]; cmakeFlags = [ "-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include" ] ++ lib.optional stdenv.isDarwin "-DSYSCONFDIR=${moltenvk}/share" @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "LunarG Vulkan loader"; homepage = "https://www.lunarg.com"; - platforms = platforms.unix; + platforms = platforms.unix ++ platforms.windows; license = licenses.asl20; maintainers = [ maintainers.ralith ]; broken = (version != vulkan-headers.version); diff --git a/pkgs/development/tools/misc/pkg-config/default.nix b/pkgs/development/tools/misc/pkg-config/default.nix index 221e28cc8e41..663f3184b221 100644 --- a/pkgs/development/tools/misc/pkg-config/default.nix +++ b/pkgs/development/tools/misc/pkg-config/default.nix @@ -35,11 +35,11 @@ stdenv.mkDerivation rec { "ac_cv_func_posix_getgrgid_r=yes" ]; - env.NIX_CFLAGS_COMPILE = builtins.toString ( + env.NIX_CFLAGS_COMPILE = toString ( # Silence "incompatible integer to pointer conversion passing 'gsize'" when building with Clang. - lib.optionals stdenv.cc.isClang ["-Wno-int-conversion"] ++ + lib.optionals stdenv.cc.isClang ["-Wno-int-conversion"] # Silence fprintf format errors when building for Windows. - lib.optionals stdenv.hostPlatform.isWindows ["-Wno-error=format"] + ++ lib.optionals stdenv.hostPlatform.isWindows ["-Wno-error=format"] ); enableParallelBuilding = true;