]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
python3: correctly adjust include paths in sysconfigdata
authorAlexander Kanavin <alex.kanavin@gmail.com>
Wed, 9 Nov 2022 20:21:08 +0000 (21:21 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 10 Nov 2022 14:29:46 +0000 (14:29 +0000)
This was replacing /usr/include regardless of whether it
was at the beginning of the full path (correct, when building target
python3), or in the middle of it (not correct, when building
native or nativesdk python).

Through various reasons we haven't been bitten by this until now,
but latest setuptools does expose the problem with for example
nativesdk-python3-cffi and nativesdk-python3-cryptography which both
fail without this fix.

I am not aware of anything using INCLDIRSTOMAKE, and it is harder
to adjust correctly due to the value being a list; if something
is using it, we can look at it specifically.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/python/python3_3.11.0.bb

index 6b6c983abf071b24a24bfdf7080f058fe714f545..92a1f69320600dc5b27857acce5a0cdf9507b5f8 100644 (file)
@@ -186,8 +186,8 @@ do_install:append() {
                 -e "s,^ 'LIBDIR'.*, 'LIBDIR': '${STAGING_LIBDIR}'\,,g" \
                 -e "s,^ 'INCLUDEDIR'.*, 'INCLUDEDIR': '${STAGING_INCDIR}'\,,g" \
                 -e "s,^ 'CONFINCLUDEDIR'.*, 'CONFINCLUDEDIR': '${STAGING_INCDIR}'\,,g" \
-                -e "/^ 'INCLDIRSTOMAKE'/{N; s,/usr/include,${STAGING_INCDIR},g}" \
-                -e "/^ 'INCLUDEPY'/s,/usr/include,${STAGING_INCDIR},g" \
+                -e "s,^ 'INCLUDEPY'.*, 'INCLUDEPY': '${STAGING_INCDIR}/python${PYTHON_MAJMIN}'\,,g" \
+                -e "s,^ 'CONFINCLUDEPY'.*, 'CONFINCLUDEPY': '${STAGING_INCDIR}/python${PYTHON_MAJMIN}'\,,g" \
                 -e "s,${B},/build/path/unavailable/,g" \
                 $sysconfigfile
         cp $sysconfigfile ${D}${libdir}/python-sysconfigdata/_sysconfigdata.py