2022-12-28 21:21:41 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, cmake
|
|
|
|
, makeWrapper
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, wayland
|
|
|
|
, libX11
|
|
|
|
, libxcb
|
|
|
|
, lz4
|
|
|
|
, vulkan-loader
|
|
|
|
, xcbutilkeysyms
|
|
|
|
, zlib
|
|
|
|
, zstd
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "gfxreconstruct";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "1.0.2";
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "LunarG";
|
|
|
|
repo = "gfxreconstruct";
|
|
|
|
rev = "v${version}";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-4jFHnDiLO2BrfXzxKXU3FGhvcmkUXCT2k/7A+DJPz90=";
|
2022-12-28 21:21:41 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libX11
|
|
|
|
libxcb
|
|
|
|
lz4
|
|
|
|
python3
|
|
|
|
wayland
|
|
|
|
xcbutilkeysyms
|
|
|
|
zlib
|
|
|
|
zstd
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
makeWrapper
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
# The python script searches in subfolders, but we want to search in the same bin directory
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace tools/gfxrecon/gfxrecon.py \
|
|
|
|
--replace "scriptdir, '..', cmd" 'scriptdir'
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Fix the path to the layer library
|
|
|
|
postInstall = ''
|
|
|
|
substituteInPlace $out/share/vulkan/explicit_layer.d/VkLayer_gfxreconstruct.json \
|
|
|
|
--replace 'libVkLayer_gfxreconstruct.so' "$out/lib/libVkLayer_gfxreconstruct.so"
|
|
|
|
wrapProgram $out/bin/gfxrecon-replay \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ vulkan-loader ]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Graphics API Capture and Replay Tools";
|
|
|
|
homepage = "https://github.com/LunarG/gfxreconstruct/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ Flakebi ];
|
2023-07-15 17:15:38 +00:00
|
|
|
platforms = platforms.linux;
|
2022-12-28 21:21:41 +00:00
|
|
|
};
|
|
|
|
}
|