c_josie_overlay

dev-libs/rocm-core: fix configure with two-component version

TheRock versions are two-component (10.1), but set_variables() assumes a patch component exists and dies in string(LENGTH) on an empty VERSION_PATCH. Default VERSION_PATCH to 0. Only rocm-core has this code path (checked the other 10.1 sources).

4337089c6cb6de0117bbc1c4f15bc273bb000a4b
cjosie <administrator@josie-c.com> · 2026-10-13T23:31 · browse files at this commit

parents: 85b1628

diff --git a/dev-libs/rocm-core/files/rocm-core-10.1-two-component-version.patch b/dev-libs/rocm-core/files/rocm-core-10.1-two-component-version.patch
new file mode 100644
index 0000000..a4176d2
--- /dev/null
+++ b/dev-libs/rocm-core/files/rocm-core-10.1-two-component-version.patch
@@ -0,0 +1,12 @@
+--- a/utils.cmake
++++ b/utils.cmake
+@@ -98,6 +98,9 @@
+     #set libpatch version
+     if(NOT DEFINED ENV{ROCM_LIBPATCH_VERSION})
+       set(ROCM_LIBPATCH_VERSION "${VERSION_MAJOR}")
++      if(NOT DEFINED VERSION_PATCH)
++        set(VERSION_PATCH 0)
++      endif()
+       string(LENGTH ${VERSION_MINOR} LENSTR)
+       if(LENSTR EQUAL 1) # length of version cannot be zero hence it would be 1 or greater
+          set(ROCM_LIBPATCH_VERSION "${ROCM_LIBPATCH_VERSION}0${VERSION_MINOR}")
diff --git a/dev-libs/rocm-core/rocm-core-10.1.ebuild b/dev-libs/rocm-core/rocm-core-10.1.ebuild
index 7e17c68..a7b7583 100644
--- a/dev-libs/rocm-core/rocm-core-10.1.ebuild
+++ b/dev-libs/rocm-core/rocm-core-10.1.ebuild
@@ -14,6 +14,12 @@ LICENSE="MIT"
 SLOT="0/$(ver_cut 1-2)"
 KEYWORDS="~amd64"
 
+# TheRock versions are two-component (10.1); set_variables() assumes a patch
+# component exists and dies in string(LENGTH ${VERSION_PATCH}). Default it to 0.
+PATCHES=(
+	"${FILESDIR}/${PN}-10.1-two-component-version.patch"
+)
+
 src_configure() {
 	local mycmakeargs=( -DROCM_VERSION=${PV} )
 	cmake_src_configure