2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, python3, vulkan-headers, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, xlibsWrapper, libxcb, libXrandr, libXext, wayland, addOpenGLRunpath }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "vulkan-loader";
|
2021-01-05 17:05:55 +00:00
|
|
|
version = "1.2.162.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "Vulkan-Loader";
|
|
|
|
rev = "sdk-${version}";
|
2021-01-05 17:05:55 +00:00
|
|
|
sha256 = "0w9i2pliw4ccmjyfzff4i2f3hxwsfd54jg7ahv2v634qmx59bsbi";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config cmake ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ python3 xlibsWrapper libxcb libXrandr libXext wayland ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DSYSCONFDIR=${addOpenGLRunpath.driverLink}/share"
|
|
|
|
"-DVULKAN_HEADERS_INSTALL_DIR=${vulkan-headers}"
|
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 ];
|
|
|
|
};
|
|
|
|
}
|