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
|
2023-02-16 17:41:37 +00:00
|
|
|
, jq
|
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-04-12 12:48:02 +00:00
|
|
|
version = "1.3.243.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";
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "Vulkan-ValidationLayers";
|
|
|
|
rev = "sdk-${version}";
|
|
|
|
hash = "sha256-viVceH8qFz6Cl/RlMMWZnMIdzULELlnIvtPZ87ySs2M=";
|
|
|
|
};
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2022-04-27 09:35:20 +00:00
|
|
|
pkg-config
|
2023-02-16 17:41:37 +00:00
|
|
|
jq
|
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
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
# Include absolute paths to layer libraries in their associated
|
|
|
|
# layer definition json files.
|
|
|
|
preFixup = ''
|
|
|
|
for f in "$out"/share/vulkan/explicit_layer.d/*.json "$out"/share/vulkan/implicit_layer.d/*.json; do
|
|
|
|
jq <"$f" >tmp.json ".layer.library_path = \"$out/lib/\" + .layer.library_path"
|
|
|
|
mv tmp.json "$f"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
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 ];
|
2023-04-12 12:48:02 +00:00
|
|
|
broken = (lib.all (pkg: pkg.version != version) [vulkan-headers glslang spirv-tools spirv-headers]);
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|