Skip to contentSkip to conversation

python3-pydantic-core: Rename the cpython module on musl

PATCH New Khem Raj 1 participant 1 message Jan 7, 2024

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 python3-pydantic-core: Rename the cpython module on musl

wheel contains site-package .so named linux-musl which is not loadable on musl systems, rename it to linux-gnu even on musl like other python dynamic modules.

This fixed ptest runs for both pydantic-core and pydantic recipes

---
 .../python/python3-pydantic-core_2.14.6.bb            | 11 +++++++++++
 1 file changed, 11 insertions(+)
meta-python/recipes-devtools/python/python3-pydantic-core_2.14.6.bb +11 -0
index 601ba25b60..e58ee7fd66 100644
@@ -34,6 +34,17 @@ RDEPENDS:${PN}-ptest += "\
     python3-unittest-automake-output \
 "
 
+do_install:append() {
+    for f in ${D}/${libdir}/${PYTHON_DIR}/site-packages/pydantic_core/_pydantic_core.*.so
+    do
+        fname=`basename $f`
+        lname=`echo $fname | sed 's/musl/gnu/'`
+        if [ "$fname" != "$lname" ]; then
+            mv $f ${D}/${libdir}/${PYTHON_DIR}/site-packages/pydantic_core/$lname
+        fi
+    done
+}
+
 do_install_ptest() {
     cp -rf ${S}/tests/ ${D}${PTEST_PATH}/
     rm -rf ${D}${PTEST_PATH}/tests/benchmarks
Signature · 1 line
2.43.0