Merge pull request #215612 from expipiplus1/ellie-vvl

vulkan-validation-layers: Fix path to layer binary in layer description
This commit is contained in:
Kira Bruneau 2023-02-10 17:06:14 -05:00 committed by GitHub
commit dff309ee2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@
, fetchFromGitHub
, cmake
, pkg-config
, jq
, glslang
, libffi
, libX11
@ -37,15 +38,10 @@ stdenv.mkDerivation rec {
hash = "sha256-+VbiXtxzYaF5o+wIrJ+09LmgBdaLv/0VJGFDnBkrXms=";
});
# 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
'';
nativeBuildInputs = [
cmake
pkg-config
jq
];
buildInputs = [
@ -74,6 +70,15 @@ stdenv.mkDerivation rec {
# available in Nix sandbox. Fails with VK_ERROR_INCOMPATIBLE_DRIVER.
doCheck = false;
# 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
'';
meta = with lib; {
description = "The official Khronos Vulkan validation layers";
homepage = "https://github.com/KhronosGroup/Vulkan-ValidationLayers";