2021-08-05 21:33:18 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, python3
|
|
|
|
, jq
|
|
|
|
, expat
|
|
|
|
, 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
|
|
|
|
, vulkan-headers
|
|
|
|
, vulkan-loader
|
|
|
|
, symlinkJoin
|
|
|
|
, vulkan-validation-layers
|
|
|
|
, writeText
|
|
|
|
}:
|
2020-11-19 00:13:47 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "vulkan-tools-lunarg";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.3.250";
|
2020-11-19 00:13:47 +00:00
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "LunarG";
|
|
|
|
repo = "VulkanTools";
|
2023-05-24 13:37:59 +00:00
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-oI2ITvciuE/f8ojFpIwcH+HnYCasz43nKkER3wJxX+c=";
|
2023-04-12 12:48:02 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
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
|
2021-08-05 21:33:18 +00:00
|
|
|
libX11
|
2020-11-19 00:13:47 +00:00
|
|
|
libXdmcp
|
|
|
|
libXrandr
|
|
|
|
libffi
|
|
|
|
libxcb
|
|
|
|
wayland
|
|
|
|
xcbutilkeysyms
|
|
|
|
xcbutilwm
|
|
|
|
];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
}
|
|
|
|
}"
|
2021-08-05 21:33:18 +00:00
|
|
|
# Hide dev warnings that are useless for packaging
|
|
|
|
"-Wno-dev"
|
2020-11-19 00:13:47 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
patches = [
|
|
|
|
# Redefine an internal macro removed in vulkan-validation-layers
|
|
|
|
# FIXME: remove when fixed upstream
|
|
|
|
./add-missing-macro-definition.patch
|
|
|
|
|
|
|
|
# Skip QNX-specific extension causing build failures
|
|
|
|
# FIXME: remove when fixed upstream
|
|
|
|
./skip-qnx-extension.patch
|
|
|
|
|
|
|
|
./gtest.patch
|
|
|
|
];
|
2022-12-17 10:02:37 +00:00
|
|
|
|
2020-11-19 00:13:47 +00:00
|
|
|
# Same as vulkan-validation-layers
|
|
|
|
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-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 ];
|
|
|
|
};
|
|
|
|
}
|