2021-08-05 21:33:18 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, python3
|
|
|
|
, jq
|
|
|
|
, expat
|
2023-10-09 19:29:22 +00:00
|
|
|
, jsoncpp
|
2021-08-05 21:33:18 +00:00
|
|
|
, libX11
|
|
|
|
, libXdmcp
|
|
|
|
, libXrandr
|
|
|
|
, libffi
|
|
|
|
, libxcb
|
2023-03-04 12:14:45 +00:00
|
|
|
, pkg-config
|
2021-08-05 21:33:18 +00:00
|
|
|
, wayland
|
2023-01-20 10:41:00 +00:00
|
|
|
, which
|
2021-08-05 21:33:18 +00:00
|
|
|
, xcbutilkeysyms
|
|
|
|
, xcbutilwm
|
2023-11-16 04:20:00 +00:00
|
|
|
, valijson
|
2021-08-05 21:33:18 +00:00
|
|
|
, vulkan-headers
|
|
|
|
, vulkan-loader
|
2023-11-16 04:20:00 +00:00
|
|
|
, vulkan-utility-libraries
|
2021-08-05 21:33:18 +00:00
|
|
|
, writeText
|
|
|
|
}:
|
2020-11-19 00:13:47 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "vulkan-tools-lunarg";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.3.268.0";
|
2020-11-19 00:13:47 +00:00
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "LunarG";
|
|
|
|
repo = "VulkanTools";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "vulkan-sdk-${version}";
|
|
|
|
hash = "sha256-2ZUD+RBsl35QV3250JOPCIoJb4sJcBsiRE4SZaS6ROs=";
|
2023-04-12 12:48:02 +00:00
|
|
|
};
|
2020-11-19 00:13:47 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
nativeBuildInputs = [ cmake python3 jq which pkg-config ];
|
2020-11-19 00:13:47 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
expat
|
2023-10-09 19:29:22 +00:00
|
|
|
jsoncpp
|
2021-08-05 21:33:18 +00:00
|
|
|
libX11
|
2020-11-19 00:13:47 +00:00
|
|
|
libXdmcp
|
|
|
|
libXrandr
|
|
|
|
libffi
|
|
|
|
libxcb
|
2023-11-16 04:20:00 +00:00
|
|
|
valijson
|
|
|
|
vulkan-headers
|
|
|
|
vulkan-loader
|
|
|
|
vulkan-utility-libraries
|
2020-11-19 00:13:47 +00:00
|
|
|
wayland
|
|
|
|
xcbutilkeysyms
|
|
|
|
xcbutilwm
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DVULKAN_HEADERS_INSTALL_DIR=${vulkan-headers}"
|
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs scripts/*
|
2023-10-09 19:29:22 +00:00
|
|
|
substituteInPlace via/CMakeLists.txt --replace "jsoncpp_static" "jsoncpp"
|
2020-11-19 00:13:47 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
|
|
|
|
# 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-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-11-19 00:13:47 +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 ];
|
|
|
|
};
|
|
|
|
}
|