acr-cli: init at 0.14 (#359508)
[NixPkgs.git] / pkgs / by-name / re / renderdoc / package.nix
blob17d161aa707b319a273c5d2a54ac6f7e0d17afcb
2   lib,
3   addDriverRunpath,
4   autoconf,
5   automake,
6   bison,
7   cmake,
8   fetchFromGitHub,
9   libXdmcp,
10   libglvnd,
11   libpthreadstubs,
12   makeWrapper,
13   nix-update-script,
14   pcre,
15   pkg-config,
16   python311Packages,
17   qt5,
18   stdenv,
19   vulkan-loader,
20   wayland,
21   # Boolean flags
22   waylandSupport ? true,
25 let
26   custom_swig = fetchFromGitHub {
27     owner = "baldurk";
28     repo = "swig";
29     rev = "renderdoc-modified-7";
30     hash = "sha256-RsdvxBBQvwuE5wSwL8OBXg5KMSpcO6EuMS0CzWapIpc=";
31   };
33 stdenv.mkDerivation (finalAttrs: {
34   pname = "renderdoc";
35   version = "1.35";
37   src = fetchFromGitHub {
38     owner = "baldurk";
39     repo = "renderdoc";
40     rev = "v${finalAttrs.version}";
41     hash = "sha256-iBe3JNtG9P1IAd00s/fL2RcImMrTwruld98OFHrIhp4=";
42   };
44   outputs = [
45     "out"
46     "dev"
47     "doc"
48   ];
50   buildInputs =
51     [
52       libXdmcp
53       libpthreadstubs
54       python311Packages.pyside2
55       python311Packages.pyside2-tools
56       python311Packages.shiboken2
57       qt5.qtbase
58       qt5.qtsvg
59       vulkan-loader
60     ]
61     ++ lib.optionals waylandSupport [
62       wayland
63     ];
65   nativeBuildInputs = [
66     addDriverRunpath
67     autoconf
68     automake
69     bison
70     cmake
71     makeWrapper
72     pcre
73     pkg-config
74     python311Packages.python
75     qt5.qtx11extras
76     qt5.wrapQtAppsHook
77   ];
79   cmakeFlags = [
80     (lib.cmakeFeature "BUILD_VERSION_HASH" finalAttrs.src.rev)
81     (lib.cmakeFeature "BUILD_VERSION_DIST_NAME" "NixOS")
82     (lib.cmakeFeature "BUILD_VERSION_DIST_VER" finalAttrs.version)
83     (lib.cmakeFeature "BUILD_VERSION_DIST_CONTACT" "https://github.com/NixOS/nixpkgs/")
84     (lib.cmakeBool "BUILD_VERSION_STABLE" true)
85     (lib.cmakeBool "ENABLE_WAYLAND" waylandSupport)
86   ];
88   dontWrapQtApps = true;
90   strictDeps = true;
92   postUnpack = ''
93     cp -r ${custom_swig} swig
94     chmod -R +w swig
95     patchShebangs swig/autogen.sh
96   '';
98   # TODO: define these in the above array via placeholders, once those are
99   # widely supported
100   preConfigure = ''
101     cmakeFlagsArray+=(
102       "-DRENDERDOC_SWIG_PACKAGE=$PWD/../swig"
103       "-DVULKAN_LAYER_FOLDER=$out/share/vulkan/implicit_layer.d/"
104      )
105   '';
107   preFixup =
108     let
109       libPath = lib.makeLibraryPath [
110         libglvnd
111         vulkan-loader
112       ];
113     in
114     ''
115       wrapQtApp $out/bin/qrenderdoc \
116         --suffix LD_LIBRARY_PATH : "$out/lib:${libPath}"
117       wrapProgram $out/bin/renderdoccmd \
118         --suffix LD_LIBRARY_PATH : "$out/lib:${libPath}"
119     '';
121   # The only documentation for this so far is in the setup-hook.sh script from
122   # add-opengl-runpath
123   postFixup = ''
124     addDriverRunpath $out/lib/librenderdoc.so
125   '';
127   passthru.updateScript = nix-update-script { };
129   meta = {
130     homepage = "https://renderdoc.org/";
131     description = "Single-frame graphics debugger";
132     longDescription = ''
133       RenderDoc is a free MIT licensed stand-alone graphics debugger that
134       allows quick and easy single-frame capture and detailed introspection
135       of any application using Vulkan, D3D11, OpenGL or D3D12 across
136       Windows 7 - 10, Linux or Android.
137     '';
138     license = lib.licenses.mit;
139     mainProgram = "renderdoccmd";
140     maintainers = with lib.maintainers; [ AndersonTorres ];
141     platforms = lib.intersectLists lib.platforms.linux (lib.platforms.x86_64 ++ lib.platforms.i686);
142   };