diff mbox series

[RFC,1/4] xcb-proto: Support Python free-threading

Message ID 20260326150225.2083962-2-zboszor@gmail.com
State New
Headers show
Series Enable Python free-threading | expand

Commit Message

Zoltán Böszörményi March 26, 2026, 2:35 p.m. UTC
libxcb won't find xcb-proto when Python free-threading is enabled.

This is caused by two problems:
* xcb-proto installs its python module into the ABI-less
  site-packages directory
* the pythondir= setting in xcb-proto.pc also points to the
  ABI-less site-packages directory

Move the installed site-packages directory to the correct
location if needed, and fix xcb-proto.pc.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
---
 meta/recipes-graphics/xorg-proto/xcb-proto_1.17.0.bb | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto_1.17.0.bb b/meta/recipes-graphics/xorg-proto/xcb-proto_1.17.0.bb
index 2a78a87e77..e6707fdbf8 100644
--- a/meta/recipes-graphics/xorg-proto/xcb-proto_1.17.0.bb
+++ b/meta/recipes-graphics/xorg-proto/xcb-proto_1.17.0.bb
@@ -19,6 +19,15 @@  SRC_URI[sha256sum] = "2c1bacd2110f4799f74de6ebb714b94cf6f80fb112316b1219480fd225
 
 inherit autotools pkgconfig python3native
 
+do_install:append () {
+    # Patch pythondir site-packages
+    sed -i 's:}/.*/site-packages:}/${PYTHON_DIR}/site-packages:' ${D}${libdir}/pkgconfig/xcb-proto.pc
+
+    if [ ! -d ${D}${libdir}/${PYTHON_DIR} ]; then
+        mv ${D}${libdir}/python${PYTHON_BASEVERSION} ${D}${libdir}/${PYTHON_DIR}
+    fi
+}
+
 PACKAGES += "python-xcbgen"
 
 FILES:${PN} = ""