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
|
|
|
|
, 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 {};
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
# Current VVL version requires a newer spirv-headers than the latest release tag.
|
|
|
|
# This should hopefully not be too common and the override should be removed after
|
|
|
|
# the next SPIRV headers release.
|
|
|
|
# FIXME: if this ever becomes common, figure out a way to pull revisions directly
|
|
|
|
# from upstream known-good.json
|
|
|
|
spirv-headers' = spirv-headers.overrideAttrs(_: {
|
|
|
|
version = "unstable-2023-04-27";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "SPIRV-Headers";
|
|
|
|
rev = "7f1d2f4158704337aff1f739c8e494afc5716e7e";
|
|
|
|
hash = "sha256-DHOYIZQqP5uWDYdb+vePpMBaQDOCB5Pcg8wPBMF8itk=";
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = "";
|
|
|
|
});
|
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-05-24 13:37:59 +00:00
|
|
|
version = "1.3.249";
|
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";
|
2023-05-24 13:37:59 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-+Vjy3hzzpC+bFNSEHLsfUaaHMSrMv2G+B8lGjui0fJs=";
|
2023-04-12 12:48:02 +00:00
|
|
|
};
|
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
|
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}"
|
2023-05-24 13:37:59 +00:00
|
|
|
"-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 ];
|
|
|
|
};
|
|
|
|
}
|