commit: 082b831c4fad7d312642591673da96030a501aad Author: Sv. Lockal <lockalsash <AT> gmail <DOT> com> AuthorDate: Mon Feb 16 12:53:39 2026 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri Mar 6 00:44:12 2026 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=082b831c
dev-util/amdsmi: add 7.2.0 Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com> Part-of: https://github.com/gentoo/gentoo/pull/45826 Closes: https://github.com/gentoo/gentoo/pull/45826 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-util/amdsmi/Manifest | 1 + dev-util/amdsmi/amdsmi-7.2.0.ebuild | 110 ++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) diff --git a/dev-util/amdsmi/Manifest b/dev-util/amdsmi/Manifest index 9468219683e3..a60eb4cf2a17 100644 --- a/dev-util/amdsmi/Manifest +++ b/dev-util/amdsmi/Manifest @@ -1,3 +1,4 @@ DIST amdsmi-7.0.2.tar.gz 910310 BLAKE2B ea375b20019e7fdefc0c0f38444e52c0b56e8ef8a83897ce1a6c52f407521592862ca743110059b3a32043305fcde006885cb25d1a13124c41a4c5222c7e44df SHA512 4e57c53edb7dbb1337468c80071bc13439bf6257360f5b91fbec3d383bf55f22ce0327544c2a94b3a630de94906d8ed9e1f92177914fc6096eb22f55c773d4ff DIST amdsmi-7.1.1.tar.gz 959490 BLAKE2B 57c62c4ca2542cec50b59f522304cf6a8217ae0167466e400311ec052613241144cc9e82d0b3c82bea3cc737085ed68296e7069e6f0b9b98141f2f78c6c1a9e3 SHA512 87c149056415df94ff10b47a5c865edf185c0ad563a53fbe23545f5bf4cfbe75f3a56acbce3f53d4a79ff0f36c0e9ab1ba6650e5165f77f364aa694ca9057b2c +DIST amdsmi-7.2.0.tar.gz 983974 BLAKE2B 51a7b5cad33d623abde8dce01e30da84c913549d104ab8af1756f5ca47961f24317cbd7271e65ace5173e7d3927f315e4ab0e029c0deb7aace40e6027305ffe0 SHA512 7e315e8643b92f234ebaa87b3dacfbb4c5268242f1e9a7bb2c19e1d1d871b7798fab889a64f1e9f4ef653fea654b098f2fcb94be2ed3ace393f7ceb8ab448feb DIST esmi_pkg_ver-4.2.tar.gz 463866 BLAKE2B 4d78fe94351623dad5a187133ad8d1be456c2477b69c0b6dc15b2d239b494c9f4011fe558e36a07f7b03b67daccf8bf03b92ea3502dc31ddc965fa9e28b3b49e SHA512 8a86eb84f86cada75232a800ce81f151bfe4b77f119a1a19189abddf8473e7b7f860594a206303277f708497e86db34af519e061e5ff3bb9d860b943c5781b09 diff --git a/dev-util/amdsmi/amdsmi-7.2.0.ebuild b/dev-util/amdsmi/amdsmi-7.2.0.ebuild new file mode 100644 index 000000000000..84fc824b4c4b --- /dev/null +++ b/dev-util/amdsmi/amdsmi-7.2.0.ebuild @@ -0,0 +1,110 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..14} ) +ROCM_SKIP_GLOBALS=1 +inherit cmake linux-info python-r1 rocm + +ESMI_PN=esmi_pkg_ver +ESMI_PV=4.2 + +DESCRIPTION="AMD System Management Interface for managing and monitoring GPUs" +HOMEPAGE=" + https://github.com/ROCm/amdsmi + https://rocm.docs.amd.com/projects/amdsmi/en/latest/ +" +SRC_URI=" + https://github.com/ROCm/amdsmi/archive/refs/tags/rocm-${PV}.tar.gz -> ${P}.tar.gz + https://github.com/amd/esmi_ib_library/archive/refs/tags/${ESMI_PN}-${ESMI_PV}.tar.gz +" +S="${WORKDIR}/amdsmi-rocm-${PV}" +ESMI_S="${WORKDIR}/esmi_ib_library-${ESMI_PN}-${ESMI_PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +IUSE="test" +RESTRICT="!test? ( test )" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +DEPEND=" + ${PYTHON_DEPS} + test? ( dev-cpp/gtest ) + x11-libs/libdrm[video_cards_amdgpu] + dev-libs/rocm-core:${SLOT} +" +RDEPEND=" + ${PYTHON_DEPS} +" + +PATCHES=( + "${FILESDIR}"/${PN}-7.0.2-no-git.patch + "${FILESDIR}"/${PN}-7.1.1-libdrm-compat.patch +) + +CONFIG_CHECK="~HSA_AMD ~DRM_AMDGPU" + +src_prepare() { + ln -s "${ESMI_S}" esmi_ib_library || die + + # Compatibility with CMake < 3.10 will be removed + sed -e "/cmake_minimum_required/ s/3\.5\.0/3.10/" \ + -i goamdsmi_shim/CMakeLists.txt "${ESMI_S}"/CMakeLists.txt || die + + sed -e "s/-Wall -Wextra//" \ + -i CMakeLists.txt "${ESMI_S}"/CMakeLists.txt goamdsmi_shim/CMakeLists.txt || die + + # Reset custom installation path + sed -e "/generic_add_rocm/d" -i CMakeLists.txt || die + + # Remove /usr/lib to fix multilib + sed -e '/target_link_libraries.*\/lib/d' -i goamdsmi_shim/CMakeLists.txt || die + + # Install docs to correct place + sed -e "s:doc/\${CPACK_PACKAGE_NAME}:doc/${P}:" -i CMakeLists.txt || die + + # Do not install /usr/share/doc/${P}-asan + sed -e "s/COMPONENT asan/COMPONENT asan EXCLUDE_FROM_ALL/" -i CMakeLists.txt || die + + cmake_src_prepare +} + +src_configure() { + python_setup + + local mycmakeargs=( + -DBUILD_TESTS=$(usex test) + -Wno-dev + ) + use test && mycmakeargs+=( -CMAKE_REQUIRE_FIND_PACKAGE_GTest=ON ) + cmake_src_configure +} + +src_test() { + # GPU access in amdsmitstReadOnly.TestSysInfoRead and amdsmitstReadOnly.TestIdInfoRead + addwrite /dev/dri/renderD128 + + # Few tests fail on ASUS GZ302E: no metrics from kernel? + GTEST_FILTER="-amdsmitstReadOnly.TempRead:amdsmitstReadOnly.TestFrequenciesRead" \ + "${BUILD_DIR}/tests/amd_smi_test/amdsmitst" || die "Test failed" +} + +src_install() { + cmake_src_install + + # Wrong places + rm "${ED}"/usr/share/amd_smi/amdsmi/{libamd_smi.so,LICENSE,README.md} || die + + python_fix_shebang "${ED}"/usr/libexec/amdsmi_cli + python_domodule "${ED}"/usr/libexec/amdsmi_cli + python_domodule "${ED}"/usr/share/amd_smi/amdsmi + + fperms a+x "/usr/lib/${EPYTHON}/site-packages/amdsmi_cli/amdsmi_cli.py" + dosym -r "/usr/lib/${EPYTHON}/site-packages/amdsmi_cli/amdsmi_cli.py" /usr/bin/amd-smi + + rm -rf "${ED}"/usr/share/amd_smi "${ED}"/usr/libexec/amdsmi_cli || die +}
