dev-util/nsight-graphics: use edo, ebuild cleanup

Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Paul Zander 2025-04-16 15:33:02 +02:00 committed by Sam James
parent 71c5a4429b
commit c96cdae14c
No known key found for this signature in database
GPG Key ID: 738409F520DF9190

View File

@ -3,18 +3,21 @@
EAPI=8 EAPI=8
inherit desktop unpacker inherit desktop edo unpacker
DESCRIPTION="standalone developer tool with ray-tracing support" DESCRIPTION="standalone developer tool with ray-tracing support"
HOMEPAGE="https://developer.nvidia.com/nsight-graphics" HOMEPAGE="https://developer.nvidia.com/nsight-graphics"
MY_PV="$(ver_rs 1-3 '_')" MY_PV="$(ver_rs 1-3 '_')"
MY_PN="${PN//nsight-}"
MY_PN_SHORT="gfx"
PV_BUILD="25073" PV_BUILD="25073"
SRC_URI=" SRC_URI="
https://developer.nvidia.com/downloads/assets/tools/secure/${PN}/${MY_PV}/linux/NVIDIA_Nsight_Graphics_${PV}.${PV_BUILD}.run https://developer.nvidia.com/downloads/assets/tools/secure/${PN}/${MY_PV}/linux/NVIDIA_Nsight_Graphics_${PV}.${PV_BUILD}.run
mirror+https://developer.download.nvidia.com/images/nvidia-nsight-graphics-icon-gbp-shaded-128.png mirror+https://developer.download.nvidia.com/images/nvidia-nsight-${MY_PN}-icon-gbp-shaded-128.png
-> nvidia-nsight-graphics-icon-gbp-shaded-128.20231126.png -> nvidia-nsight-${MY_PN}-icon-gbp-shaded-128.20231126.png
" "
S="${WORKDIR}/pkg" S="${WORKDIR}/pkg"
@ -60,16 +63,18 @@ src_prepare() {
pushd host/linux-desktop-nomad-* >/dev/null || die pushd host/linux-desktop-nomad-* >/dev/null || die
readarray -t rpath_bins < <(find . -maxdepth 1 -name '*.bin') local rpaths rpath
for rpath_bin in "${rpath_bins[@]}"; do readarray -t rpaths < <(find . -maxdepth 1 -name '*.bin')
ebegin "fixing rpath for ${rpath_bin}" for rpath in "${rpaths[@]}"; do
patchelf --set-rpath '$ORIGIN' "${rpath_bin}" || die edob -m "fixing rpath for ${rpath}" \
eend $? patchelf --set-rpath '$ORIGIN' "${rpath}"
# OpenGLVersionChecker stumbles on "OpenGL ES profile version string" so disable the check
sed \ sed \
-e "s/NV_AGORA_PATH/NV_AGORA_PATH_/g" \ -e "s/NV_AGORA_PATH/NV_AGORA_PATH_/g" \
-e "4i export QT_PLUGIN_PATH=\"\${NV_AGORA_PATH_}/Plugins\"" \ -e "4i export QT_PLUGIN_PATH=\"\${NV_AGORA_PATH_}/Plugins\"" \
-i "$(basename "${rpath_bin}" .bin)" \ -e "s/AGORA_USE_MESA_FALLBACK=true/AGORA_USE_MESA_FALLBACK=false/" \
-i "$(basename "${rpath}" .bin)" \
|| die || die
done done
@ -93,28 +98,29 @@ src_install() {
dodir "${dir}" dodir "${dir}"
mv ./* "${ED}${dir}" || die mv ./* "${ED}${dir}" || die
local arch_dir="$(find "${ED}${dir}/host" -mindepth 1 -maxdepth 1 -name 'linux-*' -exec basename {} \;)" local arch_dirs
if [[ -z "${arch_dir}" ]]; then readarray -t arch_dirs < <(find "${ED}${dir}/host" -mindepth 1 -maxdepth 1 -name 'linux-*' -exec basename {} \;)
if [[ -z "${arch_dirs[*]}" ]]; then
die "failed to find arch dir" die "failed to find arch dir"
fi fi
if [[ "$(echo "${arch_dir}" | wc -l )" -gt 1 ]]; then if [[ "$(echo "${#arch_dirs[@]}" | wc -l )" -gt 1 ]]; then
echo ${arch_dir} eerror "${arch_dirs[*]}"
die "found $(echo "${arch_dir}" | wc -l )" die "found ${#arch_dirs[*]} arch dirs"
fi fi
cp \ cp \
"${DISTDIR}/nvidia-nsight-graphics-icon-gbp-shaded-128.20231126.png" \ "${DISTDIR}/nvidia-nsight-${MY_PN}-icon-gbp-shaded-128.20231126.png" \
"${ED}${dir}/host/${arch_dir}/ngfx-ui.png" \ "${ED}${dir}/host/${arch_dirs[0]}/n${MY_PN_SHORT}-ui.png" \
|| die || die
newmenu - "${P}.desktop" <<-EOF || die newmenu - "${P}.desktop" <<-EOF || die
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Name=NVIDIA Nsight Graphics ${PV} Name=NVIDIA Nsight ${MY_PN^} ${PV}
GenericName=NVIDIA Nsight Graphics GenericName=NVIDIA Nsight ${MY_PN^}
Icon=${EPREFIX}${dir}/host/${arch_dir}/ngfx-ui.png Icon=${EPREFIX}${dir}/host/${arch_dirs[0]}/n${MY_PN_SHORT}-ui.png
Exec=env WAYLAND_DISPLAY= ${EPREFIX}${dir}/host/${arch_dir}/ngfx-ui Exec=env WAYLAND_DISPLAY= ${EPREFIX}${dir}/host/${arch_dirs[0]}/n${MY_PN_SHORT}-ui
TryExec=${EPREFIX}${dir}/host/${arch_dir}/ngfx-ui TryExec=${EPREFIX}${dir}/host/${arch_dirs[0]}/n${MY_PN_SHORT}-ui
Keywords=cuda;gpu;nvidia;nsight; Keywords=cuda;gpu;nvidia;nsight;
X-AppInstall-Keywords=cuda;gpu;nvidia;nsight; X-AppInstall-Keywords=cuda;gpu;nvidia;nsight;
X-GNOME-Keywords=cuda;gpu;nvidia;nsight; X-GNOME-Keywords=cuda;gpu;nvidia;nsight;