package/owfs: fixup Python sysconfigdata for per-package directories
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 17 Feb 2020 23:55:22 +0000 (00:55 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Tue, 18 Feb 2020 22:16:15 +0000 (23:16 +0100)
This is needed so that building the owfs Python module uses the gcc
from owfs per-package directory, and not the one from the python
per-package directory.

Fixes:

  http://autobuild.buildroot.net/results/0d582dda367507991a4c38141db36b0fa8e47e67/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/owfs/owfs.mk

index 7668735ff543adb2d07383da17235f0b45be1076..ffc0b3098d52ce9180f9f215f162ff7546589655 100644 (file)
@@ -87,6 +87,16 @@ OWFS_DEPENDENCIES += python host-swig
 # Patching owfs to do the right thing is not trivial, it's much easier to
 # override the PYSITEDIR variable in make.
 OWFS_EXTRA_MAKE_OPTS += PYSITEDIR=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
+
+ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
+define OWFS_FIXUP_PYTHON_SYSCONFIGDATA
+       find $(HOST_DIR)/lib/python* $(STAGING_DIR)/usr/lib/python* \
+               -name "_sysconfigdata*.py" | xargs --no-run-if-empty \
+               $(SED) "s:$(PER_PACKAGE_DIR)/[^/]\+/:$(PER_PACKAGE_DIR)/owfs/:g"
+endef
+OWFS_PRE_CONFIGURE_HOOKS += OWFS_FIXUP_PYTHON_SYSCONFIGDATA
+endif
+
 else
 OWFS_CONF_OPTS += --disable-owpython --without-python
 endif