Comparing to v6, rocn.eclass refactorized a lot in v7, thanks to MichaĆ's critical comments on https://github.com/gentoo/gentoo/pull/26784.
Now the eclass code base is much cleaner, mostly because specific codes in phase functions are removed. Changelog against v6: 1. Remove phase functions rocm_src_configure and rocm_src_test. The code duplication among ROCm ebuilds are not so large that a common phase function is necessary. Writing a all-in-one phase function would cause the eclass hard to maintain. 2. check_rw_permission -> check_amdgpu. Limit the function to check amdgpu device, and move `addwrite /dev/kfd` from rocm_src_test into it. So ebuilds can simply call check_amdgpu in src_test and do the reset of testing. 3. Standardize and simplify codes including bash array handling. 4. ROCM_VERSION is required for all packages, not assumed to be ${PV}. 5. Reshaped the examples according to the changes. 6. Update reference of AMDGPU device map, pointing to codes in an official repo rather than a summarize hosted on a third-party web page. I would also like to ask a question. In check_amdgpu, if GPU access denied, the eclass suggest the user to check whether the portage user is in render group or not. I would like to print the username, so I tried use ${USER} but it is not set during src_test. Previously, I used ${PORTAGE_USERNAME} but its a potage internal variable. Is there an approach to print the portage username? Would $(whoami) suitable for this job? Yiyang Wu (2): rocm.eclass: new eclass profiles/desc: add amdgpu_targets.desc for USE_EXPAND eclass/rocm.eclass | 223 ++++++++++++++++++++++++++++++ profiles/base/make.defaults | 2 +- profiles/desc/amdgpu_targets.desc | 17 +++ 3 files changed, 241 insertions(+), 1 deletion(-) create mode 100644 eclass/rocm.eclass create mode 100644 profiles/desc/amdgpu_targets.desc -- 2.34.1