Unverified Commit be9e3be8 authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

renderdoc: 1.34 -> 1.35 (#344995)

parents be7e4ff8 7451f5ed
Loading
Loading
Loading
Loading
+143 −0
Original line number Diff line number Diff line
{ lib
, fetchFromGitHub
, nix-update-script
, cmake
, pkg-config
, mkDerivation
, qtbase
, qtx11extras
, qtsvg
, makeWrapper
, vulkan-loader
, libglvnd
, xorg
, python311
, python311Packages
, bison
, pcre
, automake
, autoconf
, addDriverRunpath
, waylandSupport ? false
, wayland
{
  lib,
  addDriverRunpath,
  autoconf,
  automake,
  bison,
  cmake,
  fetchFromGitHub,
  libXdmcp,
  libglvnd,
  libpthreadstubs,
  makeWrapper,
  nix-update-script,
  pcre,
  pkg-config,
  python311Packages,
  qt5,
  stdenv,
  vulkan-loader,
  wayland,
  # Boolean flags
  waylandSupport ? true,
}:

let
  custom_swig = fetchFromGitHub {
    owner = "baldurk";
    repo = "swig";
    rev = "renderdoc-modified-7";
    sha256 = "15r2m5kcs0id64pa2fsw58qll3jyh71jzc04wy20pgsh2326zis6";
    hash = "sha256-RsdvxBBQvwuE5wSwL8OBXg5KMSpcO6EuMS0CzWapIpc=";
  };
in
mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "renderdoc";
  version = "1.34";
  version = "1.35";

  src = fetchFromGitHub {
    owner = "baldurk";
    repo = "renderdoc";
    rev = "v${version}";
    sha256 = "sha256-obRCILzMR7tCni0YoT3/oesTSADGI2sXqY3G6RS1h1o=";
    rev = "v${finalAttrs.version}";
    hash = "sha256-iBe3JNtG9P1IAd00s/fL2RcImMrTwruld98OFHrIhp4=";
  };

  buildInputs = [
    qtbase qtsvg xorg.libpthreadstubs xorg.libXdmcp qtx11extras vulkan-loader python311
  ] ++ (with python311Packages; [
    pyside2 pyside2-tools shiboken2
  ])
  ++ lib.optional waylandSupport wayland;
  outputs = [
    "out"
    "dev"
    "doc"
  ];

  nativeBuildInputs = [ cmake makeWrapper pkg-config bison pcre automake autoconf addDriverRunpath ];
  buildInputs =
    [
      libXdmcp
      libpthreadstubs
      python311Packages.pyside2
      python311Packages.pyside2-tools
      python311Packages.shiboken2
      qt5.qtbase
      qt5.qtsvg
      vulkan-loader
    ]
    ++ lib.optionals waylandSupport [
      wayland
    ];

  postUnpack = ''
    cp -r ${custom_swig} swig
    chmod -R +w swig
    patchShebangs swig/autogen.sh
  '';
  nativeBuildInputs = [
    addDriverRunpath
    autoconf
    automake
    bison
    cmake
    makeWrapper
    pcre
    pkg-config
    python311Packages.python
    qt5.qtx11extras
    qt5.wrapQtAppsHook
  ];

  cmakeFlags = [
    (lib.cmakeFeature "BUILD_VERSION_HASH" src.rev)
    (lib.cmakeFeature "BUILD_VERSION_HASH" finalAttrs.src.rev)
    (lib.cmakeFeature "BUILD_VERSION_DIST_NAME" "NixOS")
    (lib.cmakeFeature "BUILD_VERSION_DIST_VER" version)
    (lib.cmakeFeature "BUILD_VERSION_DIST_CONTACT" "https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/graphics/renderdoc")
    (lib.cmakeFeature "BUILD_VERSION_DIST_VER" finalAttrs.version)
    (lib.cmakeFeature "BUILD_VERSION_DIST_CONTACT" "https://github.com/NixOS/nixpkgs/")
    (lib.cmakeBool "BUILD_VERSION_STABLE" true)
    (lib.cmakeBool "ENABLE_WAYLAND" waylandSupport)
  ];

  # TODO: define these in the above array via placeholders, once those are widely supported
  dontWrapQtApps = true;

  strictDeps = true;

  postUnpack = ''
    cp -r ${custom_swig} swig
    chmod -R +w swig
    patchShebangs swig/autogen.sh
  '';

  # 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/"
    cmakeFlags+=" -DRENDERDOC_SWIG_PACKAGE=$PWD/../swig"
    cmakeFlagsArray+=(
      "-DRENDERDOC_SWIG_PACKAGE=$PWD/../swig"
      "-DVULKAN_LAYER_FOLDER=$out/share/vulkan/implicit_layer.d/"
     )
  '';

  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"
  preFixup =
    let
      libPath = lib.makeLibraryPath [
        libglvnd
        vulkan-loader
      ];
    in
    ''
      wrapQtApp $out/bin/qrenderdoc \
        --suffix LD_LIBRARY_PATH : "$out/lib:${libPath}"
      wrapProgram $out/bin/renderdoccmd \
        --suffix LD_LIBRARY_PATH : "$out/lib:${libPath}"
    '';

  # The only documentation for this so far is in pkgs/build-support/add-opengl-runpath/setup-hook.sh
  # The only documentation for this so far is in the setup-hook.sh script from
  # add-opengl-runpath
  postFixup = ''
    addDriverRunpath $out/lib/librenderdoc.so
  '';

  passthru.updateScript = nix-update-script { };

  meta = with lib; {
    description = "Single-frame graphics debugger";
  meta = {
    homepage = "https://renderdoc.org/";
    license = licenses.mit;
    description = "Single-frame graphics debugger";
    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 = [ ];
    platforms = [ "i686-linux" "x86_64-linux" ];
    license = lib.licenses.mit;
    mainProgram = "renderdoccmd";
    maintainers = with lib.maintainers; [ AndersonTorres ];
    platforms = lib.intersectLists lib.platforms.linux (lib.platforms.x86_64 ++ lib.platforms.i686);
  };
}
})
+0 −2
Original line number Diff line number Diff line
@@ -11837,8 +11837,6 @@ with pkgs;
  renameutils = callPackage ../tools/misc/renameutils { };
  renderdoc = libsForQt5.callPackage ../development/tools/renderdoc { };
  repgrep = callPackage ../tools/text/repgrep { };
  replace = callPackage ../tools/text/replace { };