2021-08-05 21:33:18 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libX11, libxcb
|
2022-02-20 05:27:41 +00:00
|
|
|
, libXrandr, wayland, moltenvk, vulkan-headers, addOpenGLRunpath }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "vulkan-loader";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "1.3.211.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
src = (assert version == vulkan-headers.version;
|
|
|
|
fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "Vulkan-Loader";
|
|
|
|
rev = "sdk-${version}";
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "sha256-NQu98wA7UK231rpoKDs1yQ6pEyB4wZg7MjFC3JwS2BY=";
|
2021-08-05 21:33:18 +00:00
|
|
|
});
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
patches = [ ./fix-pkgconfig.patch ];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2022-02-20 05:27:41 +00:00
|
|
|
buildInputs = [ vulkan-headers ]
|
|
|
|
++ lib.optionals (!stdenv.isDarwin) [ libX11 libxcb libXrandr wayland ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
cmakeFlags = [ "-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include" ]
|
|
|
|
++ lib.optional stdenv.isDarwin "-DSYSCONFDIR=${moltenvk}/share"
|
2022-05-18 14:49:53 +00:00
|
|
|
++ lib.optional stdenv.isLinux "-DSYSCONFDIR=${addOpenGLRunpath.driverLink}/share"
|
|
|
|
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "-DUSE_GAS=OFF";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
installCheckPhase = ''
|
|
|
|
grep -q "${vulkan-headers}/include" $dev/lib/pkgconfig/vulkan.pc || {
|
|
|
|
echo vulkan-headers include directory not found in pkg-config file
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "LunarG Vulkan loader";
|
|
|
|
homepage = "https://www.lunarg.com";
|
2022-02-20 05:27:41 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.ralith ];
|
|
|
|
};
|
|
|
|
}
|