nixpkgs/pkgs/applications/graphics/renderdoc/default.nix

78 lines
2.6 KiB
Nix
Raw Normal View History

{ lib, fetchFromGitHub, cmake, pkg-config, mkDerivation
2018-07-14 21:00:27 +01:00
, qtbase, qtx11extras, qtsvg, makeWrapper
, vulkan-loader, libglvnd, xorg, python3, python3Packages
2019-10-12 21:18:35 +01:00
, bison, pcre, automake, autoconf, addOpenGLRunpath
}:
let
2018-07-14 21:00:27 +01:00
custom_swig = fetchFromGitHub {
owner = "baldurk";
repo = "swig";
2019-10-12 21:18:35 +01:00
rev = "renderdoc-modified-7";
sha256 = "15r2m5kcs0id64pa2fsw58qll3jyh71jzc04wy20pgsh2326zis6";
};
2019-10-12 21:18:35 +01:00
pythonPackages = python3Packages;
in
2019-10-12 21:18:35 +01:00
mkDerivation rec {
2021-03-14 23:37:25 +00:00
version = "1.12";
pname = "renderdoc";
src = fetchFromGitHub {
owner = "baldurk";
repo = "renderdoc";
2018-07-14 21:00:27 +01:00
rev = "v${version}";
2021-03-14 23:37:25 +00:00
sha256 = "4k0WsTsz4WwPZC8Dj85l2ntJOZkLgmBBOJcX9Bb4U7I=";
};
buildInputs = [
qtbase qtsvg xorg.libpthreadstubs xorg.libXdmcp qtx11extras vulkan-loader python3
2019-10-12 21:18:35 +01:00
]; # ++ (with pythonPackages; [pyside2 pyside2-tools shiboken2]);
# TODO: figure out how to make cmake recognise pyside2
nativeBuildInputs = [ cmake makeWrapper pkg-config bison pcre automake autoconf addOpenGLRunpath ];
2018-07-14 21:00:27 +01:00
postUnpack = ''
cp -r ${custom_swig} swig
chmod -R +w swig
patchShebangs swig/autogen.sh
'';
cmakeFlags = [
2017-09-03 19:42:44 +01:00
"-DBUILD_VERSION_HASH=${src.rev}"
"-DBUILD_VERSION_DIST_NAME=NixOS"
2018-07-14 21:00:27 +01:00
"-DBUILD_VERSION_DIST_VER=${version}"
2017-09-03 19:42:44 +01:00
"-DBUILD_VERSION_DIST_CONTACT=https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/graphics/renderdoc"
2018-07-14 21:00:27 +01:00
"-DBUILD_VERSION_STABLE=ON"
];
2019-10-12 21:18:35 +01:00
# TODO: define these in the above array via placeholders, once those are widely supported
preConfigure = ''
cmakeFlags+=" -DVULKAN_LAYER_FOLDER=$out/share/vulkan/implicit_layer.d/"
2018-07-14 21:00:27 +01:00
cmakeFlags+=" -DRENDERDOC_SWIG_PACKAGE=$PWD/../swig"
'';
2017-09-03 19:42:44 +01:00
2019-10-12 21:18:35 +01:00
dontWrapQtApps = true;
preFixup = ''
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 21:18:35 +01: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
'';
meta = with lib; {
description = "A single-frame graphics debugger";
homepage = "https://renderdoc.org/";
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.
'';
maintainers = [maintainers.jansol];
2017-09-03 19:42:44 +01:00
platforms = ["i686-linux" "x86_64-linux"];
};
}