Unverified Commit 1a14c8d6 authored by Samuel Ainsworth's avatar Samuel Ainsworth Committed by GitHub
Browse files

Merge pull request #224986 from SomeoneSerge/cudatoolkit-autopatchelf-followup

cudaPackages_12.cudatoolkit: hotfix after switching to autoPatchelfHook
parents 98140dd0 b100b0a1
Loading
Loading
Loading
Loading
+27 −5
Original line number Diff line number Diff line
@@ -37,6 +37,11 @@ args@
, freeglut
, libGLU
, libsForQt5
, libtiff
, qt6Packages
, rdma-core
, ucx
, rsync
}:

backendStdenv.mkDerivation rec {
@@ -67,13 +72,20 @@ backendStdenv.mkDerivation rec {
  nativeBuildInputs = [
    perl
    makeWrapper
    rsync
    addOpenGLRunpath
    autoPatchelfHook
    autoAddOpenGLRunpathHook
  ] ++ lib.optionals (lib.versionOlder version "11") [
    libsForQt5.wrapQtAppsHook
  ] ++ lib.optionals (lib.versionAtLeast version "11.8") [
    qt6Packages.wrapQtAppsHook
  ];
  buildInputs = [
  buildInputs = lib.optionals (lib.versionOlder version "11") [
    libsForQt5.qt5.qtwebengine
    freeglut
    libGLU
  ] ++ [
    # To get $GDK_PIXBUF_MODULE_FILE via setup-hook
    gdk-pixbuf

@@ -109,10 +121,13 @@ backendStdenv.mkDerivation rec {
    unixODBC
    alsa-lib
    wayland
  ] ++ lib.optionals (lib.versionOlder version "11") [
    libsForQt5.qt5.qtwebengine
    freeglut
    libGLU
  ] ++ lib.optionals (lib.versionAtLeast version "11.8") [
    (lib.getLib libtiff)
    qt6Packages.qtwayland
    rdma-core
    ucx
    xorg.libxshmfence
    xorg.libxkbfile
  ];

  # Prepended to runpaths by autoPatchelf.
@@ -205,6 +220,13 @@ backendStdenv.mkDerivation rec {
      mv pkg/builds/nsight_systems/target-linux-x64 $out/target-linux-x64
      mv pkg/builds/nsight_systems/host-linux-x64 $out/host-linux-x64
    ''}
      ${lib.optionalString (lib.versionAtLeast version "11.8")
      # error: auto-patchelf could not satisfy dependency libtiff.so.5 wanted by /nix/store/.......-cudatoolkit-12.0.1/host-linux-x64/Plugins/imageformats/libqtiff.so
      # we only ship libtiff.so.6, so let's use qt plugins built by Nix.
      # TODO: don't copy, come up with a symlink-based "merge"
    ''
      rsync ${lib.getLib qt6Packages.qtimageformats}/lib/qt-6/plugins/ $out/host-linux-x64/Plugins/ -aP
    ''}

    rm -f $out/tools/CUDA_Occupancy_Calculator.xls # FIXME: why?