2021-05-06 16:44:49 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libX11, libxcb
|
2022-02-16 01:25:41 +00:00
|
|
|
, libXrandr, wayland, moltenvk, vulkan-headers, addOpenGLRunpath }:
|
2018-10-13 17:54:45 +00:00
|
|
|
|
2020-01-29 06:27:09 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "vulkan-loader";
|
2022-01-16 00:31:37 +00:00
|
|
|
version = "1.2.198.0";
|
2021-07-24 03:08:32 +00:00
|
|
|
|
|
|
|
src = (assert version == vulkan-headers.version;
|
|
|
|
fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "Vulkan-Loader";
|
|
|
|
rev = "sdk-${version}";
|
2022-01-16 00:31:37 +00:00
|
|
|
sha256 = "sha256-k3eCdZqCjFxpKa0pZ0K4XcORxdSOlr1dFa7C3Qzi04Y=";
|
2021-07-24 03:08:32 +00:00
|
|
|
});
|
2016-04-02 19:35:14 +00:00
|
|
|
|
2021-05-06 16:44:49 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2022-02-16 01:25:41 +00:00
|
|
|
buildInputs = [ vulkan-headers ]
|
|
|
|
++ lib.optionals (!stdenv.isDarwin) [ libX11 libxcb libXrandr wayland ];
|
2016-04-02 19:35:14 +00:00
|
|
|
|
2022-02-16 01:25:41 +00:00
|
|
|
cmakeFlags = [ "-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include" ]
|
|
|
|
++ lib.optional stdenv.isDarwin "-DSYSCONFDIR=${moltenvk}/share"
|
|
|
|
++ lib.optional stdenv.isLinux "-DSYSCONFDIR=${addOpenGLRunpath.driverLink}/share";
|
2016-08-31 20:57:37 +00:00
|
|
|
|
2018-06-27 03:35:34 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
2016-09-24 16:42:18 +00:00
|
|
|
|
2021-01-09 22:24:44 +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
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2016-04-02 19:35:14 +00:00
|
|
|
description = "LunarG Vulkan loader";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.lunarg.com";
|
2022-02-17 00:18:12 +00:00
|
|
|
platforms = platforms.unix;
|
2017-01-04 09:56:26 +00:00
|
|
|
license = licenses.asl20;
|
2017-04-01 19:28:59 +00:00
|
|
|
maintainers = [ maintainers.ralith ];
|
2016-04-02 19:35:14 +00:00
|
|
|
};
|
|
|
|
}
|