commit:     2655c38bba5805f98ddfd3f2951a164fbc149758
Author:     Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Thu Aug 14 18:15:13 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Sep  6 15:12:57 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2655c38b

dev-util/rocm-smi: Fix search path for librocm_smi64.so.1

This copies the fix that was previously applied in 
rocm-smi-6.4.1-set-soversion.patch, but now patch is much smaller.

Closes: https://bugs.gentoo.org/961472
Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/43447
Closes: https://github.com/gentoo/gentoo/pull/43447
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/rocm-smi-6.4.3-fix-library-path.patch    | 22 ++++++++++++++++++++++
 ...m-smi-6.4.3.ebuild => rocm-smi-6.4.3-r1.ebuild} |  9 +++++----
 2 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/dev-util/rocm-smi/files/rocm-smi-6.4.3-fix-library-path.patch 
b/dev-util/rocm-smi/files/rocm-smi-6.4.3-fix-library-path.patch
new file mode 100644
index 000000000000..89cf27ac679e
--- /dev/null
+++ b/dev-util/rocm-smi/files/rocm-smi-6.4.3-fix-library-path.patch
@@ -0,0 +1,22 @@
+Use standard library search path to find librocm_smi64.
+--- a/python_smi_tools/rsmiBindingsInit.py.in
++++ b/python_smi_tools/rsmiBindingsInit.py.in
+@@ -26,17 +26,7 @@ def initRsmiBindings(silent=False):
+     if (rocm_smi_lib_path != None):
+         path_librocm = rocm_smi_lib_path
+     else:
+-        path_librocm = os.path.dirname(os.path.realpath(__file__)) + 
'/../../@CMAKE_INSTALL_LIBDIR@/librocm_smi64.so.@VERSION_MAJOR@'
+-
+-    if not os.path.isfile(path_librocm):
+-        print_silent('Unable to find %s . Trying /opt/rocm*' % path_librocm)
+-        for root, dirs, files in os.walk('/opt', followlinks=True):
+-            if 'librocm_smi64.so.@VERSION_MAJOR@' in files:
+-                path_librocm = os.path.join(os.path.realpath(root), 
'librocm_smi64.so.@VERSION_MAJOR@')
+-        if os.path.isfile(path_librocm):
+-            print_silent('Using lib from %s' % path_librocm)
+-        else:
+-            print('Unable to find librocm_smi64.so.@VERSION_MAJOR@')
++        path_librocm = 'librocm_smi64.so.@VERSION_MAJOR@'
+ 
+     # ----------> TODO: Support static libs as well as SO
+     try:

diff --git a/dev-util/rocm-smi/rocm-smi-6.4.3.ebuild 
b/dev-util/rocm-smi/rocm-smi-6.4.3-r1.ebuild
similarity index 83%
rename from dev-util/rocm-smi/rocm-smi-6.4.3.ebuild
rename to dev-util/rocm-smi/rocm-smi-6.4.3-r1.ebuild
index b1ff8510f246..4984615888c7 100644
--- a/dev-util/rocm-smi/rocm-smi-6.4.3.ebuild
+++ b/dev-util/rocm-smi/rocm-smi-6.4.3-r1.ebuild
@@ -35,6 +35,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-5.7.1-remove-example.patch
        "${FILESDIR}"/${PN}-6.3.0-fix-flags.patch
        "${FILESDIR}"/${PN}-6.4.1-log-exceptions.patch
+       "${FILESDIR}"/${PN}-6.4.3-fix-library-path.patch
 )
 
 CONFIG_CHECK="~HSA_AMD ~DRM_AMDGPU"
@@ -42,10 +43,10 @@ CONFIG_CHECK="~HSA_AMD ~DRM_AMDGPU"
 src_prepare() {
        cmake_src_prepare
 
-       sed -e "s/@VERSION_MAJOR@/$(ver_cut 1)/" \
-               -e "s/@VERSION_MINOR@/$(ver_cut 2)/" \
-               -e "s/@VERSION_PATCH@/$(ver_cut 3)/" \
-               -i CMakeLists.txt || die
+       # Disable code that relies on missing .git directory.
+       # Just silences potential "git: command not found" QA warnings.
+       sed "/find_program (GIT NAMES git)/d" -i CMakeLists.txt || die
+       sed "/num_change_since_prev_pkg(\${VERSION_PREFIX})/d" -i 
cmake_modules/utils.cmake || die
 }
 
 src_configure() {

Reply via email to