From 265690e33554b2d22236b3a4f90c4fee228dd40c Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Mon, 19 Dec 2022 20:42:40 +0100 Subject: [PATCH] gfxreconstruct: init at 0.9.15 --- .../tools/graphics/gfxreconstruct/default.nix | 67 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 69 insertions(+) create mode 100644 pkgs/tools/graphics/gfxreconstruct/default.nix diff --git a/pkgs/tools/graphics/gfxreconstruct/default.nix b/pkgs/tools/graphics/gfxreconstruct/default.nix new file mode 100644 index 000000000000..31ced64c46a1 --- /dev/null +++ b/pkgs/tools/graphics/gfxreconstruct/default.nix @@ -0,0 +1,67 @@ +{ stdenv +, fetchFromGitHub +, lib +, cmake +, makeWrapper +, pkg-config +, python3 +, wayland +, libX11 +, libxcb +, lz4 +, vulkan-loader +, xcbutilkeysyms +, zlib +, zstd +}: + +stdenv.mkDerivation rec { + pname = "gfxreconstruct"; + version = "0.9.15"; + + src = fetchFromGitHub { + owner = "LunarG"; + repo = "gfxreconstruct"; + rev = "v${version}"; + hash = "sha256-hIzQ5L0Payj8hlyy5UI7RXgnyhQBPqG7nfbvW2VYvTg="; + 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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1d58efc3c6ac..1bf65979e1dc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4172,6 +4172,8 @@ with pkgs; gdu = callPackage ../tools/system/gdu { }; + gfxreconstruct = callPackage ../tools/graphics/gfxreconstruct { }; + go-chromecast = callPackage ../applications/video/go-chromecast { }; go-containerregistry = callPackage ../development/tools/go-containerregistry { };