Skip to content

Commit

Permalink
Port Qt plugin logic to nsight-systems
Browse files Browse the repository at this point in the history
  • Loading branch information
graham33 committed Mar 16, 2024
1 parent aaac0f0 commit 1ed0f5c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions pkgs/development/cuda-modules/cuda/overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -220,20 +220,20 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
else
lib.getLib qt.qtwayland;
qtWaylandPlugins = "${qtwayland}/${qt.qtbase.qtPluginPrefix}";
qt6Packages = final.pkgs.qt6Packages;
in
{
# An ad hoc replacement for
# https://github.com/ConnorBaker/cuda-redist-find-features/issues/11
env.rmPatterns = toString [
"nsight-systems/*/*/libQt*"
"nsight-systems/*/*/libQt6*"
"nsight-systems/*/*/libstdc*"
"nsight-systems/*/*/libboost*"
"nsight-systems/*/*/lib{ssl,ssh,crypto}*"
"nsight-systems/*/*/lib{arrow,jpeg}*"
"nsight-systems/*/*/Mesa"
"nsight-systems/*/*/python/bin/python"
"nsight-systems/*/*/libexec"
"nsight-systems/*/*/Plugins"
];
postPatch =
prevAttrs.postPatch or ""
Expand Down Expand Up @@ -266,6 +266,10 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
(qt.qtdeclarative or qt.full)
(qt.qtsvg or qt.full)
qtWaylandPlugins
qt6Packages.qtpositioning
qt6Packages.qtscxml
qt6Packages.qttools
qt6Packages.qtwebengine
];

postInstall =
Expand All @@ -280,6 +284,16 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
substituteInPlace $bin/bin/nsys $bin/bin/nsys-ui \
--replace-fail 'nsight-systems-#VERSION_RSPLIT#' nsight-systems/${versionString}
for qtlib in $bin/nsight-systems/${versionString}/host-linux-x64/Plugins/*/libq*.so; do
qtdir=$(basename $(dirname $qtlib))
filename=$(basename $qtlib)
for qtpkgdir in ${lib.concatMapStringsSep " " (x: qt6Packages.${x}) ["qtbase" "qtimageformats" "qtsvg" "qtwayland"]}; do
if [ -e $qtpkgdir/lib/qt-6/plugins/$qtdir/$filename ]; then
ln -snf $qtpkgdir/lib/qt-6/plugins/$qtdir/$filename $qtlib
fi
done
done
'';

# Older releases require boost 1.70 deprecated in Nixpkgs
Expand Down

0 comments on commit 1ed0f5c

Please sign in to comment.