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