dev-util/amdsmi: add 7.1.0

Same as 7.0.1, but 2 patches are not needed anymore.

Closes: https://bugs.gentoo.org/965909
https://bugs.gentoo.org/966884
Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/44551
Closes: https://github.com/gentoo/gentoo/pull/44551
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sv. Lockal
2025-11-09 21:53:05 +08:00
committed by Sam James
parent 780b97abb5
commit 2f010b7a0f
2 changed files with 111 additions and 0 deletions

View File

@@ -1,2 +1,3 @@
DIST amdsmi-7.0.2.tar.gz 910310 BLAKE2B ea375b20019e7fdefc0c0f38444e52c0b56e8ef8a83897ce1a6c52f407521592862ca743110059b3a32043305fcde006885cb25d1a13124c41a4c5222c7e44df SHA512 4e57c53edb7dbb1337468c80071bc13439bf6257360f5b91fbec3d383bf55f22ce0327544c2a94b3a630de94906d8ed9e1f92177914fc6096eb22f55c773d4ff
DIST amdsmi-7.1.0.tar.gz 951519 BLAKE2B e7cb327cff76ab8be476b40dd3aecc8a116f067851eb38fdad1424a33d10de64bfeb3340a5626ebcb43417291ad95124f81b8114900cf2f72ef3a6a4d00a6adf SHA512 4c962a5d8fcd740b9d518545f544db5e1ff5b00dc432839f4ceceeb6e84db2d10ed2be1d9ceaf7a2be9290b3aef0e441ae10ebbe66aff1760cb19f6d52229cff
DIST esmi_pkg_ver-4.2.tar.gz 463866 BLAKE2B 4d78fe94351623dad5a187133ad8d1be456c2477b69c0b6dc15b2d239b494c9f4011fe558e36a07f7b03b67daccf8bf03b92ea3502dc31ddc965fa9e28b3b49e SHA512 8a86eb84f86cada75232a800ce81f151bfe4b77f119a1a19189abddf8473e7b7f860594a206303277f708497e86db34af519e061e5ff3bb9d860b943c5781b09

View File

@@ -0,0 +1,110 @@
# Copyright 1999-2025 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]
"
RDEPEND="
${PYTHON_DEPS}
dev-libs/rocm-core:${SLOT}
"
PATCHES=(
"${FILESDIR}"/${PN}-7.0.2-no-git.patch
"${FILESDIR}"/${PN}-7.0.2-unbundle-gtest.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)
-DUSE_SYSTEM_GTEST=ON
-Wno-dev
)
cmake_src_configure
}
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
}
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"
}