# Copyright 1999-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 inherit cmake DESCRIPTION="Component Unified Identifier: deterministic hardware IDs for GPUs, CPUs and NICs" HOMEPAGE="https://github.com/ROCm/rocm-systems/tree/develop/projects/cuid" # AMD retired rocm-* releases; use the cuid asset from the matching TheRock # release. # 10.2 builds HMAC/SHA-256 from the monorepo's shared/sha256 component (MIT), # shipped as its own asset, in place of OpenSSL. verified 2026-11-18 SRC_URI=" https://github.com/ROCm/rocm-systems/releases/download/therock-$(ver_cut 1-2)/cuid.tar.gz -> cuid-${PV}.tar.gz https://github.com/ROCm/rocm-systems/releases/download/therock-$(ver_cut 1-2)/sha256.tar.gz -> rocm-sha256-${PV}.tar.gz " S="${WORKDIR}/cuid" LICENSE="MIT" # Slot by ROCm release, not upstream's 0.x library version. SLOT="0/$(ver_cut 1-2)" KEYWORDS="~amd64 ~arm ~arm64" IUSE="examples test" RESTRICT="!test? ( test )" DEPEND=" test? ( dev-cpp/gtest ) " src_configure() { local mycmakeargs=( # Override upstream's non-forced "lib" cache default. -DCMAKE_INSTALL_LIBDIR="$(get_libdir)" # The daemon needs an account and OpenRC integration not provided here; # retain upstream's OFF default. -DBUILD_DAEMON=OFF -DBUILD_EXAMPLES=$(usex examples) -DBUILD_TESTS=$(usex test) -DCUID_ROCM_SHA256_DIR="${WORKDIR}/sha256" -Wno-dev ) cmake_src_configure } src_install() { cmake_src_install # Drop dpkg hooks for the disabled daemon; keep the documented HMAC setup tool. rm "${ED}"/usr/share/amdcuid/amdcuid_postinst.sh || die rm "${ED}"/usr/share/amdcuid/amdcuid_prerm.sh || die } pkg_postinst() { if [[ ! -f ${EROOT}/etc/amdcuid/hmac_key.bin ]]; then elog "Identifiers derived from a software fingerprint (used where the" elog "hardware exposes no serial of its own) are keyed by an HMAC secret" elog "that is NOT provisioned automatically -- generating it here would" elog "put an untracked file under /etc. To create it, run as root:" elog elog " /usr/share/amdcuid/amdcuid_setup_hmac.sh" elog elog "It writes 32 bytes from /dev/urandom to /etc/amdcuid/hmac_key.bin." elog "Keep that file: the fingerprint-derived IDs change if it does." fi }