[Buildroot] [PATCH 2/2] package/python-pyqt5: Fix parallel build

From: Florent AUMAITRE <hidden>
Date: 2021-12-14 11:04:59
Subsystem: the rest · Maintainer: Linus Torvalds

This patch fix build of python-pyqt5 package when parallel build is used

Signed-off-by: Florent AUMAITRE <redacted>
---
 package/python-pyqt5/python-pyqt5.mk | 17 +++++++++++++++++
 package/python-pyqt5/qt.conf.in      |  7 +++++++
 2 files changed, 24 insertions(+)
 create mode 100644 package/python-pyqt5/qt.conf.in
diff --git a/package/python-pyqt5/python-pyqt5.mk b/package/python-pyqt5/python-pyqt5.mk
index 8f28c90d15..e54352f7dd 100644
--- a/package/python-pyqt5/python-pyqt5.mk
+++ b/package/python-pyqt5/python-pyqt5.mk
@@ -152,6 +152,23 @@ define PYTHON_PYQT5_GENERATE_QTDETAIL
 	)
 endef
 
+# The file "qt.conf" can be used to override the hard-coded paths that are
+# compiled into the Qt library. We need it to make "qmake" relocatable and
+# tweak the per-package install pathes
+define PYTHON_PYQT5_INSTALL_QT_CONF
+	rm -f $(HOST_DIR)/bin/qt.conf
+	sed -e "s|@@HOST_DIR@@|$(HOST_DIR)|" -e "s|@@STAGING_DIR@@|$(STAGING_DIR)|" \
+		$(PYTHON_PYQT5_PKGDIR)/qt.conf.in > $(HOST_DIR)/bin/qt.conf
+endef
+
+ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
+define PYTHON_PYQT5_QT_CONF_FIXUP
+	$(PYTHON_PYQT5_INSTALL_QT_CONF)
+endef
+endif
+
+PYTHON_PYQT5_PRE_CONFIGURE_HOOKS += PYTHON_PYQT5_QT_CONF_FIXUP
+
 PYTHON_PYQT5_CONF_OPTS = \
 	--bindir $(TARGET_DIR)/usr/bin \
 	--destdir $(TARGET_DIR)/usr/lib/$(PYTHON_PYQT5_PYTHON_DIR)/site-packages \
diff --git a/package/python-pyqt5/qt.conf.in b/package/python-pyqt5/qt.conf.in
new file mode 100644
index 0000000000..2215cbd4e1
--- /dev/null
+++ b/package/python-pyqt5/qt.conf.in
@@ -0,0 +1,7 @@
+[Paths]
+Prefix=/usr
+HostPrefix=@@HOST_DIR@@
+Sysroot=@@STAGING_DIR@@
+Headers=/usr/include/qt5
+Plugins=/usr/lib/qt/plugins
+Examples=/usr/lib/qt/examples
-- 
2.17.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help