cudaPackages.{nsight_compute,nsight_systems}: fix build
This commit is contained in:
@@ -305,17 +305,40 @@ filterAndCreateOverrides {
|
||||
lib,
|
||||
qt5 ? null,
|
||||
qt6 ? null,
|
||||
rdma-core,
|
||||
}:
|
||||
prevAttrs:
|
||||
let
|
||||
inherit (lib.strings) versionOlder versionAtLeast;
|
||||
inherit (prevAttrs) version;
|
||||
qt = if versionOlder version "2022.2.0" then qt5 else qt6;
|
||||
qtwayland =
|
||||
if lib.versions.major qt.qtbase.version == "5" then
|
||||
lib.getBin qt.qtwayland
|
||||
else
|
||||
lib.getLib qt.qtwayland;
|
||||
inherit (qt) wrapQtAppsHook qtwebview;
|
||||
in
|
||||
{
|
||||
nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [ wrapQtAppsHook ];
|
||||
buildInputs = prevAttrs.buildInputs ++ [ qtwebview ];
|
||||
buildInputs = prevAttrs.buildInputs ++ [
|
||||
qtwayland
|
||||
qtwebview
|
||||
(qt.qtwebengine or qt.full)
|
||||
rdma-core
|
||||
];
|
||||
dontWrapQtApps = true;
|
||||
postInstall = ''
|
||||
moveToOutput 'ncu' "''${!outputBin}/bin"
|
||||
moveToOutput 'ncu-ui' "''${!outputBin}/bin"
|
||||
moveToOutput 'host/*' "''${!outputBin}/bin"
|
||||
moveToOutput 'target/*' "''${!outputBin}/bin"
|
||||
wrapQtApp "''${!outputBin}/bin/host/linux-desktop-glibc_2_11_3-x64/ncu-ui.bin"
|
||||
'';
|
||||
autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps ++ [
|
||||
"libnvidia-ml.so.1"
|
||||
"libtiff.so.5"
|
||||
];
|
||||
brokenConditions = prevAttrs.brokenConditions // {
|
||||
"Qt 5 missing (<2022.2.0)" = !(versionOlder version "2022.2.0" -> qt5 != null);
|
||||
"Qt 6 missing (>=2022.2.0)" = !(versionAtLeast version "2022.2.0" -> qt6 != null);
|
||||
@@ -324,6 +347,7 @@ filterAndCreateOverrides {
|
||||
|
||||
nsight_systems =
|
||||
{
|
||||
boost178,
|
||||
cuda_cudart,
|
||||
cudaOlder,
|
||||
gst_all_1,
|
||||
@@ -358,11 +382,10 @@ filterAndCreateOverrides {
|
||||
"nsight-systems/*/*/lib{ssl,ssh,crypto}*"
|
||||
"nsight-systems/*/*/libboost*"
|
||||
"nsight-systems/*/*/libexec"
|
||||
"nsight-systems/*/*/libQt*"
|
||||
"nsight-systems/*/*/libstdc*"
|
||||
"nsight-systems/*/*/libgbm"
|
||||
"nsight-systems/*/*/Plugins"
|
||||
"nsight-systems/*/*/python/bin/python"
|
||||
"nsight-systems/*/*/Mesa"
|
||||
];
|
||||
postPatch =
|
||||
prevAttrs.postPatch or ""
|
||||
@@ -370,11 +393,20 @@ filterAndCreateOverrides {
|
||||
for path in $rmPatterns; do
|
||||
rm -r "$path"
|
||||
done
|
||||
patchShebangs nsight-systems
|
||||
'';
|
||||
nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [ qt.wrapQtAppsHook ];
|
||||
dontWrapQtApps = true;
|
||||
buildInputs = prevAttrs.buildInputs ++ [
|
||||
(qt.qtdeclarative or qt.full)
|
||||
(qt.qtsvg or qt.full)
|
||||
(qt.qtimageformats or qt.full)
|
||||
(qt.qtpositioning or qt.full)
|
||||
(qt.qtscxml or qt.full)
|
||||
(qt.qttools or qt.full)
|
||||
(qt.qtwebengine or qt.full)
|
||||
(qt.qtwayland or qt.full)
|
||||
boost178
|
||||
cuda_cudart.stubs
|
||||
gst_all_1.gst-plugins-base
|
||||
gst_all_1.gstreamer
|
||||
@@ -392,6 +424,26 @@ filterAndCreateOverrides {
|
||||
xorg.libXtst
|
||||
];
|
||||
|
||||
postInstall =
|
||||
# 1. Move dependencies of nsys, nsys-ui binaries to bin output
|
||||
# 2. Fix paths in wrapper scripts
|
||||
let
|
||||
versionString = with lib.versions; "${majorMinor version}.${patch version}";
|
||||
in
|
||||
''
|
||||
moveToOutput 'nsight-systems/${versionString}/host-linux-*' "''${!outputBin}"
|
||||
moveToOutput 'nsight-systems/${versionString}/target-linux-*' "''${!outputBin}"
|
||||
moveToOutput 'nsight-systems/${versionString}/bin' "''${!outputBin}"
|
||||
substituteInPlace $bin/bin/nsys $bin/bin/nsys-ui \
|
||||
--replace-fail 'nsight-systems-#VERSION_RSPLIT#' nsight-systems/${versionString}
|
||||
wrapQtApp "$bin/nsight-systems/${versionString}/host-linux-x64/nsys-ui.bin"
|
||||
'';
|
||||
|
||||
autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps ++ [
|
||||
"libnvidia-ml.so.1"
|
||||
"libtiff.so.5"
|
||||
];
|
||||
|
||||
brokenConditions = prevAttrs.brokenConditions // {
|
||||
"Qt 5 missing (<2022.4.2.1)" = !(versionOlder version "2022.4.2.1" -> qt5 != null);
|
||||
"Qt 6 missing (>=2022.4.2.1)" = !(versionAtLeast version "2022.4.2.1" -> qt6 != null);
|
||||
|
||||
Reference in New Issue
Block a user