2021-08-05 21:33:18 +00:00
|
|
|
{ lib
|
2022-04-27 09:35:20 +00:00
|
|
|
, callPackage
|
2021-08-05 21:33:18 +00:00
|
|
|
, stdenv
|
2020-10-16 20:44:37 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
2022-04-27 09:35:20 +00:00
|
|
|
, pkg-config
|
2020-10-16 20:44:37 +00:00
|
|
|
, glslang
|
2022-04-27 09:35:20 +00:00
|
|
|
, libffi
|
2021-08-05 21:33:18 +00:00
|
|
|
, libX11
|
2022-04-27 09:35:20 +00:00
|
|
|
, libXau
|
2020-10-16 20:44:37 +00:00
|
|
|
, libxcb
|
2022-04-27 09:35:20 +00:00
|
|
|
, libXdmcp
|
2020-10-16 20:44:37 +00:00
|
|
|
, libXrandr
|
2021-08-05 21:33:18 +00:00
|
|
|
, spirv-headers
|
|
|
|
, spirv-tools
|
|
|
|
, vulkan-headers
|
2020-10-16 20:44:37 +00:00
|
|
|
, wayland
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2022-04-27 09:35:20 +00:00
|
|
|
robin-hood-hashing = callPackage ./robin-hood-hashing.nix {};
|
2020-10-16 20:44:37 +00:00
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "vulkan-validation-layers";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "1.3.236.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-19 00:13:47 +00:00
|
|
|
# If we were to use "dev" here instead of headers, the setupHook would be
|
|
|
|
# placed in that output instead of "out".
|
|
|
|
outputs = ["out" "headers"];
|
|
|
|
outputInclude = "headers";
|
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
src = (assert (lib.all (pkg: pkg.version == version) [vulkan-headers glslang spirv-tools spirv-headers]);
|
2021-08-05 21:33:18 +00:00
|
|
|
fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "Vulkan-ValidationLayers";
|
|
|
|
rev = "sdk-${version}";
|
2023-01-20 10:41:00 +00:00
|
|
|
hash = "sha256-+VbiXtxzYaF5o+wIrJ+09LmgBdaLv/0VJGFDnBkrXms=";
|
2021-08-05 21:33:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
# Include absolute paths to layer libraries in their associated
|
|
|
|
# layer definition json files.
|
|
|
|
postPatch = ''
|
|
|
|
sed "s|\([[:space:]]*set(INSTALL_DEFINES \''${INSTALL_DEFINES} -DRELATIVE_LAYER_BINARY=\"\)\(\$<TARGET_FILE_NAME:\''${TARGET_NAME}>\")\)|\1$out/lib/\2|" -i layers/CMakeLists.txt
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2022-04-27 09:35:20 +00:00
|
|
|
pkg-config
|
2020-10-16 20:44:37 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-08-05 21:33:18 +00:00
|
|
|
libX11
|
2022-04-27 09:35:20 +00:00
|
|
|
libXau
|
|
|
|
libXdmcp
|
2020-10-16 20:44:37 +00:00
|
|
|
libXrandr
|
2022-04-27 09:35:20 +00:00
|
|
|
libffi
|
|
|
|
libxcb
|
|
|
|
spirv-tools
|
2021-08-05 21:33:18 +00:00
|
|
|
vulkan-headers
|
2020-10-16 20:44:37 +00:00
|
|
|
wayland
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2022-01-25 03:21:06 +00:00
|
|
|
"-DGLSLANG_INSTALL_DIR=${glslang}"
|
|
|
|
"-DSPIRV_HEADERS_INSTALL_DIR=${spirv-headers}"
|
2021-08-05 21:33:18 +00:00
|
|
|
"-DROBIN_HOOD_HASHING_INSTALL_DIR=${robin-hood-hashing}"
|
2020-11-19 00:13:47 +00:00
|
|
|
"-DBUILD_LAYER_SUPPORT_FILES=ON"
|
2022-04-27 09:35:20 +00:00
|
|
|
"-DPKG_CONFIG_EXECUTABLE=${pkg-config}/bin/pkg-config"
|
2021-08-05 21:33:18 +00:00
|
|
|
# Hide dev warnings that are useless for packaging
|
|
|
|
"-Wno-dev"
|
2020-10-16 20:44:37 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
# Tests require access to vulkan-compatible GPU, which isn't
|
|
|
|
# available in Nix sandbox. Fails with VK_ERROR_INCOMPATIBLE_DRIVER.
|
|
|
|
doCheck = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-01-05 17:05:55 +00:00
|
|
|
description = "The official Khronos Vulkan validation layers";
|
|
|
|
homepage = "https://github.com/KhronosGroup/Vulkan-ValidationLayers";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.ralith ];
|
|
|
|
};
|
|
|
|
}
|