2021-08-05 21:33:18 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libX11, libxcb
|
|
|
|
, libXrandr, wayland, vulkan-headers, addOpenGLRunpath }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "vulkan-loader";
|
2021-10-28 06:52:43 +00:00
|
|
|
version = "1.2.189.1";
|
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}";
|
2021-10-28 06:52:43 +00:00
|
|
|
sha256 = "1745fdzi0n5qj2s41q6z1y52cq8pwswvh1a32d3n7kl6bhksagp6";
|
2021-08-05 21:33:18 +00:00
|
|
|
});
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
buildInputs = [ libX11 libxcb libXrandr vulkan-headers wayland ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DSYSCONFDIR=${addOpenGLRunpath.driverLink}/share"
|
2021-02-05 17:12:51 +00:00
|
|
|
"-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include"
|
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";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.ralith ];
|
|
|
|
};
|
|
|
|
}
|