2020-11-16 07:47:55 +00:00
|
|
|
{ stdenv, cmake, expat, fetchFromGitHub, jq, lib, libXdmcp, libXrandr, libffi
|
2021-01-17 09:17:16 +00:00
|
|
|
, libxcb, pkg-config, python3, symlinkJoin, vulkan-headers, vulkan-loader
|
2020-11-16 07:47:55 +00:00
|
|
|
, vulkan-validation-layers, wayland, writeText, xcbutilkeysyms, xcbutilwm
|
|
|
|
, xlibsWrapper }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "vulkan-tools-lunarg";
|
|
|
|
# The version must match that in vulkan-headers
|
2020-12-15 03:59:22 +00:00
|
|
|
version = "1.2.162.0";
|
2020-11-16 07:47:55 +00:00
|
|
|
|
2020-12-15 03:59:22 +00:00
|
|
|
src = (assert version == vulkan-headers.version;
|
|
|
|
fetchFromGitHub {
|
|
|
|
owner = "LunarG";
|
|
|
|
repo = "VulkanTools";
|
|
|
|
rev = "sdk-${version}";
|
|
|
|
sha256 = "13v4202bfd7d7nwi8w12ja9k1vi10p9xxypzkpi063hmsgzxm5k5";
|
|
|
|
fetchSubmodules = true;
|
|
|
|
});
|
2020-11-16 07:47:55 +00:00
|
|
|
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config python3 jq ];
|
2020-11-16 07:47:55 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
expat
|
|
|
|
libXdmcp
|
|
|
|
libXrandr
|
|
|
|
libffi
|
|
|
|
libxcb
|
|
|
|
wayland
|
|
|
|
xcbutilkeysyms
|
|
|
|
xcbutilwm
|
|
|
|
xlibsWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DVULKAN_HEADERS_INSTALL_DIR=${vulkan-headers}"
|
|
|
|
"-DVULKAN_LOADER_INSTALL_DIR=${vulkan-loader}"
|
|
|
|
"-DVULKAN_VALIDATIONLAYERS_INSTALL_DIR=${
|
|
|
|
symlinkJoin {
|
|
|
|
name = "vulkan-validation-layers-merged";
|
|
|
|
paths = [ vulkan-validation-layers.headers vulkan-validation-layers ];
|
|
|
|
}
|
|
|
|
}"
|
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
# We need to run this update script which generates some source files,
|
|
|
|
# Remove the line in it which calls 'git submodule update' though.
|
|
|
|
# Also patch the scripts in ./scripts
|
|
|
|
update=update_external_sources.sh
|
|
|
|
patchShebangs $update
|
|
|
|
patchShebangs scripts/*
|
|
|
|
sed -i '/^git /d' $update
|
|
|
|
./$update
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Include absolute paths to layer libraries in their associated
|
|
|
|
# layer definition json files.
|
|
|
|
preFixup = ''
|
|
|
|
for f in "$out"/etc/vulkan/explicit_layer.d/*.json "$out"/etc/vulkan/implicit_layer.d/*.json; do
|
|
|
|
jq <"$f" >tmp.json ".layer.library_path = \"$out/lib/\" + .layer.library_path"
|
|
|
|
mv tmp.json "$f"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Same as vulkan-validation-layers
|
|
|
|
libraryPath = lib.strings.makeLibraryPath [ vulkan-loader ];
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
|
|
|
# Help vulkan-loader find the validation layers
|
|
|
|
setupHook = writeText "setup-hook" ''
|
|
|
|
export XDG_CONFIG_DIRS=@out@/etc''${XDG_CONFIG_DIRS:+:''${XDG_CONFIG_DIRS}}
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-11-16 07:47:55 +00:00
|
|
|
description = "LunarG Vulkan Tools and Utilities";
|
|
|
|
longDescription = ''
|
|
|
|
Tools to aid in Vulkan development including useful layers, trace and
|
|
|
|
replay, and tests.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/LunarG/VulkanTools";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.expipiplus1 ];
|
|
|
|
};
|
|
|
|
}
|