2022-01-16 17:10:47 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, nix-update-script
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, mkDerivation
|
|
|
|
, qtbase
|
|
|
|
, qtx11extras
|
|
|
|
, qtsvg
|
|
|
|
, makeWrapper
|
|
|
|
, vulkan-loader
|
|
|
|
, libglvnd
|
|
|
|
, xorg
|
|
|
|
, python3
|
|
|
|
, python3Packages
|
|
|
|
, bison
|
|
|
|
, pcre
|
|
|
|
, automake
|
|
|
|
, autoconf
|
|
|
|
, addOpenGLRunpath
|
|
|
|
, waylandSupport ? false
|
|
|
|
, wayland
|
2017-03-21 20:36:26 +00:00
|
|
|
}:
|
2017-12-01 12:21:54 +00:00
|
|
|
let
|
2018-07-14 20:00:27 +00:00
|
|
|
custom_swig = fetchFromGitHub {
|
|
|
|
owner = "baldurk";
|
|
|
|
repo = "swig";
|
2019-10-12 20:18:35 +00:00
|
|
|
rev = "renderdoc-modified-7";
|
|
|
|
sha256 = "15r2m5kcs0id64pa2fsw58qll3jyh71jzc04wy20pgsh2326zis6";
|
2017-12-01 12:21:54 +00:00
|
|
|
};
|
2021-08-01 15:48:48 +00:00
|
|
|
cmakeBool = b: if b then "ON" else "OFF";
|
2017-12-01 12:21:54 +00:00
|
|
|
in
|
2019-10-12 20:18:35 +00:00
|
|
|
mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "renderdoc";
|
2022-09-24 19:52:44 +00:00
|
|
|
version = "1.22";
|
2017-03-21 20:36:26 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "baldurk";
|
|
|
|
repo = "renderdoc";
|
2018-07-14 20:00:27 +00:00
|
|
|
rev = "v${version}";
|
2022-09-24 19:52:44 +00:00
|
|
|
sha256 = "sha256-eqMIOb9XAgXtoCJABvZkkS/rhHK7jNqabIFwdCgcSJU=";
|
2017-03-21 20:36:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
2019-04-01 19:44:33 +00:00
|
|
|
qtbase qtsvg xorg.libpthreadstubs xorg.libXdmcp qtx11extras vulkan-loader python3
|
2021-08-02 07:36:11 +00:00
|
|
|
] # ++ (with python3Packages; [pyside2 pyside2-tools shiboken2])
|
2019-10-12 20:18:35 +00:00
|
|
|
# TODO: figure out how to make cmake recognise pyside2
|
2021-08-02 07:36:11 +00:00
|
|
|
++ lib.optional waylandSupport wayland;
|
2017-12-01 12:21:54 +00:00
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper pkg-config bison pcre automake autoconf addOpenGLRunpath ];
|
2018-07-14 20:00:27 +00:00
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
cp -r ${custom_swig} swig
|
|
|
|
chmod -R +w swig
|
|
|
|
patchShebangs swig/autogen.sh
|
|
|
|
'';
|
2017-03-21 20:36:26 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
2017-09-03 18:42:44 +00:00
|
|
|
"-DBUILD_VERSION_HASH=${src.rev}"
|
|
|
|
"-DBUILD_VERSION_DIST_NAME=NixOS"
|
2018-07-14 20:00:27 +00:00
|
|
|
"-DBUILD_VERSION_DIST_VER=${version}"
|
2017-09-03 18:42:44 +00:00
|
|
|
"-DBUILD_VERSION_DIST_CONTACT=https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/graphics/renderdoc"
|
2018-07-14 20:00:27 +00:00
|
|
|
"-DBUILD_VERSION_STABLE=ON"
|
2021-08-01 15:48:48 +00:00
|
|
|
"-DENABLE_WAYLAND=${cmakeBool waylandSupport}"
|
2017-03-21 20:36:26 +00:00
|
|
|
];
|
2017-12-01 12:21:54 +00:00
|
|
|
|
2019-10-12 20:18:35 +00:00
|
|
|
# TODO: define these in the above array via placeholders, once those are widely supported
|
2017-03-21 20:36:26 +00:00
|
|
|
preConfigure = ''
|
|
|
|
cmakeFlags+=" -DVULKAN_LAYER_FOLDER=$out/share/vulkan/implicit_layer.d/"
|
2018-07-14 20:00:27 +00:00
|
|
|
cmakeFlags+=" -DRENDERDOC_SWIG_PACKAGE=$PWD/../swig"
|
2017-03-21 20:36:26 +00:00
|
|
|
'';
|
2017-09-03 18:42:44 +00:00
|
|
|
|
2019-10-12 20:18:35 +00:00
|
|
|
dontWrapQtApps = true;
|
2017-03-21 20:36:26 +00:00
|
|
|
preFixup = ''
|
2020-03-11 23:45:19 +00:00
|
|
|
wrapQtApp $out/bin/qrenderdoc --suffix LD_LIBRARY_PATH : "$out/lib:${vulkan-loader}/lib:${libglvnd}/lib"
|
|
|
|
wrapProgram $out/bin/renderdoccmd --suffix LD_LIBRARY_PATH : "$out/lib:${vulkan-loader}/lib:${libglvnd}/lib"
|
2019-10-12 20:18:35 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# The only documentation for this so far is in pkgs/build-support/add-opengl-runpath/setup-hook.sh
|
|
|
|
postFixup = ''
|
|
|
|
addOpenGLRunpath $out/lib/librenderdoc.so
|
2017-03-21 20:36:26 +00:00
|
|
|
'';
|
2017-12-01 12:21:54 +00:00
|
|
|
|
2022-01-16 17:10:47 +00:00
|
|
|
passthru.updateScript = nix-update-script {
|
|
|
|
attrPath = pname;
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-03-21 20:36:26 +00:00
|
|
|
description = "A single-frame graphics debugger";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://renderdoc.org/";
|
2017-03-21 20:36:26 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
longDescription = ''
|
|
|
|
RenderDoc is a free MIT licensed stand-alone graphics debugger that
|
|
|
|
allows quick and easy single-frame capture and detailed introspection
|
|
|
|
of any application using Vulkan, D3D11, OpenGL or D3D12 across
|
|
|
|
Windows 7 - 10, Linux or Android.
|
|
|
|
'';
|
2022-08-01 23:57:49 +00:00
|
|
|
maintainers = [ ];
|
2021-08-02 07:36:11 +00:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2017-03-21 20:36:26 +00:00
|
|
|
};
|
|
|
|
}
|