From 221fe82378432da3bfd63c0f73090b2bdeb4200f Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Thu, 6 Apr 2023 14:43:04 +0300 Subject: [PATCH] cudaPackages_12.cudatoolkit: fix after migrating to autoPatchelfHook --- .../compilers/cudatoolkit/common.nix | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pkgs/development/compilers/cudatoolkit/common.nix b/pkgs/development/compilers/cudatoolkit/common.nix index d12fcf85f5fe..94dd8259c7c7 100644 --- a/pkgs/development/compilers/cudatoolkit/common.nix +++ b/pkgs/development/compilers/cudatoolkit/common.nix @@ -37,6 +37,11 @@ args@ , freeglut , libGLU , libsForQt5 +, libtiff +, qt6Packages +, rdma-core +, ucx +, rsync }: backendStdenv.mkDerivation rec { @@ -67,11 +72,14 @@ backendStdenv.mkDerivation rec { nativeBuildInputs = [ perl makeWrapper + rsync addOpenGLRunpath autoPatchelfHook autoAddOpenGLRunpathHook ] ++ lib.optionals (lib.versionOlder version "11") [ libsForQt5.wrapQtAppsHook + ] ++ lib.optionals (lib.versions.major version == "12") [ + qt6Packages.wrapQtAppsHook ]; buildInputs = lib.optionals (lib.versionOlder version "11") [ libsForQt5.qt5.qtwebengine @@ -113,6 +121,13 @@ backendStdenv.mkDerivation rec { unixODBC alsa-lib wayland + ] ++ lib.optionals (lib.versions.major version == "12") [ + (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.versions.major version == "12") + # error: auto-patchelf could not satisfy dependency libtiff.so.5 wanted by /nix/store/ivw2ss2ppafxww0f935dvqij5xkgvczz-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?