vulkan-loader: enable support for Darwin

This commit is contained in:
Randy Eckenrode 2022-02-15 20:25:41 -05:00
parent f138abff3d
commit b763399574
No known key found for this signature in database
GPG key ID: 64C1CD4EC2A600D9
2 changed files with 8 additions and 8 deletions

View file

@ -1,5 +1,5 @@
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libX11, libxcb
, libXrandr, wayland, vulkan-headers, addOpenGLRunpath }:
, libXrandr, wayland, moltenvk, vulkan-headers, addOpenGLRunpath }:
stdenv.mkDerivation rec {
pname = "vulkan-loader";
@ -14,12 +14,12 @@ stdenv.mkDerivation rec {
});
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ libX11 libxcb libXrandr vulkan-headers wayland ];
buildInputs = [ vulkan-headers ]
++ lib.optionals (!stdenv.isDarwin) [ libX11 libxcb libXrandr wayland ];
cmakeFlags = [
"-DSYSCONFDIR=${addOpenGLRunpath.driverLink}/share"
"-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include"
];
cmakeFlags = [ "-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include" ]
++ lib.optional stdenv.isDarwin "-DSYSCONFDIR=${moltenvk}/share"
++ lib.optional stdenv.isLinux "-DSYSCONFDIR=${addOpenGLRunpath.driverLink}/share";
outputs = [ "out" "dev" ];
@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
meta = with lib; {
description = "LunarG Vulkan loader";
homepage = "https://www.lunarg.com";
platforms = platforms.linux;
platforms = platforms.linux ++ platforms.darwin;
license = licenses.asl20;
maintainers = [ maintainers.ralith ];
};

View file

@ -20398,7 +20398,7 @@ with pkgs;
vulkan-extension-layer = callPackage ../tools/graphics/vulkan-extension-layer { };
vulkan-headers = callPackage ../development/libraries/vulkan-headers { };
vulkan-loader = callPackage ../development/libraries/vulkan-loader { };
vulkan-loader = callPackage ../development/libraries/vulkan-loader { inherit (darwin) moltenvk; };
vulkan-tools = callPackage ../tools/graphics/vulkan-tools { };
vulkan-tools-lunarg = callPackage ../tools/graphics/vulkan-tools-lunarg { };
vulkan-validation-layers = callPackage ../development/tools/vulkan-validation-layers { };