All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install
@ 2019-03-14  9:40 Andreas Naumann
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 01/13] qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen Andreas Naumann
                   ` (13 more replies)
  0 siblings, 14 replies; 23+ messages in thread
From: Andreas Naumann @ 2019-03-14  9:40 UTC (permalink / raw)
  To: buildroot

Hi all,

(please disregard v1 of this, which just went out by accident to some of you
directly, but not the mailing list).

here's v2 with your suggestions, especially a generic target install step, taken
in. I ran out of time converting to a qmake infra, but let's first see if the
direction of this is acceptable.

I have separated the general qmake patches from the ppsh-specifics. However, I
included the rebased ppsh-v7 patches and my patches on top of that because it
was my original intend to improve on that. Please let me know if that's ok or
how to go on with it.

Details about the generic install are in the commit message (patch 1+2).

I have spent quite some time testing this:
- I have tested with Qt5.12.1 only. Qt5.6 should but might not always do the right
  thing. However I think it was decided to remove support for 5.6 anyway.?
- I have checked for a few modules that the correct files were installed with/without
  exmaples being selected as well as static vs. dynamic library setting.
- For some modules with options I ran a few different configurations and checked for
  the respective file being installed/absent. However, qt5base has so many options, I
  could not test them all. But overall it went surprisingly well, e.g. I didnt
  notice files being installed that should not be there.

Finally I compared the target folders before/after the patch set, with everything
Qt5 being turned on. That showed some additional files and folders being installed
through the generic method:
- /usr/bin/xmlpatterns
- /usr/bin/xmlpatternsvalidator
- all plain libQt5*.so links
- /usr/lib/libQt5VirtualKeyboard.so.5.12.1 and links
- /usr/lib/qt/plugins/lipi_toolkit/*
- /usr/lib/qt/plugins/virtualkeyboard/*
- /usr/lib/libQt5WaylandCompositor.so.5.12.1 and links
- /usr/libexec/QtWebPluginProcess
- /usr/libexec/QtWebProcess
- /usr/qml/Qt/labs/location/*
- /usr/qml/QtWayland/*

After all, I think those files should probably be there, rather than not.
I still have not yet done any runtime tests.

Another word about the removal of the *.la *.prl fixup. When developing the
generic install, I found that the fixup command touches ALL (not only the qt-
relevant) files. This apparently does no harm, but we have a separate libtool fixup
step anyway. So I checked what it does and found.. no diff. Thats for both,
HOST_DIR being default and custom out of the buildroot dir. Are there other
situations where the qt specific fixup is needed? If so, would it be sensible
to limit it to prl files because la files are already taken care of in the generic
infra?


v1 -> v2:
  - added generic qmake target install
  - added removal of la/prl fixup (optional)
  - rebased and reordered (together with ppsh-v7) on master
  - split patches to separate qmake rework from ppsh specifics
  - added handling of pkg-config search pathes for ppsh


best regards,
Andreas


Andreas Naumann (7):
  qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen
  qt5: Convert to generic target install command
  qt5base: Fix inconsistencies when overriding qmake properties
  qt5: Remove *.la/*.prl fixup script
  qt5: Use qmake via QT5_QMAKE variable
  qt5: Prepare qmake for per-package infrastructure
  qt5: Fix pkgconfig search path for per-package infrastructure

Thomas Petazzoni (6):
  core: implement per-package SDK and target
  Makefile: allow top-level parallel build with
    BR2_PER_PACKAGE_DIRECTORIES=y
  package/pkg-generic: make libtool .la files compatible with
    per-package directories
  package/pkg-kconfig: handle KCONFIG_DEPENDENCIES with per-package
    directories
  docs/manual: add details about top-level parallel build support
  docs/manual: document the effect of per-package directory on variables

 Config.in                                     | 18 +++++
 Makefile                                      | 48 +++++++------
 docs/manual/adding-packages-generic.txt       |  9 ++-
 docs/manual/common-usage.txt                  | 44 ++++++++++++
 docs/manual/faq-troubleshooting.txt           |  3 +
 docs/manual/quickstart.txt                    |  8 +--
 package/pkg-generic.mk                        | 24 ++++++-
 package/pkg-kconfig.mk                        |  1 +
 package/pkg-utils.mk                          | 26 +++++++
 package/python-sip/python-sip.mk              |  3 +-
 package/qextserialport/qextserialport.mk      |  6 +-
 package/qt5/qt5.mk                            | 30 +++++----
 package/qt5/qt53d/qt53d.mk                    | 24 +------
 package/qt5/qt5base/qt.conf.in                | 17 +----
 package/qt5/qt5base/qt5base.mk                | 67 +++----------------
 package/qt5/qt5canvas3d/qt5canvas3d.mk        | 13 +---
 package/qt5/qt5charts/qt5charts.mk            | 27 +-------
 .../qt5/qt5connectivity/qt5connectivity.mk    | 47 +------------
 package/qt5/qt5declarative/qt5declarative.mk  | 35 +---------
 package/qt5/qt5enginio/qt5enginio.mk          | 26 +------
 .../qt5graphicaleffects.mk                    |  5 +-
 .../qt5/qt5imageformats/qt5imageformats.mk    |  7 +-
 package/qt5/qt5location/qt5location.mk        | 37 +---------
 package/qt5/qt5multimedia/qt5multimedia.mk    | 34 +---------
 .../qt5/qt5quickcontrols/qt5quickcontrols.mk  | 28 +-------
 .../qt5quickcontrols2/qt5quickcontrols2.mk    | 27 +-------
 package/qt5/qt5script/qt5script.mk            | 19 +-----
 package/qt5/qt5scxml/qt5scxml.mk              | 24 +------
 package/qt5/qt5sensors/qt5sensors.mk          | 27 +-------
 package/qt5/qt5serialbus/qt5serialbus.mk      | 25 +------
 package/qt5/qt5serialport/qt5serialport.mk    | 19 +-----
 package/qt5/qt5svg/qt5svg.mk                  | 27 +-------
 package/qt5/qt5tools/qt5tools.mk              |  3 +-
 .../qt5virtualkeyboard/qt5virtualkeyboard.mk  | 37 +---------
 package/qt5/qt5wayland/qt5wayland.mk          | 28 +-------
 package/qt5/qt5webchannel/qt5webchannel.mk    | 26 +------
 package/qt5/qt5webengine/qt5webengine.mk      | 28 +-------
 .../qt5webkit-examples/qt5webkit-examples.mk  | 10 +--
 package/qt5/qt5webkit/qt5webkit.mk            | 13 +---
 package/qt5/qt5websockets/qt5websockets.mk    | 27 +-------
 package/qt5/qt5x11extras/qt5x11extras.mk      |  8 +--
 package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk  | 19 +-----
 package/qt5cinex/qt5cinex.mk                  |  3 +-
 package/qwt/qwt.mk                            |  1 +
 support/scripts/check-host-rpath              | 27 ++++++--
 support/scripts/fix-rpath                     | 29 ++++++--
 46 files changed, 312 insertions(+), 702 deletions(-)

-- 
2.21.0

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 01/13] qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen
  2019-03-14  9:40 [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Andreas Naumann
@ 2019-03-14  9:40 ` Andreas Naumann
  2019-03-14 10:07   ` Thomas Petazzoni
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 02/13] qt5: Convert to generic target install command Andreas Naumann
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 23+ messages in thread
From: Andreas Naumann @ 2019-03-14  9:40 UTC (permalink / raw)
  To: buildroot

Traditionlly we configured qt5 to always build shared libraries. This resulted
in many conditionals when setting buildroot to static-libs only, because each
module's target install had to be guarded.
So to avoid this and simplify target install in a subsequent commit, configure
qt to build (and install) only the type of libs which the buildroot defconfig
is set to.
Unfortunately it seems that Qt does not support building both dynamic and static
libs at the same time, so we still set it shared if buildroot asks for both.

Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
 package/qt5/qt5base/qt5base.mk | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index e7f6e658f1..a0492418be 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -24,8 +24,15 @@ QT5BASE_CONFIGURE_OPTS += \
 	-no-iconv \
 	-system-zlib \
 	-system-pcre \
-	-no-pch \
-	-shared
+	-no-pch
+
+ifeq ($(BR2_SHARED_LIBS),y)
+QT5BASE_CONFIGURE_OPTS += -shared -no-static
+else ifeq ($(BR2_STATIC_LIBS),y)
+QT5BASE_CONFIGURE_OPTS += -no-shared -static
+else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
+QT5BASE_CONFIGURE_OPTS += -shared
+endif
 
 ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
 QT5BASE_DEPENDENCIES += pcre
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 02/13] qt5: Convert to generic target install command
  2019-03-14  9:40 [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Andreas Naumann
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 01/13] qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen Andreas Naumann
@ 2019-03-14  9:40 ` Andreas Naumann
  2019-03-14 10:13   ` Thomas Petazzoni
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 03/13] qt5base: Fix inconsistencies when overriding qmake properties Andreas Naumann
                   ` (11 subsequent siblings)
  13 siblings, 1 reply; 23+ messages in thread
From: Andreas Naumann @ 2019-03-14  9:40 UTC (permalink / raw)
  To: buildroot

This converts the numerous and complex target install steps of almost all Qt5
related packages to a single rsync call with a pre-filtered list of files from
the packages staging to the target path.
The list is created from files in which were created, or have changed, in staging
after the .stamp_built was made. In order to avoid useless files in target, all
*.prl, *.la files and the folders /usr/include and /usr/lib/cmake and /usr/doc
are ignored.

Of course this only works for packages which do install into staging at all.
Custom install steps also have to remain in cases where a certain buildroot
option has no corresponding setting in the packages configuration options.

Getting rid of the explicit conditionals is possible because the Qt configure
system already defines the correct install steps for the most common
conditionals like examples-yes/no, static/dynamic-libs, quick-support and so on.

Following is a list where the replacement was not straightforward or could not be
tested.

qt5base:
Kept only the font install step of Qt 5.6. Not tested.

qt5webengine:
Should be straightforward but is currently broken with
  ninja: build stopped: subcommand failed.
  Makefile.gn_run:326: recipe for target 'run_ninja' failed

qt5webkit:
The generic install creates QtWebProcess in /usr/libexec/ instead of /usr/bin.
The jsc binary was not be copied at all. I dont know if it's need, so for safety
keeping the respective custom install command.

qt5webkit-examples:
Should be straightforward but build is currently broken with
make[5]: *** No rule to make target 'QtWebKit/QWebView', needed by '.uic/ui_formextractor.h'.  Stop.
(OE even removed it because apparently nobody cares).

qt5webchannel:
A custom install of javascript has to remain

qt5cinex:
Custom logic because no staging install

qt5tools:
custom logic

Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
 package/qextserialport/qextserialport.mk      |  6 +-
 package/qt5/qt5.mk                            |  8 +++
 package/qt5/qt53d/qt53d.mk                    | 20 +------
 package/qt5/qt5base/qt5base.mk                | 55 +------------------
 package/qt5/qt5canvas3d/qt5canvas3d.mk        |  9 +--
 package/qt5/qt5charts/qt5charts.mk            | 23 +-------
 .../qt5/qt5connectivity/qt5connectivity.mk    | 43 +--------------
 package/qt5/qt5declarative/qt5declarative.mk  | 31 +----------
 package/qt5/qt5enginio/qt5enginio.mk          | 22 +-------
 .../qt5graphicaleffects.mk                    |  2 +-
 .../qt5/qt5imageformats/qt5imageformats.mk    |  4 +-
 package/qt5/qt5location/qt5location.mk        | 33 +----------
 package/qt5/qt5multimedia/qt5multimedia.mk    | 30 +---------
 .../qt5/qt5quickcontrols/qt5quickcontrols.mk  | 25 +--------
 .../qt5quickcontrols2/qt5quickcontrols2.mk    | 24 +-------
 package/qt5/qt5script/qt5script.mk            | 15 +----
 package/qt5/qt5scxml/qt5scxml.mk              | 20 +------
 package/qt5/qt5sensors/qt5sensors.mk          | 23 +-------
 package/qt5/qt5serialbus/qt5serialbus.mk      | 21 +------
 package/qt5/qt5serialport/qt5serialport.mk    | 15 +----
 package/qt5/qt5svg/qt5svg.mk                  | 23 +-------
 .../qt5virtualkeyboard/qt5virtualkeyboard.mk  | 34 +-----------
 package/qt5/qt5wayland/qt5wayland.mk          | 24 +-------
 package/qt5/qt5webchannel/qt5webchannel.mk    | 22 +-------
 package/qt5/qt5webengine/qt5webengine.mk      | 24 +-------
 .../qt5webkit-examples/qt5webkit-examples.mk  |  7 +--
 package/qt5/qt5webkit/qt5webkit.mk            |  9 +--
 package/qt5/qt5websockets/qt5websockets.mk    | 23 +-------
 package/qt5/qt5x11extras/qt5x11extras.mk      |  4 +-
 package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk  | 15 +----
 30 files changed, 37 insertions(+), 577 deletions(-)

diff --git a/package/qextserialport/qextserialport.mk b/package/qextserialport/qextserialport.mk
index ecaff21efc..8c838e2835 100644
--- a/package/qextserialport/qextserialport.mk
+++ b/package/qextserialport/qextserialport.mk
@@ -28,12 +28,8 @@ define QEXTSERIALPORT_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
 endef
 
-ifeq ($(BR2_STATIC_LIBS),y)
-QEXTSERIALPORT_INSTALL_TARGET = NO
-else
 define QEXTSERIALPORT_INSTALL_TARGET_CMDS
-	cp -a $(@D)/*.so.* $(TARGET_DIR)/usr/lib
+	$(QT5_INSTALL_TARGET)
 endef
-endif
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5.mk b/package/qt5/qt5.mk
index d8012a913d..5acbbf2ef3 100644
--- a/package/qt5/qt5.mk
+++ b/package/qt5/qt5.mk
@@ -32,5 +32,13 @@ define QT5_LA_PRL_FILES_FIXUP
 	done
 endef
 
+define QT5_INSTALL_TARGET
+	cd $(STAGING_DIR)/usr; find . -cnewer $(@D)/.stamp_built \
+		! -name *.la ! -name *.prl \
+		! -path "./include/*" ! -path "./lib/cmake/*" ! -path "./doc*" \
+		-type f,l \
+		| rsync -arv --files-from=- $(STAGING_DIR)/usr $(TARGET_DIR)/usr
+endef
+
 # Variable for other Qt applications to use
 QT5_QMAKE = $(HOST_DIR)/bin/qmake -spec devices/linux-buildroot-g++
diff --git a/package/qt5/qt53d/qt53d.mk b/package/qt5/qt53d/qt53d.mk
index 48a931d60b..eb8da66d11 100644
--- a/package/qt5/qt53d/qt53d.mk
+++ b/package/qt5/qt53d/qt53d.mk
@@ -30,27 +30,9 @@ define QT53D_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT53D_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/qt3d $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
 ifeq ($(BR2_STATIC_LIBS),)
-ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
-# Available since 5.9
-define QT53D_INSTALL_TARGET_LATEST
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/geometryloaders $(TARGET_DIR)/usr/lib/qt/plugins
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/renderplugins $(TARGET_DIR)/usr/lib/qt/plugins
-endef
-endif
 define QT53D_INSTALL_TARGET_CMDS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt53D*.so.* $(TARGET_DIR)/usr/lib
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/sceneparsers $(TARGET_DIR)/usr/lib/qt/plugins
-	cp -dpfr $(STAGING_DIR)/usr/qml/Qt3D $(TARGET_DIR)/usr/qml
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtQuick $(TARGET_DIR)/usr/qml
-	$(QT53D_INSTALL_TARGET_LATEST)
-	$(QT53D_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 endif
 
diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index a0492418be..74f6c8d7d3 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -254,30 +254,6 @@ QT5BASE_CONFIGURE_OPTS += -no-gtk
 endif
 endif
 
-# Build the list of libraries to be installed on the target
-QT5BASE_INSTALL_LIBS_y                                 += Qt5Core
-QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_XCB)        += Qt5XcbQpa
-QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_NETWORK)    += Qt5Network
-QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_CONCURRENT) += Qt5Concurrent
-QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_SQL)        += Qt5Sql
-QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_TEST)       += Qt5Test
-QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_XML)        += Qt5Xml
-QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_OPENGL_LIB) += Qt5OpenGL
-ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
-QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS)      += Qt5EglFSDeviceIntegration
-ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
-QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS)      += Qt5EglFsKmsSupport
-endif
-else
-QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS)      += Qt5EglDeviceIntegration
-endif
-
-QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_GUI)          += Qt5Gui
-QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_WIDGETS)      += Qt5Widgets
-QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_PRINTSUPPORT) += Qt5PrintSupport
-
-QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_DBUS) += Qt5DBus
-
 ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
 ifeq ($(BR2_PACKAGE_IMX_GPU_VIV),y)
 # use vivante backend
@@ -361,19 +337,6 @@ define QT5BASE_INSTALL_STAGING_CMDS
 	$(QT5BASE_INSTALL_QT_CONF)
 endef
 
-define QT5BASE_INSTALL_TARGET_LIBS
-	for lib in $(QT5BASE_INSTALL_LIBS_y); do \
-		cp -dpf $(STAGING_DIR)/usr/lib/lib$${lib}.so.* $(TARGET_DIR)/usr/lib || exit 1 ; \
-	done
-endef
-
-define QT5BASE_INSTALL_TARGET_PLUGINS
-	if [ -d $(STAGING_DIR)/usr/lib/qt/plugins/ ] ; then \
-		mkdir -p $(TARGET_DIR)/usr/lib/qt/plugins ; \
-		cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/* $(TARGET_DIR)/usr/lib/qt/plugins ; \
-	fi
-endef
-
 ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
 define QT5BASE_INSTALL_TARGET_FONTS
 	if [ -d $(STAGING_DIR)/usr/lib/fonts/ ] ; then \
@@ -383,25 +346,9 @@ define QT5BASE_INSTALL_TARGET_FONTS
 endef
 endif
 
-define QT5BASE_INSTALL_TARGET_EXAMPLES
-	if [ -d $(STAGING_DIR)/usr/lib/qt/examples/ ] ; then \
-		mkdir -p $(TARGET_DIR)/usr/lib/qt/examples ; \
-		cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/* $(TARGET_DIR)/usr/lib/qt/examples ; \
-	fi
-endef
-
-ifeq ($(BR2_STATIC_LIBS),y)
 define QT5BASE_INSTALL_TARGET_CMDS
+	$(QT5_INSTALL_TARGET)
 	$(QT5BASE_INSTALL_TARGET_FONTS)
-	$(QT5BASE_INSTALL_TARGET_EXAMPLES)
 endef
-else
-define QT5BASE_INSTALL_TARGET_CMDS
-	$(QT5BASE_INSTALL_TARGET_LIBS)
-	$(QT5BASE_INSTALL_TARGET_PLUGINS)
-	$(QT5BASE_INSTALL_TARGET_FONTS)
-	$(QT5BASE_INSTALL_TARGET_EXAMPLES)
-endef
-endif
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5canvas3d/qt5canvas3d.mk b/package/qt5/qt5canvas3d/qt5canvas3d.mk
index ef5b373d02..006d3d964e 100644
--- a/package/qt5/qt5canvas3d/qt5canvas3d.mk
+++ b/package/qt5/qt5canvas3d/qt5canvas3d.mk
@@ -31,15 +31,8 @@ define QT5CANVAS3D_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5CANVAS3D_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/canvas3d $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
 define QT5CANVAS3D_INSTALL_TARGET_CMDS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtCanvas3D $(TARGET_DIR)/usr/qml/
-	$(QT5CANVAS3D_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5charts/qt5charts.mk b/package/qt5/qt5charts/qt5charts.mk
index 9e2e6de881..d11a301a86 100644
--- a/package/qt5/qt5charts/qt5charts.mk
+++ b/package/qt5/qt5charts/qt5charts.mk
@@ -37,30 +37,9 @@ define QT5CHARTS_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_STATIC_LIBS),)
-define QT5CHARTS_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Charts*.so.* $(TARGET_DIR)/usr/lib
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/* $(TARGET_DIR)/usr/lib/qt/plugins
-endef
-endif
-
-# this is only built with quick support enabled
-ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
-define QT5CHARTS_INSTALL_TARGET_QMLS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtCharts $(TARGET_DIR)/usr/qml/
-endef
-endif
-
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5CHARTS_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/charts* $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
 
 define QT5CHARTS_INSTALL_TARGET_CMDS
-	$(QT5CHARTS_INSTALL_TARGET_LIBS)
-	$(QT5CHARTS_INSTALL_TARGET_QMLS)
-	$(QT5CHARTS_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5connectivity/qt5connectivity.mk b/package/qt5/qt5connectivity/qt5connectivity.mk
index 6de1536b78..e96014b64b 100644
--- a/package/qt5/qt5connectivity/qt5connectivity.mk
+++ b/package/qt5/qt5connectivity/qt5connectivity.mk
@@ -39,49 +39,8 @@ define QT5CONNECTIVITY_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
-ifneq ($(BR2_PACKAGE_BLUEZ_UTILS)$(BR2_PACKAGE_BLUEZ5_UTILS),)
-define QT5CONNECTIVITY_INSTALL_TARGET_BLUETOOTH_QMLS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtBluetooth $(TARGET_DIR)/usr/qml/
-endef
-endif
-ifeq ($(BR2_PACKAGE_NEARD),y)
-define QT5CONNECTIVITY_INSTALL_TARGET_NFC_QMLS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtNfc $(TARGET_DIR)/usr/qml/
-endef
-endif
-endif
-
-ifneq ($(BR2_PACKAGE_BLUEZ_UTILS)$(BR2_PACKAGE_BLUEZ5_UTILS),)
-define QT5CONNECTIVITY_INSTALL_TARGET_BLUETOOTH
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Bluetooth.so.* $(TARGET_DIR)/usr/lib
-	cp -dpf $(STAGING_DIR)/usr/bin/sdpscanner $(TARGET_DIR)/usr/bin
-endef
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5CONNECTIVITY_INSTALL_TARGET_BLUETOOTH_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/bluetooth $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-endif
-
-ifeq ($(BR2_PACKAGE_NEARD),y)
-define QT5CONNECTIVITY_INSTALL_TARGET_NFC
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Nfc.so.* $(TARGET_DIR)/usr/lib
-endef
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5CONNECTIVITY_INSTALL_TARGET_NFC_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/nfc $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-endif
-
 define QT5CONNECTIVITY_INSTALL_TARGET_CMDS
-	$(QT5CONNECTIVITY_INSTALL_TARGET_BLUETOOTH)
-	$(QT5CONNECTIVITY_INSTALL_TARGET_NFC)
-	$(QT5CONNECTIVITY_INSTALL_TARGET_BLUETOOTH_QMLS)
-	$(QT5CONNECTIVITY_INSTALL_TARGET_NFC_QMLS)
-	$(QT5CONNECTIVITY_INSTALL_TARGET_BLUETOOTH_EXAMPLES)
-	$(QT5CONNECTIVITY_INSTALL_TARGET_NFC_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5declarative/qt5declarative.mk b/package/qt5/qt5declarative/qt5declarative.mk
index 2fe72b3be6..ef18553d0b 100644
--- a/package/qt5/qt5declarative/qt5declarative.mk
+++ b/package/qt5/qt5declarative/qt5declarative.mk
@@ -31,37 +31,8 @@ define QT5DECLARATIVE_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_STATIC_LIBS),)
-
-ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
-define QT5DECLARATIVE_INSTALL_TARGET_QUICK_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Quick*.so.* $(TARGET_DIR)/usr/lib
-endef
-define QT5DECLARATIVE_INSTALL_TARGET_QUICK_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/quick/ $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
-define QT5DECLARATIVE_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Qml*.so.* $(TARGET_DIR)/usr/lib
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/qml* $(TARGET_DIR)/usr/lib/qt/plugins
-	$(QT5DECLARATIVE_INSTALL_TARGET_QUICK_LIBS)
-endef
-
-endif
-
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5DECLARATIVE_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/qml* $(TARGET_DIR)/usr/lib/qt/examples/
-	$(QT5DECLARATIVE_INSTALL_TARGET_QUICK_EXAMPLES)
-endef
-endif
-
 define QT5DECLARATIVE_INSTALL_TARGET_CMDS
-	cp -dpf $(STAGING_DIR)/usr/bin/qml* $(TARGET_DIR)/usr/bin
-	cp -dpfr $(STAGING_DIR)/usr/qml $(TARGET_DIR)/usr
-	$(QT5DECLARATIVE_INSTALL_TARGET_EXAMPLES)
-	$(QT5DECLARATIVE_INSTALL_TARGET_LIBS)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5enginio/qt5enginio.mk b/package/qt5/qt5enginio/qt5enginio.mk
index 38f309646f..b39d2eb097 100644
--- a/package/qt5/qt5enginio/qt5enginio.mk
+++ b/package/qt5/qt5enginio/qt5enginio.mk
@@ -35,28 +35,8 @@ define QT5ENGINIO_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
-define QT5ENGINIO_INSTALL_TARGET_QMLS
-	cp -dpfr $(STAGING_DIR)/usr/qml/Enginio $(TARGET_DIR)/usr/qml/
-endef
-endif
-
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5ENGINIO_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/enginio $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
-ifneq ($(BR2_STATIC_LIBS),y)
-define QT5ENGINIO_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libEnginio.so.* $(TARGET_DIR)/usr/lib
-endef
-endif
-
 define QT5ENGINIO_INSTALL_TARGET_CMDS
-	$(QT5ENGINIO_INSTALL_TARGET_LIBS)
-	$(QT5ENGINIO_INSTALL_TARGET_QMLS)
-	$(QT5ENGINIO_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk b/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk
index c5011a94f0..f399787d8f 100644
--- a/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk
+++ b/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk
@@ -31,7 +31,7 @@ define QT5GRAPHICALEFFECTS_INSTALL_STAGING_CMDS
 endef
 
 define QT5GRAPHICALEFFECTS_INSTALL_TARGET_CMDS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtGraphicalEffects $(TARGET_DIR)/usr/qml
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5imageformats/qt5imageformats.mk b/package/qt5/qt5imageformats/qt5imageformats.mk
index fa13ebedaf..a7db819268 100644
--- a/package/qt5/qt5imageformats/qt5imageformats.mk
+++ b/package/qt5/qt5imageformats/qt5imageformats.mk
@@ -30,10 +30,8 @@ define QT5IMAGEFORMATS_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
 endef
 
-ifeq ($(BR2_STATIC_LIBS),)
 define QT5IMAGEFORMATS_INSTALL_TARGET_CMDS
-	cp -dpf $(STAGING_DIR)/usr/lib/qt/plugins/imageformats/*.so $(TARGET_DIR)/usr/lib/qt/plugins/imageformats/
+	$(QT5_INSTALL_TARGET)
 endef
-endif
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5location/qt5location.mk b/package/qt5/qt5location/qt5location.mk
index da0aad7961..d4b4ffe41b 100644
--- a/package/qt5/qt5location/qt5location.mk
+++ b/package/qt5/qt5location/qt5location.mk
@@ -35,39 +35,8 @@ define QT5LOCATION_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
-define QT5LOCATION_INSTALL_TARGET_QMLS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtPositioning $(TARGET_DIR)/usr/qml/
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtLocation $(TARGET_DIR)/usr/qml/
-endef
-define QT5LOCATION_INSTALL_TARGET_LOCATION
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Location.so.* $(TARGET_DIR)/usr/lib
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/geoservices $(TARGET_DIR)/usr/lib/qt/plugins/
-endef
-ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
-define QT5LOCATION_INSTALL_TARGET_POSITION_QUICK
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5PositioningQuick.so.* $(TARGET_DIR)/usr/lib
-endef
-endif
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5LOCATION_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/location $(TARGET_DIR)/usr/lib/qt/examples/
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/positioning $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-endif
-
-define QT5LOCATION_INSTALL_TARGET_POSITION
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Positioning.so.* $(TARGET_DIR)/usr/lib
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/position $(TARGET_DIR)/usr/lib/qt/plugins/
-endef
-
 define QT5LOCATION_INSTALL_TARGET_CMDS
-	$(QT5LOCATION_INSTALL_TARGET_POSITION)
-	$(QT5LOCATION_INSTALL_TARGET_POSITION_QUICK)
-	$(QT5LOCATION_INSTALL_TARGET_LOCATION)
-	$(QT5LOCATION_INSTALL_TARGET_QMLS)
-	$(QT5LOCATION_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5multimedia/qt5multimedia.mk b/package/qt5/qt5multimedia/qt5multimedia.mk
index d044b7b96c..9f7342adfb 100644
--- a/package/qt5/qt5multimedia/qt5multimedia.mk
+++ b/package/qt5/qt5multimedia/qt5multimedia.mk
@@ -47,41 +47,13 @@ define QT5MULTIMEDIA_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_STATIC_LIBS),)
-# since Qt5.10.1 libqgsttools was renamed to libQtMultimediaGstTools
-# and is installed by the default target install step below
-ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST)x$(BR2_PACKAGE_GST1_PLUGINS_BASE),xy)
-define QT5MULTIMEDIA_INSTALL_TARGET_QGSTTOOLS_LIB
-	cp -dpf $(STAGING_DIR)/usr/lib/libqgsttools*.so.* $(TARGET_DIR)/usr/lib
-endef
-endif
-
-define QT5MULTIMEDIA_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Multimedia*.so.* $(TARGET_DIR)/usr/lib
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/* $(TARGET_DIR)/usr/lib/qt/plugins
-	$(QT5MULTIMEDIA_INSTALL_TARGET_QGSTTOOLS_LIB)
-endef
-endif # !BR2_STATIC_LIBS
-
-# this is only built with quick/opengl support enabled
-ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK)$(BR2_PACKAGE_QT5_GL_AVAILABLE),yy)
-define QT5MULTIMEDIA_INSTALL_TARGET_QMLS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtMultimedia $(TARGET_DIR)/usr/qml/
-endef
-endif
-
 ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
 QT5MULTIMEDIA_LICENSE := $(QT5MULTIMEDIA_LICENSE), LGPL-2.1+ (examples/multimedia/spectrum/3rdparty/fftreal)
 QT5MULTIMEDIA_LICENSE_FILES += examples/multimedia/spectrum/3rdparty/fftreal/license.txt
-define QT5MULTIMEDIA_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/multimedia* $(TARGET_DIR)/usr/lib/qt/examples/
-endef
 endif
 
 define QT5MULTIMEDIA_INSTALL_TARGET_CMDS
-	$(QT5MULTIMEDIA_INSTALL_TARGET_LIBS)
-	$(QT5MULTIMEDIA_INSTALL_TARGET_QMLS)
-	$(QT5MULTIMEDIA_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5quickcontrols/qt5quickcontrols.mk b/package/qt5/qt5quickcontrols/qt5quickcontrols.mk
index 3e0c5effb3..faa109bc6f 100644
--- a/package/qt5/qt5quickcontrols/qt5quickcontrols.mk
+++ b/package/qt5/qt5quickcontrols/qt5quickcontrols.mk
@@ -30,31 +30,8 @@ define QT5QUICKCONTROLS_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
 endef
 
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5QUICKCONTROLS_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/quickcontrols $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
-ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK)$(BR2_PACKAGE_QT5BASE_WIDGETS),yy)
-define QT5QUICKCONTROLS_INSTALL_TARGET_PRIVATEWIDGETS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtQuick/PrivateWidgets $(TARGET_DIR)/usr/qml/QtQuick
-endef
-endif
-
-ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
-define QT5QUICKCONTROLS_INSTALL_TARGET_LAYOUTS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtQuick/Layouts $(TARGET_DIR)/usr/qml/QtQuick
-endef
-endif
-
 define QT5QUICKCONTROLS_INSTALL_TARGET_CMDS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtQuick/Controls $(TARGET_DIR)/usr/qml/QtQuick
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtQuick/Dialogs $(TARGET_DIR)/usr/qml/QtQuick
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtQuick/Extras $(TARGET_DIR)/usr/qml/QtQuick
-	$(QT5QUICKCONTROLS_INSTALL_TARGET_PRIVATEWIDGETS)
-	$(QT5QUICKCONTROLS_INSTALL_TARGET_LAYOUTS)
-	$(QT5QUICKCONTROLS_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk b/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk
index c2004c2ee7..950153ae4b 100644
--- a/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk
+++ b/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk
@@ -25,30 +25,8 @@ define QT5QUICKCONTROLS2_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
 endef
 
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5QUICKCONTROLS2_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/quickcontrols2 $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
-ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
-define QT5QUICKCONTROLS2_INSTALL_TARGET_CMDS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5QuickTemplates2.so.* $(TARGET_DIR)/usr/lib
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5QuickControls2.so.* $(TARGET_DIR)/usr/lib
-	cp -dpfr $(STAGING_DIR)/usr/qml/Qt/labs/calendar $(TARGET_DIR)/usr/qml/Qt/labs
-	cp -dpfr $(STAGING_DIR)/usr/qml/Qt/labs/platform $(TARGET_DIR)/usr/qml/Qt/labs
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtQuick/Controls.2 $(TARGET_DIR)/usr/qml/QtQuick
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtQuick/Templates.2 $(TARGET_DIR)/usr/qml/QtQuick
-	$(QT5QUICKCONTROLS2_INSTALL_TARGET_EXAMPLES)
-endef
-else
 define QT5QUICKCONTROLS2_INSTALL_TARGET_CMDS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5LabsTemplates.so.* $(TARGET_DIR)/usr/lib
-	cp -dpfr $(STAGING_DIR)/usr/qml/Qt/labs/controls $(TARGET_DIR)/usr/qml/Qt/labs
-	cp -dpfr $(STAGING_DIR)/usr/qml/Qt/labs/calendar $(TARGET_DIR)/usr/qml/Qt/labs
-	cp -dpfr $(STAGING_DIR)/usr/qml/Qt/labs/templates $(TARGET_DIR)/usr/qml/Qt/labs
-	$(QT5QUICKCONTROLS2_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
-endif
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5script/qt5script.mk b/package/qt5/qt5script/qt5script.mk
index 4a292c95a5..9f70a87d41 100644
--- a/package/qt5/qt5script/qt5script.mk
+++ b/package/qt5/qt5script/qt5script.mk
@@ -40,21 +40,8 @@ define QT5SCRIPT_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_STATIC_LIBS),)
-define QT5SCRIPT_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Script*.so.* $(TARGET_DIR)/usr/lib
-endef
-endif
-
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5SCRIPT_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/script $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
 define QT5SCRIPT_INSTALL_TARGET_CMDS
-	$(QT5SCRIPT_INSTALL_TARGET_LIBS)
-	$(QT5SCRIPT_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5scxml/qt5scxml.mk b/package/qt5/qt5scxml/qt5scxml.mk
index de9ece597c..ce3cd650a7 100644
--- a/package/qt5/qt5scxml/qt5scxml.mk
+++ b/package/qt5/qt5scxml/qt5scxml.mk
@@ -29,26 +29,8 @@ define QT5SCXML_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_STATIC_LIBS),)
-define QT5SCXML_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Scxml*.so.* $(TARGET_DIR)/usr/lib
-endef
-endif
-
-define QT5SCXML_INSTALL_TARGET_QMLS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtScxml/ $(TARGET_DIR)/usr/qml/
-endef
-
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5SCXML_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/scxml $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
 define QT5SCXML_INSTALL_TARGET_CMDS
-	$(QT5SCXML_INSTALL_TARGET_LIBS)
-	$(QT5SCXML_INSTALL_TARGET_QMLS)
-	$(QT5SCXML_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5sensors/qt5sensors.mk b/package/qt5/qt5sensors/qt5sensors.mk
index 2d5cf327a6..2cd6e0d5fb 100644
--- a/package/qt5/qt5sensors/qt5sensors.mk
+++ b/package/qt5/qt5sensors/qt5sensors.mk
@@ -35,29 +35,8 @@ define QT5SENSORS_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_STATIC_LIBS),)
-define QT5SENSORS_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Sensors.so.* $(TARGET_DIR)/usr/lib
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/sensor* $(TARGET_DIR)/usr/lib/qt/plugins
-endef
-endif
-
-ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
-define QT5SENSORS_INSTALL_TARGET_QMLS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtSensors $(TARGET_DIR)/usr/qml
-endef
-endif
-
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5SENSORS_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/sensors $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
 define QT5SENSORS_INSTALL_TARGET_CMDS
-	$(QT5SENSORS_INSTALL_TARGET_LIBS)
-	$(QT5SENSORS_INSTALL_TARGET_QMLS)
-	$(QT5SENSORS_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5serialbus/qt5serialbus.mk b/package/qt5/qt5serialbus/qt5serialbus.mk
index 98c4466cb8..2841172fb7 100644
--- a/package/qt5/qt5serialbus/qt5serialbus.mk
+++ b/package/qt5/qt5serialbus/qt5serialbus.mk
@@ -26,27 +26,8 @@ define QT5SERIALBUS_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_STATIC_LIBS),)
-define QT5SERIALBUS_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5SerialBus.so.* \
-		$(TARGET_DIR)/usr/lib
-	mkdir -p $(TARGET_DIR)/usr/lib/qt/plugins/canbus
-	cp -dpf $(STAGING_DIR)/usr/lib/qt/plugins/canbus/*.so \
-		$(TARGET_DIR)/usr/lib/qt/plugins/canbus
-endef
-endif
-
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES)$(BR2_PACKAGE_QT5BASE_WIDGETS),yy)
-define QT5SERIALBUS_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/serialbus $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
 define QT5SERIALBUS_INSTALL_TARGET_CMDS
-	$(QT5SERIALBUS_INSTALL_TARGET_LIBS)
-	$(QT5SERIALBUS_INSTALL_TARGET_EXAMPLES)
-	$(INSTALL) -m 0755 -D $(@D)/bin/canbusutil \
-		$(TARGET_DIR)/usr/bin/canbusutil
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5serialport/qt5serialport.mk b/package/qt5/qt5serialport/qt5serialport.mk
index 2b0953586b..9059443073 100644
--- a/package/qt5/qt5serialport/qt5serialport.mk
+++ b/package/qt5/qt5serialport/qt5serialport.mk
@@ -31,21 +31,8 @@ define QT5SERIALPORT_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_STATIC_LIBS),)
-define QT5SERIALPORT_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5SerialPort.so.* $(TARGET_DIR)/usr/lib
-endef
-endif
-
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5SERIALPORT_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/serialport $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
 define QT5SERIALPORT_INSTALL_TARGET_CMDS
-	$(QT5SERIALPORT_INSTALL_TARGET_LIBS)
-	$(QT5SERIALPORT_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5svg/qt5svg.mk b/package/qt5/qt5svg/qt5svg.mk
index 48ff04bd75..800a9fbdd1 100644
--- a/package/qt5/qt5svg/qt5svg.mk
+++ b/package/qt5/qt5svg/qt5svg.mk
@@ -31,29 +31,8 @@ define QT5SVG_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_PACKAGE_QT5BASE_WIDGETS),y)
-define QT5SVG_INSTALL_ICONENGINES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/iconengines $(TARGET_DIR)/usr/lib/qt/plugins
-endef
-endif
-
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5SVG_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/svg $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
-ifeq ($(BR2_STATIC_LIBS),)
-define QT5SVG_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Svg*.so.* $(TARGET_DIR)/usr/lib
-	cp -dpf $(STAGING_DIR)/usr/lib/qt/plugins/imageformats/libqsvg.so $(TARGET_DIR)/usr/lib/qt/plugins/imageformats/
-	$(QT5SVG_INSTALL_ICONENGINES)
-endef
-endif
-
 define QT5SVG_INSTALL_TARGET_CMDS
-	$(QT5SVG_INSTALL_TARGET_LIBS)
-	$(QT5SVG_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk b/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk
index 8ce3169774..8377e1d8b8 100644
--- a/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk
+++ b/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk
@@ -30,20 +30,17 @@ QT5VIRTUALKEYBOARD_LICENSE_FILES += src/virtualkeyboard/3rdparty/openwnn/NOTICE
 endif
 
 ifneq ($(filter zh_CN all,$(QT5VIRTUALKEYBOARD_LANGUAGE_LAYOUTS)),)
-QT5VIRTUALKEYBOARD_3RDPARTY_PARTS = YES
 QT5VIRTUALKEYBOARD_LICENSE := $(QT5VIRTUALKEYBOARD_LICENSE), Apache-2.0 (pinyin)
 QT5VIRTUALKEYBOARD_LICENSE_FILES += src/virtualkeyboard/3rdparty/pinyin/NOTICE
 endif
 
 ifneq ($(filter zh_TW all,$(QT5VIRTUALKEYBOARD_LANGUAGE_LAYOUTS)),)
-QT5VIRTUALKEYBOARD_3RDPARTY_PARTS = YES
 QT5VIRTUALKEYBOARD_LICENSE := $(QT5VIRTUALKEYBOARD_LICENSE), Apache-2.0 (tcime), BSD-3-Clause (tcime)
 QT5VIRTUALKEYBOARD_LICENSE_FILES += src/virtualkeyboard/3rdparty/tcime/COPYING
 endif
 endif
 
 ifeq ($(BR2_PACKAGE_QT5VIRTUALKEYBOARD_HANDWRITING),y)
-QT5VIRTUALKEYBOARD_3RDPARTY_PARTS = YES
 QT5VIRTUALKEYBOARD_QMAKEFLAGS += CONFIG+=handwriting
 QT5VIRTUALKEYBOARD_LICENSE := $(QT5VIRTUALKEYBOARD_LICENSE), MIT (lipi-toolkit)
 ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
@@ -57,12 +54,6 @@ ifeq ($(BR2_PACKAGE_QT5VIRTUALKEYBOARD_ARROW_KEY_NAVIGATION),y)
 QT5VIRTUALKEYBOARD_QMAKEFLAGS += CONFIG+=arrow-key-navigation
 endif
 
-ifdef QT5VIRTUALKEYBOARD_3RDPARTY_PARTS
-define QT5VIRTUALKEYBOARD_INSTALL_TARGET_3RDPARTY_PARTS
-	cp -dpfr $(STAGING_DIR)/usr/qtvirtualkeyboard $(TARGET_DIR)/usr
-endef
-endif
-
 define QT5VIRTUALKEYBOARD_CONFIGURE_CMDS
 	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake $(QT5VIRTUALKEYBOARD_QMAKEFLAGS))
 endef
@@ -75,31 +66,8 @@ define QT5VIRTUALKEYBOARD_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
 endef
 
-ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
-define QT5VIRTUALKEYBOARD_INSTALL_TARGET_QML
-	mkdir -p $(TARGET_DIR)/usr/qml/QtQuick/Enterprise
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtQuick/Enterprise/VirtualKeyboard $(TARGET_DIR)/usr/qml/QtQuick/Enterprise/
-endef
-else
-define QT5VIRTUALKEYBOARD_INSTALL_TARGET_QML
-	mkdir -p $(TARGET_DIR)/usr/qml/QtQuick
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtQuick/VirtualKeyboard $(TARGET_DIR)/usr/qml/QtQuick/
-endef
-endif
-
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5VIRTUALKEYBOARD_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/virtualkeyboard $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
 define QT5VIRTUALKEYBOARD_INSTALL_TARGET_CMDS
-	mkdir -p $(TARGET_DIR)/usr/lib/qt/plugins/platforminputcontexts
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so \
-		$(TARGET_DIR)/usr/lib/qt/plugins/platforminputcontexts
-	$(QT5VIRTUALKEYBOARD_INSTALL_TARGET_QML)
-	$(QT5VIRTUALKEYBOARD_INSTALL_TARGET_3RDPARTY_PARTS)
-	$(QT5VIRTUALKEYBOARD_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5wayland/qt5wayland.mk b/package/qt5/qt5wayland/qt5wayland.mk
index d6fb6e1888..c5365198ba 100644
--- a/package/qt5/qt5wayland/qt5wayland.mk
+++ b/package/qt5/qt5wayland/qt5wayland.mk
@@ -43,30 +43,8 @@ define QT5WAYLAND_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_PACKAGE_QT5WAYLAND_COMPOSITOR),y)
-ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
-define QT5WAYLAND_INSTALL_COMPOSITOR
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5WaylandCompositor.so* $(TARGET_DIR)/usr/lib
-endef
-else
-define QT5WAYLAND_INSTALL_COMPOSITOR
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Compositor.so* $(TARGET_DIR)/usr/lib
-endef
-endif
-endif
-
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5WAYLAND_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/wayland $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
 define QT5WAYLAND_INSTALL_TARGET_CMDS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5WaylandClient.so* $(TARGET_DIR)/usr/lib
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/wayland* $(TARGET_DIR)/usr/lib/qt/plugins
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/platforms/libqwayland* $(TARGET_DIR)/usr/lib/qt/plugins/platforms
-	$(QT5WAYLAND_INSTALL_COMPOSITOR)
-	$(QT5WAYLAND_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5webchannel/qt5webchannel.mk b/package/qt5/qt5webchannel/qt5webchannel.mk
index f1c08532c0..8e62e9c6f0 100644
--- a/package/qt5/qt5webchannel/qt5webchannel.mk
+++ b/package/qt5/qt5webchannel/qt5webchannel.mk
@@ -50,29 +50,9 @@ define QT5WEBCHANNEL_INSTALL_TARGET_JAVASCRIPT
 endef
 endif
 
-ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
-define QT5WEBCHANNEL_INSTALL_TARGET_QMLS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtWebChannel $(TARGET_DIR)/usr/qml/
-endef
-endif
-
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5WEBCHANNEL_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/webchannel $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
-ifneq ($(BR2_STATIC_LIBS),y)
-define QT5WEBCHANNEL_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5WebChannel.so.* $(TARGET_DIR)/usr/lib
-endef
-endif
-
 define QT5WEBCHANNEL_INSTALL_TARGET_CMDS
-	$(QT5WEBCHANNEL_INSTALL_TARGET_LIBS)
-	$(QT5WEBCHANNEL_INSTALL_TARGET_QMLS)
+	$(QT5_INSTALL_TARGET)
 	$(QT5WEBCHANNEL_INSTALL_TARGET_JAVASCRIPT)
-	$(QT5WEBCHANNEL_INSTALL_TARGET_EXAMPLES)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5webengine/qt5webengine.mk b/package/qt5/qt5webengine/qt5webengine.mk
index a3cfcec26e..09cb8c135f 100644
--- a/package/qt5/qt5webengine/qt5webengine.mk
+++ b/package/qt5/qt5webengine/qt5webengine.mk
@@ -76,30 +76,8 @@ define QT5WEBENGINE_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-define QT5WEBENGINE_INSTALL_TARGET_QMLS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtWebEngine $(TARGET_DIR)/usr/qml/
-endef
-
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5WEBENGINE_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/webengine* $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
-ifneq ($(BR2_STATIC_LIBS),y)
-define QT5WEBENGINE_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5WebEngine*.so.* $(TARGET_DIR)/usr/lib
-	cp -dpf $(STAGING_DIR)/usr/libexec/QtWebEngineProcess $(TARGET_DIR)/usr/libexec/
-	cp -dpfr $(STAGING_DIR)/usr/resources/ $(TARGET_DIR)/usr/
-	mkdir -p $(TARGET_DIR)/usr/translations/qtwebengine_locales/
-	cp -dpfr $(STAGING_DIR)/usr/translations/qtwebengine_locales $(TARGET_DIR)/usr/translations/qtwebengine_locales/
-endef
-endif
-
 define QT5WEBENGINE_INSTALL_TARGET_CMDS
-	$(QT5WEBENGINE_INSTALL_TARGET_LIBS)
-	$(QT5WEBENGINE_INSTALL_TARGET_QMLS)
-	$(QT5WEBENGINE_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5webkit-examples/qt5webkit-examples.mk b/package/qt5/qt5webkit-examples/qt5webkit-examples.mk
index 94153fd652..7e041a5c75 100644
--- a/package/qt5/qt5webkit-examples/qt5webkit-examples.mk
+++ b/package/qt5/qt5webkit-examples/qt5webkit-examples.mk
@@ -40,15 +40,10 @@ endef
 
 ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
 QT5WEBKIT_EXAMPLES_DEPENDENCIES += qt5declarative
-define QT5WEBKIT_EXAMPLES_INSTALL_QML
-	cp -dpfr $(@D)/examples/webkitqml $(TARGET_DIR)/usr/lib/qt/examples
-endef
 endif
 
 define QT5WEBKIT_EXAMPLES_INSTALL_TARGET_CMDS
-	mkdir -p $(TARGET_DIR)/usr/lib/qt/examples
-	cp -dpfr $(@D)/examples/webkitwidgets $(TARGET_DIR)/usr/lib/qt/examples
-	$(QT5WEBKIT_EXAMPLES_INSTALL_QML)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5webkit/qt5webkit.mk b/package/qt5/qt5webkit/qt5webkit.mk
index a0a0998d12..739372af9e 100644
--- a/package/qt5/qt5webkit/qt5webkit.mk
+++ b/package/qt5/qt5webkit/qt5webkit.mk
@@ -57,16 +57,9 @@ define QT5WEBKIT_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
-define QT5WEBKIT_INSTALL_TARGET_QMLS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtWebKit $(TARGET_DIR)/usr/qml/
-endef
-endif
-
 define QT5WEBKIT_INSTALL_TARGET_CMDS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5WebKit*.so.* $(TARGET_DIR)/usr/lib
+	$(QT5_INSTALL_TARGET)
 	cp -dpf $(@D)/bin/* $(TARGET_DIR)/usr/bin/
-	$(QT5WEBKIT_INSTALL_TARGET_QMLS)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5websockets/qt5websockets.mk b/package/qt5/qt5websockets/qt5websockets.mk
index c67db198db..2b0e2bf284 100644
--- a/package/qt5/qt5websockets/qt5websockets.mk
+++ b/package/qt5/qt5websockets/qt5websockets.mk
@@ -38,29 +38,8 @@ define QT5WEBSOCKETS_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
-define QT5WEBSOCKETS_INSTALL_TARGET_QMLS
-	cp -dpfr $(STAGING_DIR)/usr/qml/Qt/WebSockets $(TARGET_DIR)/usr/qml/Qt/
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtWebSockets $(TARGET_DIR)/usr/qml/
-endef
-endif
-
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5WEBSOCKETS_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/websockets $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
-ifneq ($(BR2_STATIC_LIBS),y)
-define QT5WEBSOCKETS_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5WebSockets.so.* $(TARGET_DIR)/usr/lib
-endef
-endif
-
 define QT5WEBSOCKETS_INSTALL_TARGET_CMDS
-	$(QT5WEBSOCKETS_INSTALL_TARGET_LIBS)
-	$(QT5WEBSOCKETS_INSTALL_TARGET_QMLS)
-	$(QT5WEBSOCKETS_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5x11extras/qt5x11extras.mk b/package/qt5/qt5x11extras/qt5x11extras.mk
index 9d54c11061..55c8e741ab 100644
--- a/package/qt5/qt5x11extras/qt5x11extras.mk
+++ b/package/qt5/qt5x11extras/qt5x11extras.mk
@@ -31,10 +31,8 @@ define QT5X11EXTRAS_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_STATIC_LIBS),)
 define QT5X11EXTRAS_INSTALL_TARGET_CMDS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5X11Extras.so.* $(TARGET_DIR)/usr/lib
+	$(QT5_INSTALL_TARGET)
 endef
-endif
 
 $(eval $(generic-package))
diff --git a/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk b/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
index 0a8b47ac53..98096a6157 100644
--- a/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
+++ b/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
@@ -34,21 +34,8 @@ define QT5XMLPATTERNS_INSTALL_STAGING_CMDS
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
-ifeq ($(BR2_STATIC_LIBS),)
-define QT5XMLPATTERNS_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5XmlPatterns*.so.* $(TARGET_DIR)/usr/lib
-endef
-endif
-
-ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-define QT5XMLPATTERNS_INSTALL_TARGET_EXAMPLES
-	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/xmlpatterns $(TARGET_DIR)/usr/lib/qt/examples/
-endef
-endif
-
 define QT5XMLPATTERNS_INSTALL_TARGET_CMDS
-	$(QT5XMLPATTERNS_INSTALL_TARGET_LIBS)
-	$(QT5XMLPATTERNS_INSTALL_TARGET_EXAMPLES)
+	$(QT5_INSTALL_TARGET)
 endef
 
 $(eval $(generic-package))
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 03/13] qt5base: Fix inconsistencies when overriding qmake properties
  2019-03-14  9:40 [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Andreas Naumann
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 01/13] qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen Andreas Naumann
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 02/13] qt5: Convert to generic target install command Andreas Naumann
@ 2019-03-14  9:40 ` Andreas Naumann
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 04/13] qt5: Remove *.la/*.prl fixup script Andreas Naumann
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Andreas Naumann @ 2019-03-14  9:40 UTC (permalink / raw)
  To: buildroot

When querying the qmake properties with our custom qt.conf present, I noticed
that they were different from the built-in ones (without qt.conf).
Most notably QT_INSTALL_PREFIX was a concatenated string of two absolute pathes
(hostdir + sysroot).

This is due to Prefix being set to our HOST_DIR and HostPrefix not being set at
all. I guess this was also the root cause of the initial problem with
qt.conf.in, because once Prefix and HostPrefix were set to their correct values,
re-setting all the other default pathes became obsolete. (However, since our
pathes for Headers, Plugins and Examples are non-default, they still have to be
explicitely set.)

There is one additional exception to this: Omitting 'Settings' leads to the
CONFIGURATION path being plain /usr, whereas the default without qt.conf is
/usr/etc/xdg. Thus 'Settings' is now also explicitely set, in order to keep
behaviour with/without qt.conf as similar as possible.

Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
 package/qt5/qt5base/qt.conf.in | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/package/qt5/qt5base/qt.conf.in b/package/qt5/qt5base/qt.conf.in
index 9a0b9cd53b..46ebe61614 100644
--- a/package/qt5/qt5base/qt.conf.in
+++ b/package/qt5/qt5base/qt.conf.in
@@ -1,19 +1,8 @@
 [Paths]
-Prefix=@@HOST_DIR@@
+Prefix=/usr
+HostPrefix=@@HOST_DIR@@
 Sysroot=@@STAGING_DIR@@
 Headers=/usr/include/qt5
-Libraries=/usr/lib
-LibraryExecutables=/usr/libexec
-Binaries=/usr/bin
 Plugins=/usr/lib/qt/plugins
 Examples=/usr/lib/qt/examples
-Qml2Imports=/usr/qml
-Imports=/usr/imports
-Translations=/usr/translations
-Examples=/usr/lib/qt/examples
-Demos=/usr/lib/qt/examples
-Tests=/usr/tests
-Settings=/usr
-Documentation=/usr/doc
-ArchData=/usr
-Data=/usr
+Settings=/usr/etc/xdg
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 04/13] qt5: Remove *.la/*.prl fixup script
  2019-03-14  9:40 [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Andreas Naumann
                   ` (2 preceding siblings ...)
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 03/13] qt5base: Fix inconsistencies when overriding qmake properties Andreas Naumann
@ 2019-03-14  9:40 ` Andreas Naumann
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 05/13] qt5: Use qmake via QT5_QMAKE variable Andreas Naumann
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Andreas Naumann @ 2019-03-14  9:40 UTC (permalink / raw)
  To: buildroot

After fixing Prefix in our custom qt.conf, Qt computes and embeds the correct
sysroot prefixed pathes in all *.la and *.prl files.

Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
 package/qt5/qt5.mk                             | 15 ---------------
 package/qt5/qt53d/qt53d.mk                     |  1 -
 package/qt5/qt5base/qt5base.mk                 |  1 -
 package/qt5/qt5canvas3d/qt5canvas3d.mk         |  1 -
 package/qt5/qt5charts/qt5charts.mk             |  1 -
 package/qt5/qt5connectivity/qt5connectivity.mk |  1 -
 package/qt5/qt5declarative/qt5declarative.mk   |  1 -
 package/qt5/qt5enginio/qt5enginio.mk           |  1 -
 package/qt5/qt5location/qt5location.mk         |  1 -
 package/qt5/qt5multimedia/qt5multimedia.mk     |  1 -
 package/qt5/qt5script/qt5script.mk             |  1 -
 package/qt5/qt5scxml/qt5scxml.mk               |  1 -
 package/qt5/qt5sensors/qt5sensors.mk           |  1 -
 package/qt5/qt5serialbus/qt5serialbus.mk       |  1 -
 package/qt5/qt5serialport/qt5serialport.mk     |  1 -
 package/qt5/qt5svg/qt5svg.mk                   |  1 -
 package/qt5/qt5wayland/qt5wayland.mk           |  1 -
 package/qt5/qt5webchannel/qt5webchannel.mk     |  1 -
 package/qt5/qt5webengine/qt5webengine.mk       |  1 -
 package/qt5/qt5webkit/qt5webkit.mk             |  1 -
 package/qt5/qt5websockets/qt5websockets.mk     |  1 -
 package/qt5/qt5x11extras/qt5x11extras.mk       |  1 -
 package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk   |  1 -
 23 files changed, 37 deletions(-)

diff --git a/package/qt5/qt5.mk b/package/qt5/qt5.mk
index 5acbbf2ef3..772551cae4 100644
--- a/package/qt5/qt5.mk
+++ b/package/qt5/qt5.mk
@@ -17,21 +17,6 @@ QT5_SITE = https://download.qt.io/official_releases/qt/$(QT5_VERSION_MAJOR)/$(QT
 
 include $(sort $(wildcard package/qt5/*/*.mk))
 
-define QT5_LA_PRL_FILES_FIXUP
-	for i in $$(find $(STAGING_DIR)/usr/lib* -name "libQt5*.la"); do \
-		$(SED)  "s:$(BASE_DIR):@BASE_DIR@:g" \
-			-e "s:$(STAGING_DIR):@STAGING_DIR@:g" \
-			-e "s:\(['= ]\)/usr:\\1 at STAGING_DIR@/usr:g" \
-			-e "s:@STAGING_DIR@:$(STAGING_DIR):g" \
-			-e "s:@BASE_DIR@:$(BASE_DIR):g" \
-			$$i ; \
-		$(SED) "/^dependency_libs=/s%-L/usr/lib %%g" $$i ; \
-	done
-	for i in $$(find $(STAGING_DIR)/usr/lib* -name "libQt5*.prl"); do \
-		$(SED) "s%-L/usr/lib%%" $$i; \
-	done
-endef
-
 define QT5_INSTALL_TARGET
 	cd $(STAGING_DIR)/usr; find . -cnewer $(@D)/.stamp_built \
 		! -name *.la ! -name *.prl \
diff --git a/package/qt5/qt53d/qt53d.mk b/package/qt5/qt53d/qt53d.mk
index eb8da66d11..f8d9916b70 100644
--- a/package/qt5/qt53d/qt53d.mk
+++ b/package/qt5/qt53d/qt53d.mk
@@ -27,7 +27,6 @@ endef
 
 define QT53D_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 ifeq ($(BR2_STATIC_LIBS),)
diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index 74f6c8d7d3..73699b9cb7 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -333,7 +333,6 @@ endef
 
 define QT5BASE_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 	$(QT5BASE_INSTALL_QT_CONF)
 endef
 
diff --git a/package/qt5/qt5canvas3d/qt5canvas3d.mk b/package/qt5/qt5canvas3d/qt5canvas3d.mk
index 006d3d964e..05ea03d365 100644
--- a/package/qt5/qt5canvas3d/qt5canvas3d.mk
+++ b/package/qt5/qt5canvas3d/qt5canvas3d.mk
@@ -28,7 +28,6 @@ endef
 
 define QT5CANVAS3D_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5CANVAS3D_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5charts/qt5charts.mk b/package/qt5/qt5charts/qt5charts.mk
index d11a301a86..0d8db66dc4 100644
--- a/package/qt5/qt5charts/qt5charts.mk
+++ b/package/qt5/qt5charts/qt5charts.mk
@@ -34,7 +34,6 @@ endef
 
 define QT5CHARTS_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 
diff --git a/package/qt5/qt5connectivity/qt5connectivity.mk b/package/qt5/qt5connectivity/qt5connectivity.mk
index e96014b64b..fb034d7b7c 100644
--- a/package/qt5/qt5connectivity/qt5connectivity.mk
+++ b/package/qt5/qt5connectivity/qt5connectivity.mk
@@ -36,7 +36,6 @@ endef
 
 define QT5CONNECTIVITY_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5CONNECTIVITY_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5declarative/qt5declarative.mk b/package/qt5/qt5declarative/qt5declarative.mk
index ef18553d0b..c617fe9bed 100644
--- a/package/qt5/qt5declarative/qt5declarative.mk
+++ b/package/qt5/qt5declarative/qt5declarative.mk
@@ -28,7 +28,6 @@ endef
 
 define QT5DECLARATIVE_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5DECLARATIVE_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5enginio/qt5enginio.mk b/package/qt5/qt5enginio/qt5enginio.mk
index b39d2eb097..1015044264 100644
--- a/package/qt5/qt5enginio/qt5enginio.mk
+++ b/package/qt5/qt5enginio/qt5enginio.mk
@@ -32,7 +32,6 @@ endef
 
 define QT5ENGINIO_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5ENGINIO_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5location/qt5location.mk b/package/qt5/qt5location/qt5location.mk
index d4b4ffe41b..9b0813e9ad 100644
--- a/package/qt5/qt5location/qt5location.mk
+++ b/package/qt5/qt5location/qt5location.mk
@@ -32,7 +32,6 @@ endef
 
 define QT5LOCATION_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5LOCATION_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5multimedia/qt5multimedia.mk b/package/qt5/qt5multimedia/qt5multimedia.mk
index 9f7342adfb..7f2197e770 100644
--- a/package/qt5/qt5multimedia/qt5multimedia.mk
+++ b/package/qt5/qt5multimedia/qt5multimedia.mk
@@ -44,7 +44,6 @@ endef
 
 define QT5MULTIMEDIA_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
diff --git a/package/qt5/qt5script/qt5script.mk b/package/qt5/qt5script/qt5script.mk
index 9f70a87d41..9f2bd55324 100644
--- a/package/qt5/qt5script/qt5script.mk
+++ b/package/qt5/qt5script/qt5script.mk
@@ -37,7 +37,6 @@ endef
 
 define QT5SCRIPT_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5SCRIPT_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5scxml/qt5scxml.mk b/package/qt5/qt5scxml/qt5scxml.mk
index ce3cd650a7..ad0d17502f 100644
--- a/package/qt5/qt5scxml/qt5scxml.mk
+++ b/package/qt5/qt5scxml/qt5scxml.mk
@@ -26,7 +26,6 @@ endef
 
 define QT5SCXML_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5SCXML_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5sensors/qt5sensors.mk b/package/qt5/qt5sensors/qt5sensors.mk
index 2cd6e0d5fb..baabc053fc 100644
--- a/package/qt5/qt5sensors/qt5sensors.mk
+++ b/package/qt5/qt5sensors/qt5sensors.mk
@@ -32,7 +32,6 @@ endef
 
 define QT5SENSORS_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5SENSORS_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5serialbus/qt5serialbus.mk b/package/qt5/qt5serialbus/qt5serialbus.mk
index 2841172fb7..68b622dde1 100644
--- a/package/qt5/qt5serialbus/qt5serialbus.mk
+++ b/package/qt5/qt5serialbus/qt5serialbus.mk
@@ -23,7 +23,6 @@ endef
 
 define QT5SERIALBUS_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5SERIALBUS_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5serialport/qt5serialport.mk b/package/qt5/qt5serialport/qt5serialport.mk
index 9059443073..d0cf7f13a4 100644
--- a/package/qt5/qt5serialport/qt5serialport.mk
+++ b/package/qt5/qt5serialport/qt5serialport.mk
@@ -28,7 +28,6 @@ endef
 
 define QT5SERIALPORT_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5SERIALPORT_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5svg/qt5svg.mk b/package/qt5/qt5svg/qt5svg.mk
index 800a9fbdd1..a51063a489 100644
--- a/package/qt5/qt5svg/qt5svg.mk
+++ b/package/qt5/qt5svg/qt5svg.mk
@@ -28,7 +28,6 @@ endef
 
 define QT5SVG_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5SVG_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5wayland/qt5wayland.mk b/package/qt5/qt5wayland/qt5wayland.mk
index c5365198ba..4ab73aa249 100644
--- a/package/qt5/qt5wayland/qt5wayland.mk
+++ b/package/qt5/qt5wayland/qt5wayland.mk
@@ -40,7 +40,6 @@ endef
 
 define QT5WAYLAND_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5WAYLAND_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5webchannel/qt5webchannel.mk b/package/qt5/qt5webchannel/qt5webchannel.mk
index 8e62e9c6f0..b0103549bf 100644
--- a/package/qt5/qt5webchannel/qt5webchannel.mk
+++ b/package/qt5/qt5webchannel/qt5webchannel.mk
@@ -35,7 +35,6 @@ endef
 
 define QT5WEBCHANNEL_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
diff --git a/package/qt5/qt5webengine/qt5webengine.mk b/package/qt5/qt5webengine/qt5webengine.mk
index 09cb8c135f..4b95020c2b 100644
--- a/package/qt5/qt5webengine/qt5webengine.mk
+++ b/package/qt5/qt5webengine/qt5webengine.mk
@@ -73,7 +73,6 @@ endef
 
 define QT5WEBENGINE_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(QT5WEBENGINE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5WEBENGINE_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5webkit/qt5webkit.mk b/package/qt5/qt5webkit/qt5webkit.mk
index 739372af9e..367bcd9f42 100644
--- a/package/qt5/qt5webkit/qt5webkit.mk
+++ b/package/qt5/qt5webkit/qt5webkit.mk
@@ -54,7 +54,6 @@ endef
 
 define QT5WEBKIT_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(QT5WEBKIT_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5WEBKIT_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5websockets/qt5websockets.mk b/package/qt5/qt5websockets/qt5websockets.mk
index 2b0e2bf284..d15c9f4353 100644
--- a/package/qt5/qt5websockets/qt5websockets.mk
+++ b/package/qt5/qt5websockets/qt5websockets.mk
@@ -35,7 +35,6 @@ endef
 
 define QT5WEBSOCKETS_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5WEBSOCKETS_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5x11extras/qt5x11extras.mk b/package/qt5/qt5x11extras/qt5x11extras.mk
index 55c8e741ab..075fbf2850 100644
--- a/package/qt5/qt5x11extras/qt5x11extras.mk
+++ b/package/qt5/qt5x11extras/qt5x11extras.mk
@@ -28,7 +28,6 @@ endef
 
 define QT5X11EXTRAS_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5X11EXTRAS_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk b/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
index 98096a6157..16233cf1ac 100644
--- a/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
+++ b/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
@@ -31,7 +31,6 @@ endef
 
 define QT5XMLPATTERNS_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
 define QT5XMLPATTERNS_INSTALL_TARGET_CMDS
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 05/13] qt5: Use qmake via QT5_QMAKE variable
  2019-03-14  9:40 [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Andreas Naumann
                   ` (3 preceding siblings ...)
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 04/13] qt5: Remove *.la/*.prl fixup script Andreas Naumann
@ 2019-03-14  9:40 ` Andreas Naumann
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 06/13] core: implement per-package SDK and target Andreas Naumann
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Andreas Naumann @ 2019-03-14  9:40 UTC (permalink / raw)
  To: buildroot

... in order to consistently use qmake with infrastructure specific settings.

Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
 package/python-sip/python-sip.mk                       | 2 +-
 package/qt5/qt53d/qt53d.mk                             | 2 +-
 package/qt5/qt5canvas3d/qt5canvas3d.mk                 | 2 +-
 package/qt5/qt5charts/qt5charts.mk                     | 2 +-
 package/qt5/qt5connectivity/qt5connectivity.mk         | 2 +-
 package/qt5/qt5declarative/qt5declarative.mk           | 2 +-
 package/qt5/qt5enginio/qt5enginio.mk                   | 2 +-
 package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk | 2 +-
 package/qt5/qt5imageformats/qt5imageformats.mk         | 2 +-
 package/qt5/qt5location/qt5location.mk                 | 2 +-
 package/qt5/qt5multimedia/qt5multimedia.mk             | 2 +-
 package/qt5/qt5quickcontrols/qt5quickcontrols.mk       | 2 +-
 package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk     | 2 +-
 package/qt5/qt5script/qt5script.mk                     | 2 +-
 package/qt5/qt5scxml/qt5scxml.mk                       | 2 +-
 package/qt5/qt5sensors/qt5sensors.mk                   | 2 +-
 package/qt5/qt5serialbus/qt5serialbus.mk               | 2 +-
 package/qt5/qt5serialport/qt5serialport.mk             | 2 +-
 package/qt5/qt5svg/qt5svg.mk                           | 2 +-
 package/qt5/qt5tools/qt5tools.mk                       | 2 +-
 package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk   | 2 +-
 package/qt5/qt5wayland/qt5wayland.mk                   | 2 +-
 package/qt5/qt5webchannel/qt5webchannel.mk             | 2 +-
 package/qt5/qt5webengine/qt5webengine.mk               | 2 +-
 package/qt5/qt5webkit-examples/qt5webkit-examples.mk   | 2 +-
 package/qt5/qt5webkit/qt5webkit.mk                     | 2 +-
 package/qt5/qt5websockets/qt5websockets.mk             | 2 +-
 package/qt5/qt5x11extras/qt5x11extras.mk               | 2 +-
 package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk           | 2 +-
 package/qt5cinex/qt5cinex.mk                           | 2 +-
 30 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/package/python-sip/python-sip.mk b/package/python-sip/python-sip.mk
index 69019f5f19..3e4f2545e7 100644
--- a/package/python-sip/python-sip.mk
+++ b/package/python-sip/python-sip.mk
@@ -46,7 +46,7 @@ define PYTHON_SIP_CONFIGURE_CMDS
 			--sipdir $(TARGET_DIR)/usr/share/sip \
 			--sysroot $(STAGING_DIR)/usr \
 			--use-qmake && \
-		$(HOST_DIR)/bin/qmake)
+		$(QT5_QMAKE))
 endef
 
 define PYTHON_SIP_BUILD_CMDS
diff --git a/package/qt5/qt53d/qt53d.mk b/package/qt5/qt53d/qt53d.mk
index f8d9916b70..53bf3d8e43 100644
--- a/package/qt5/qt53d/qt53d.mk
+++ b/package/qt5/qt53d/qt53d.mk
@@ -18,7 +18,7 @@ QT53D_LICENSE = GPL-2.0 or GPL-3.0 or LGPL-3.0
 QT53D_LICENSE_FILES = LICENSE.GPL LICENSE.GPLv3 LICENSE.LGPLv3
 
 define QT53D_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT53D_BUILD_CMDS
diff --git a/package/qt5/qt5canvas3d/qt5canvas3d.mk b/package/qt5/qt5canvas3d/qt5canvas3d.mk
index 05ea03d365..3ea9afb928 100644
--- a/package/qt5/qt5canvas3d/qt5canvas3d.mk
+++ b/package/qt5/qt5canvas3d/qt5canvas3d.mk
@@ -19,7 +19,7 @@ QT5CANVAS3D_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv3
 endif
 
 define QT5CANVAS3D_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5CANVAS3D_BUILD_CMDS
diff --git a/package/qt5/qt5charts/qt5charts.mk b/package/qt5/qt5charts/qt5charts.mk
index 0d8db66dc4..cbb92e5f12 100644
--- a/package/qt5/qt5charts/qt5charts.mk
+++ b/package/qt5/qt5charts/qt5charts.mk
@@ -25,7 +25,7 @@ QT5CHARTS_DEPENDENCIES += qt5declarative
 endif
 
 define QT5CHARTS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5CHARTS_BUILD_CMDS
diff --git a/package/qt5/qt5connectivity/qt5connectivity.mk b/package/qt5/qt5connectivity/qt5connectivity.mk
index fb034d7b7c..549f2e16fa 100644
--- a/package/qt5/qt5connectivity/qt5connectivity.mk
+++ b/package/qt5/qt5connectivity/qt5connectivity.mk
@@ -27,7 +27,7 @@ QT5CONNECTIVITY_DEPENDENCIES += $(if $(BR2_PACKAGE_BLUEZ5_UTILS),bluez5_utils)
 QT5CONNECTIVITY_DEPENDENCIES += $(if $(BR2_PACKAGE_NEARD),neard)
 
 define QT5CONNECTIVITY_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5CONNECTIVITY_BUILD_CMDS
diff --git a/package/qt5/qt5declarative/qt5declarative.mk b/package/qt5/qt5declarative/qt5declarative.mk
index c617fe9bed..9099ff7cc7 100644
--- a/package/qt5/qt5declarative/qt5declarative.mk
+++ b/package/qt5/qt5declarative/qt5declarative.mk
@@ -19,7 +19,7 @@ QT5DECLARATIVE_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt
 endif
 
 define QT5DECLARATIVE_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5DECLARATIVE_BUILD_CMDS
diff --git a/package/qt5/qt5enginio/qt5enginio.mk b/package/qt5/qt5enginio/qt5enginio.mk
index 1015044264..968c47e283 100644
--- a/package/qt5/qt5enginio/qt5enginio.mk
+++ b/package/qt5/qt5enginio/qt5enginio.mk
@@ -23,7 +23,7 @@ QT5ENGINIO_DEPENDENCIES += qt5declarative
 endif
 
 define QT5ENGINIO_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5ENGINIO_BUILD_CMDS
diff --git a/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk b/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk
index f399787d8f..6fed650248 100644
--- a/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk
+++ b/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk
@@ -19,7 +19,7 @@ QT5GRAPHICALEFFECTS_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv21
 endif
 
 define QT5GRAPHICALEFFECTS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5GRAPHICALEFFECTS_BUILD_CMDS
diff --git a/package/qt5/qt5imageformats/qt5imageformats.mk b/package/qt5/qt5imageformats/qt5imageformats.mk
index a7db819268..6ec9c8eaa1 100644
--- a/package/qt5/qt5imageformats/qt5imageformats.mk
+++ b/package/qt5/qt5imageformats/qt5imageformats.mk
@@ -19,7 +19,7 @@ QT5IMAGEFORMATS_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv21 LGPL
 endif
 
 define QT5IMAGEFORMATS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5IMAGEFORMATS_BUILD_CMDS
diff --git a/package/qt5/qt5location/qt5location.mk b/package/qt5/qt5location/qt5location.mk
index 9b0813e9ad..8911ca0b22 100644
--- a/package/qt5/qt5location/qt5location.mk
+++ b/package/qt5/qt5location/qt5location.mk
@@ -23,7 +23,7 @@ QT5LOCATION_DEPENDENCIES += qt5declarative
 endif
 
 define QT5LOCATION_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5LOCATION_BUILD_CMDS
diff --git a/package/qt5/qt5multimedia/qt5multimedia.mk b/package/qt5/qt5multimedia/qt5multimedia.mk
index 7f2197e770..5d92fb9e62 100644
--- a/package/qt5/qt5multimedia/qt5multimedia.mk
+++ b/package/qt5/qt5multimedia/qt5multimedia.mk
@@ -35,7 +35,7 @@ QT5MULTIMEDIA_DEPENDENCIES += alsa-lib
 endif
 
 define QT5MULTIMEDIA_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5MULTIMEDIA_BUILD_CMDS
diff --git a/package/qt5/qt5quickcontrols/qt5quickcontrols.mk b/package/qt5/qt5quickcontrols/qt5quickcontrols.mk
index faa109bc6f..1c152636a9 100644
--- a/package/qt5/qt5quickcontrols/qt5quickcontrols.mk
+++ b/package/qt5/qt5quickcontrols/qt5quickcontrols.mk
@@ -19,7 +19,7 @@ QT5QUICKCONTROLS_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv3 LICE
 endif
 
 define QT5QUICKCONTROLS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5QUICKCONTROLS_BUILD_CMDS
diff --git a/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk b/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk
index 950153ae4b..b7e28330a3 100644
--- a/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk
+++ b/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk
@@ -14,7 +14,7 @@ QT5QUICKCONTROLS2_LICENSE = GPL-3.0 or LGPL-3.0, GFDL-1.3 (docs)
 QT5QUICKCONTROLS2_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv3 LICENSE.FDL
 
 define QT5QUICKCONTROLS2_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5QUICKCONTROLS2_BUILD_CMDS
diff --git a/package/qt5/qt5script/qt5script.mk b/package/qt5/qt5script/qt5script.mk
index 9f2bd55324..698fa75a9f 100644
--- a/package/qt5/qt5script/qt5script.mk
+++ b/package/qt5/qt5script/qt5script.mk
@@ -28,7 +28,7 @@ QT5SCRIPT_LICENSE_FILES += \
 	src/3rdparty/javascriptcore/JavaScriptCore/pcre/COPYING
 
 define QT5SCRIPT_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5SCRIPT_BUILD_CMDS
diff --git a/package/qt5/qt5scxml/qt5scxml.mk b/package/qt5/qt5scxml/qt5scxml.mk
index ad0d17502f..6f8b85972e 100644
--- a/package/qt5/qt5scxml/qt5scxml.mk
+++ b/package/qt5/qt5scxml/qt5scxml.mk
@@ -17,7 +17,7 @@ QT5SCXML_LICENSE := $(QT5SCXML_LICENSE), BSD-3-Clause (examples)
 endif
 
 define QT5SCXML_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5SCXML_BUILD_CMDS
diff --git a/package/qt5/qt5sensors/qt5sensors.mk b/package/qt5/qt5sensors/qt5sensors.mk
index baabc053fc..0dd499211d 100644
--- a/package/qt5/qt5sensors/qt5sensors.mk
+++ b/package/qt5/qt5sensors/qt5sensors.mk
@@ -23,7 +23,7 @@ QT5SENSORS_DEPENDENCIES += qt5declarative
 endif
 
 define QT5SENSORS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5SENSORS_BUILD_CMDS
diff --git a/package/qt5/qt5serialbus/qt5serialbus.mk b/package/qt5/qt5serialbus/qt5serialbus.mk
index 68b622dde1..7e972e2b47 100644
--- a/package/qt5/qt5serialbus/qt5serialbus.mk
+++ b/package/qt5/qt5serialbus/qt5serialbus.mk
@@ -14,7 +14,7 @@ QT5SERIALBUS_LICENSE = GPL-2.0 or GPL-3.0 or LGPL-3.0, GFDL-1.3 (docs)
 QT5SERIALBUS_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv3 LICENSE.FDL
 
 define QT5SERIALBUS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5SERIALBUS_BUILD_CMDS
diff --git a/package/qt5/qt5serialport/qt5serialport.mk b/package/qt5/qt5serialport/qt5serialport.mk
index d0cf7f13a4..b6cfbbefbf 100644
--- a/package/qt5/qt5serialport/qt5serialport.mk
+++ b/package/qt5/qt5serialport/qt5serialport.mk
@@ -19,7 +19,7 @@ QT5SERIALPORT_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_E
 endif
 
 define QT5SERIALPORT_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5SERIALPORT_BUILD_CMDS
diff --git a/package/qt5/qt5svg/qt5svg.mk b/package/qt5/qt5svg/qt5svg.mk
index a51063a489..e9250179dc 100644
--- a/package/qt5/qt5svg/qt5svg.mk
+++ b/package/qt5/qt5svg/qt5svg.mk
@@ -19,7 +19,7 @@ QT5SVG_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.
 endif
 
 define QT5SVG_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5SVG_BUILD_CMDS
diff --git a/package/qt5/qt5tools/qt5tools.mk b/package/qt5/qt5tools/qt5tools.mk
index a972756d3a..64b4620143 100644
--- a/package/qt5/qt5tools/qt5tools.mk
+++ b/package/qt5/qt5tools/qt5tools.mk
@@ -49,7 +49,7 @@ QT5TOOLS_BUILD_DIRS_$(BR2_PACKAGE_QT5TOOLS_QTPLUGININFO) += qtplugininfo
 QT5TOOLS_INSTALL_TARGET_$(BR2_PACKAGE_QT5TOOLS_QTPLUGININFO) += qtplugininfo
 
 define QT5TOOLS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5TOOLS_BUILD_CMDS
diff --git a/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk b/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk
index 8377e1d8b8..0970a90d4a 100644
--- a/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk
+++ b/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk
@@ -55,7 +55,7 @@ QT5VIRTUALKEYBOARD_QMAKEFLAGS += CONFIG+=arrow-key-navigation
 endif
 
 define QT5VIRTUALKEYBOARD_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake $(QT5VIRTUALKEYBOARD_QMAKEFLAGS))
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE) $(QT5VIRTUALKEYBOARD_QMAKEFLAGS))
 endef
 
 define QT5VIRTUALKEYBOARD_BUILD_CMDS
diff --git a/package/qt5/qt5wayland/qt5wayland.mk b/package/qt5/qt5wayland/qt5wayland.mk
index 4ab73aa249..854b28c481 100644
--- a/package/qt5/qt5wayland/qt5wayland.mk
+++ b/package/qt5/qt5wayland/qt5wayland.mk
@@ -31,7 +31,7 @@ QT5WAYLAND_QMAKEFLAGS += CONFIG+=wayland-compositor
 endif
 
 define QT5WAYLAND_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake $(QT5WAYLAND_QMAKEFLAGS))
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE) $(QT5WAYLAND_QMAKEFLAGS))
 endef
 
 define QT5WAYLAND_BUILD_CMDS
diff --git a/package/qt5/qt5webchannel/qt5webchannel.mk b/package/qt5/qt5webchannel/qt5webchannel.mk
index b0103549bf..9abd9a20a5 100644
--- a/package/qt5/qt5webchannel/qt5webchannel.mk
+++ b/package/qt5/qt5webchannel/qt5webchannel.mk
@@ -26,7 +26,7 @@ QT5WEBCHANNEL_DEPENDENCIES += qt5declarative
 endif
 
 define QT5WEBCHANNEL_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5WEBCHANNEL_BUILD_CMDS
diff --git a/package/qt5/qt5webengine/qt5webengine.mk b/package/qt5/qt5webengine/qt5webengine.mk
index 4b95020c2b..a50f3dae61 100644
--- a/package/qt5/qt5webengine/qt5webengine.mk
+++ b/package/qt5/qt5webengine/qt5webengine.mk
@@ -64,7 +64,7 @@ QT5WEBENGINE_ENV += GN_PKG_CONFIG_HOST=$(@D)/host-bin/host-pkg-config
 endif
 
 define QT5WEBENGINE_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5WEBENGINE_ENV) $(HOST_DIR)/bin/qmake $(QT5WEBENGINE_QMAKEFLAGS))
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5WEBENGINE_ENV) $(QT5_QMAKE) $(QT5WEBENGINE_QMAKEFLAGS))
 endef
 
 define QT5WEBENGINE_BUILD_CMDS
diff --git a/package/qt5/qt5webkit-examples/qt5webkit-examples.mk b/package/qt5/qt5webkit-examples/qt5webkit-examples.mk
index 7e041a5c75..37e7f28657 100644
--- a/package/qt5/qt5webkit-examples/qt5webkit-examples.mk
+++ b/package/qt5/qt5webkit-examples/qt5webkit-examples.mk
@@ -27,7 +27,7 @@ QT5WEBKIT_EXAMPLES_DEPENDENCIES += qt5xmlpatterns
 endif
 
 define QT5WEBKIT_EXAMPLES_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5WEBKIT_EXAMPLES_BUILD_CMDS
diff --git a/package/qt5/qt5webkit/qt5webkit.mk b/package/qt5/qt5webkit/qt5webkit.mk
index 367bcd9f42..735aa9f0df 100644
--- a/package/qt5/qt5webkit/qt5webkit.mk
+++ b/package/qt5/qt5webkit/qt5webkit.mk
@@ -45,7 +45,7 @@ endef
 QT5WEBKIT_PRE_CONFIGURE_HOOKS += QT5WEBKIT_PYTHON2_SYMLINK
 
 define QT5WEBKIT_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5WEBKIT_ENV) $(HOST_DIR)/bin/qmake WEBKIT_CONFIG+=use_system_leveldb)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5WEBKIT_ENV) $(QT5_QMAKE) WEBKIT_CONFIG+=use_system_leveldb)
 endef
 
 define QT5WEBKIT_BUILD_CMDS
diff --git a/package/qt5/qt5websockets/qt5websockets.mk b/package/qt5/qt5websockets/qt5websockets.mk
index d15c9f4353..d418d7c05c 100644
--- a/package/qt5/qt5websockets/qt5websockets.mk
+++ b/package/qt5/qt5websockets/qt5websockets.mk
@@ -26,7 +26,7 @@ QT5WEBSOCKETS_DEPENDENCIES += qt5declarative
 endif
 
 define QT5WEBSOCKETS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5WEBSOCKETS_BUILD_CMDS
diff --git a/package/qt5/qt5x11extras/qt5x11extras.mk b/package/qt5/qt5x11extras/qt5x11extras.mk
index 075fbf2850..62ae68a29a 100644
--- a/package/qt5/qt5x11extras/qt5x11extras.mk
+++ b/package/qt5/qt5x11extras/qt5x11extras.mk
@@ -19,7 +19,7 @@ QT5X11EXTRAS_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EX
 endif
 
 define QT5X11EXTRAS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5X11EXTRAS_BUILD_CMDS
diff --git a/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk b/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
index 16233cf1ac..0677d8a72f 100644
--- a/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
+++ b/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
@@ -22,7 +22,7 @@ QT5XMLPATTERNS_LICENSE := $(QT5XMLPATTERNS_LICENSE), BSD-3-Clause (examples)
 endif
 
 define QT5XMLPATTERNS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
 define QT5XMLPATTERNS_BUILD_CMDS
diff --git a/package/qt5cinex/qt5cinex.mk b/package/qt5cinex/qt5cinex.mk
index 89c38ee3f5..ea8fbb7651 100644
--- a/package/qt5cinex/qt5cinex.mk
+++ b/package/qt5cinex/qt5cinex.mk
@@ -18,7 +18,7 @@ QT5CINEX_LICENSE = CC-BY-3.0
 QT5CINEX_LICENSE_FILES = README
 
 define QT5CINEX_CONFIGURE_CMDS
-	cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake
+	cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE)
 endef
 
 define QT5CINEX_BUILD_CMDS
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 06/13] core: implement per-package SDK and target
  2019-03-14  9:40 [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Andreas Naumann
                   ` (4 preceding siblings ...)
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 05/13] qt5: Use qmake via QT5_QMAKE variable Andreas Naumann
@ 2019-03-14  9:40 ` Andreas Naumann
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 07/13] Makefile: allow top-level parallel build with BR2_PER_PACKAGE_DIRECTORIES=y Andreas Naumann
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Andreas Naumann @ 2019-03-14  9:40 UTC (permalink / raw)
  To: buildroot

From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

This commit implements the core of the move to per-package SDK and
target directories. The main idea is that instead of having a global
output/host and output/target in which all packages install files, we
switch to per-package host and target directories, that only contain
their explicit dependencies.

There are two main benefits:

 - Packages will no longer discover dependencies that they do not
   explicitly indicate in their <pkg>_DEPENDENCIES variable.

 - We can support top-level parallel build properly, because a package
   only "sees" its own host directory and target directory, isolated
   from the build of other packages that can happen in parallel.

It works as follows:

 - A new output/per-package/ directory is created, which will contain
   one sub-directory per package, and inside it, a "host" directory
   and a "target" directory:

   output/per-package/busybox/target
   output/per-package/busybox/host
   output/per-package/host-fakeroot/target
   output/per-package/host-fakeroot/host

   This output/per-package/ directory is PER_PACKAGE_DIR.

 - The global TARGET_DIR and HOST_DIR variable now automatically point
   to the per-package directory when PKG is defined. So whenever a
   package references $(HOST_DIR) or $(TARGET_DIR) in its build
   process, it effectively references the per-package host/target
   directories. Note that STAGING_DIR is a sub-dir of HOST_DIR, so it
   is handled as well.

 - Of course, packages have dependencies, so those dependencies must
   be installed in the per-package host and target directories. To do
   so, we simply rsync (using hard links to save space and time) the
   host and target directories of the direct dependencies of the
   package to the current package host and target directories.

   We only need to take care of direct dependencies (and not
   recursively all dependencies), because we accumulate into those
   per-package host and target directories the files installed by the
   dependencies. Note that this only works because we make the
   assumption that one package does *not* overwrite files installed by
   another package.

   This is done for "extract dependencies" at the beginning of the
   extract step, and for "normal dependencies" at the beginning of the
   configure step.

This is basically enough to make per-package SDK and target work. The
only gotcha is that at the end of the build, output/target and
output/host are empty, which means that:

 - The filesystem image creation code cannot work.

 - We don't have a SDK to build code outside of Buildroot.

In order to fix this, this commit extends the target-finalize step so
that it starts by populating output/target and output/host by
rsync-ing into them the target and host directories of all packages
listed in the $(PACKAGES) variable. It is necessary to do this
sequentially in the target-finalize step and not in each
package. Doing it in package installation means that it can be done in
parallel. In that case, there is a chance that two rsyncs are creating
the same hardlink or directory at the same time, which makes one of
them fail.

This change to per-package directories has an impact on the RPATH
built into the host binaries, as those RPATH now point to various
per-package host directories, and no longer to the global host
directory. We do not try to rewrite such RPATHs during the build as
having such RPATHs is perfectly fine, but we still need to handle two
fallouts from this change:

 - The check-host-rpath script, which verifies at the end of each
   package installation that it has the appropriate RPATH, is modified
   to understand that a RPATH to $(PER_PACKAGE_DIR)/<pkg>/host/lib is
   a correct RPAT.

 - The fix-rpath script, which mungles the RPATH mainly for the SDK
   preparation, is modified to rewrite the RPATH to not point to
   per-package directories. Indeed the patchelf --make-rpath-relative
   call only works if the RPATH points to the ROOTDIR passed as
   argument, and this ROOTDIR is the global host directory. Rewriting
   the RPATH to not point to per-package host directories prior to
   this is an easy solution to this issue.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
 Config.in                        | 18 ++++++++++++++++++
 Makefile                         | 29 ++++++++++++++++++-----------
 package/pkg-generic.mk           |  7 ++++++-
 package/pkg-utils.mk             | 26 ++++++++++++++++++++++++++
 support/scripts/check-host-rpath | 27 ++++++++++++++++++++++-----
 support/scripts/fix-rpath        | 29 ++++++++++++++++++++++-------
 6 files changed, 112 insertions(+), 24 deletions(-)

diff --git a/Config.in b/Config.in
index 757ad1ca40..bdfe6e362c 100644
--- a/Config.in
+++ b/Config.in
@@ -708,6 +708,24 @@ config BR2_REPRODUCIBLE
 	  This is labeled as an experimental feature, as not all
 	  packages behave properly to ensure reproducibility.
 
+config BR2_PER_PACKAGE_DIRECTORIES
+	bool "Use per-package directories (experimental)"
+	help
+	  This option will change the build process of Buildroot
+	  package to use per-package target and host directories.
+
+	  This is useful for two related purposes:
+
+	    - Cleanly isolate the build of each package, so that a
+	      given package only "sees" the dependencies it has
+	      explicitly expressed, and not other packages that may
+	      have by chance been built before.
+
+	    - Enable top-level parallel build.
+
+	  This is labeled as an experimental feature, as not all
+	  packages behave properly with per-package directories.
+
 endmenu
 
 comment "Security Hardening Options"
diff --git a/Makefile b/Makefile
index 6af8923892..58282dc098 100644
--- a/Makefile
+++ b/Makefile
@@ -205,6 +205,7 @@ BR_GRAPH_OUT := $(or $(BR2_GRAPH_OUT),pdf)
 BUILD_DIR := $(BASE_DIR)/build
 BINARIES_DIR := $(BASE_DIR)/images
 BASE_TARGET_DIR := $(BASE_DIR)/target
+PER_PACKAGE_DIR := $(BASE_DIR)/per-package
 # initial definition so that 'make clean' works for most users, even without
 # .config. HOST_DIR will be overwritten later when .config is included.
 HOST_DIR := $(BASE_DIR)/host
@@ -453,12 +454,13 @@ XZCAT := $(call qstrip,$(BR2_XZCAT))
 LZCAT := $(call qstrip,$(BR2_LZCAT))
 TAR_OPTIONS = $(call qstrip,$(BR2_TAR_OPTIONS)) -xf
 
-# packages compiled for the host go here
+ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
+HOST_DIR = $(if $(PKG),$(PER_PACKAGE_DIR)/$($(PKG)_NAME)/host,$(call qstrip,$(BR2_HOST_DIR)))
+TARGET_DIR = $(if $(ROOTFS),$(ROOTFS_$(ROOTFS)_TARGET_DIR),$(if $(PKG),$(PER_PACKAGE_DIR)/$($(PKG)_NAME)/target,$(BASE_TARGET_DIR)))
+else
 HOST_DIR := $(call qstrip,$(BR2_HOST_DIR))
-
-# The target directory is common to all packages,
-# but there is one that is specific to each filesystem.
 TARGET_DIR = $(if $(ROOTFS),$(ROOTFS_$(ROOTFS)_TARGET_DIR),$(BASE_TARGET_DIR))
+endif
 
 ifneq ($(HOST_DIR),$(BASE_DIR)/host)
 HOST_DIR_SYMLINK = $(BASE_DIR)/host
@@ -594,8 +596,8 @@ world: target-post-image
 .PHONY: prepare-sdk
 prepare-sdk: world
 	@$(call MESSAGE,"Rendering the SDK relocatable")
-	$(TOPDIR)/support/scripts/fix-rpath host
-	$(TOPDIR)/support/scripts/fix-rpath staging
+	PER_PACKAGE_DIR=$(PER_PACKAGE_DIR) $(TOPDIR)/support/scripts/fix-rpath host
+	PER_PACKAGE_DIR=$(PER_PACKAGE_DIR) $(TOPDIR)/support/scripts/fix-rpath staging
 	$(INSTALL) -m 755 $(TOPDIR)/support/misc/relocate-sdk.sh $(HOST_DIR)/relocate-sdk.sh
 	mkdir -p $(HOST_DIR)/share/buildroot
 	echo $(HOST_DIR) > $(HOST_DIR)/share/buildroot/sdk-location
@@ -728,15 +730,19 @@ $(TARGETS_ROOTFS): target-finalize
 # Avoid the rootfs name leaking down the dependency chain
 target-finalize: ROOTFS=
 
-host-finalize: $(HOST_DIR_SYMLINK)
+.PHONY: host-finalize
+host-finalize: $(PACKAGES) $(HOST_DIR) $(HOST_DIR_SYMLINK)
+	@$(call MESSAGE,"Finalizing host directory")
+	$(call per-package-rsync,$(sort $(PACKAGES)),host,$(HOST_DIR))
 
 .PHONY: staging-finalize
 staging-finalize:
 	@ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
 
 .PHONY: target-finalize
-target-finalize: $(PACKAGES) host-finalize
+target-finalize: $(PACKAGES) $(TARGET_DIR) host-finalize
 	@$(call MESSAGE,"Finalizing target directory")
+	$(call per-package-rsync,$(sort $(PACKAGES)),target,$(TARGET_DIR))
 	# Check files that are touched by more than one package
 	./support/scripts/check-uniq-files -t target $(BUILD_DIR)/packages-file-list.txt
 	./support/scripts/check-uniq-files -t staging $(BUILD_DIR)/packages-file-list-staging.txt
@@ -780,7 +786,7 @@ endif
 	ln -sf ../usr/lib/os-release $(TARGET_DIR)/etc
 
 	@$(call MESSAGE,"Sanitizing RPATH in target tree")
-	$(TOPDIR)/support/scripts/fix-rpath target
+	PER_PACKAGE_DIR=$(PER_PACKAGE_DIR) $(TOPDIR)/support/scripts/fix-rpath target
 
 # For a merged /usr, ensure that /lib, /bin and /sbin and their /usr
 # counterparts are appropriately setup as symlinks ones to the others.
@@ -1004,7 +1010,8 @@ savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
 
 # staging and target directories do NOT list these as
 # dependencies anywhere else
-$(BUILD_DIR) $(BASE_TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
+$(BUILD_DIR) $(BASE_TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) \
+	$(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST) $(PER_PACKAGE_DIR):
 	@mkdir -p $@
 
 # outputmakefile generates a Makefile in the output directory, if using a
@@ -1043,7 +1050,7 @@ printvars:
 clean:
 	rm -rf $(BASE_TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) $(HOST_DIR_SYMLINK) \
 		$(BUILD_DIR) $(BASE_DIR)/staging \
-		$(LEGAL_INFO_DIR) $(GRAPHS_DIR)
+		$(LEGAL_INFO_DIR) $(GRAPHS_DIR) $(PER_PACKAGE_DIR)
 
 .PHONY: distclean
 distclean: clean
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 4353bd3868..e406abadd6 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -106,7 +106,7 @@ GLOBAL_INSTRUMENTATION_HOOKS += check_bin_arch
 # have a proper DT_RPATH or DT_RUNPATH tag
 define check_host_rpath
 	$(if $(filter install-host,$(2)),\
-		$(if $(filter end,$(1)),support/scripts/check-host-rpath $(3) $(HOST_DIR)))
+		$(if $(filter end,$(1)),support/scripts/check-host-rpath $(3) $(HOST_DIR) $(PER_PACKAGE_DIR)))
 endef
 GLOBAL_INSTRUMENTATION_HOOKS += check_host_rpath
 
@@ -141,6 +141,7 @@ endif
 # Retrieve the archive
 $(BUILD_DIR)/%/.stamp_downloaded:
 	@$(call step_start,download)
+	$(call prepare-per-package-directory,$($(PKG)_FINAL_DOWNLOAD_DEPENDENCIES))
 	$(foreach hook,$($(PKG)_PRE_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
 # Only show the download message if it isn't already downloaded
 	$(Q)for p in $($(PKG)_ALL_DOWNLOADS); do \
@@ -167,6 +168,7 @@ $(BUILD_DIR)/%/.stamp_actual_downloaded:
 $(BUILD_DIR)/%/.stamp_extracted:
 	@$(call step_start,extract)
 	@$(call MESSAGE,"Extracting")
+	$(call prepare-per-package-directory,$($(PKG)_FINAL_EXTRACT_DEPENDENCIES))
 	$(foreach hook,$($(PKG)_PRE_EXTRACT_HOOKS),$(call $(hook))$(sep))
 	$(Q)mkdir -p $(@D)
 	$($(PKG)_EXTRACT_CMDS)
@@ -227,6 +229,7 @@ $(foreach dir,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)),\
 $(BUILD_DIR)/%/.stamp_configured:
 	@$(call step_start,configure)
 	@$(call MESSAGE,"Configuring")
+	$(call prepare-per-package-directory,$($(PKG)_FINAL_DEPENDENCIES))
 	$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
 	$($(PKG)_CONFIGURE_CMDS)
 	$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
@@ -338,6 +341,7 @@ $(BUILD_DIR)/%/.stamp_target_installed:
 
 # Remove package sources
 $(BUILD_DIR)/%/.stamp_dircleaned:
+	$(if $(BR2_PER_PACKAGE_DIRECTORIES),rm -Rf $(PER_PACKAGE_DIR)/$(NAME))
 	rm -Rf $(@D)
 
 ################################################################################
@@ -897,6 +901,7 @@ $$($(2)_TARGET_SOURCE):			PKGDIR=$(pkgdir)
 $$($(2)_TARGET_ACTUAL_SOURCE):		PKG=$(2)
 $$($(2)_TARGET_ACTUAL_SOURCE):		PKGDIR=$(pkgdir)
 $$($(2)_TARGET_DIRCLEAN):		PKG=$(2)
+$$($(2)_TARGET_DIRCLEAN):		NAME=$(1)
 
 # Compute the name of the Kconfig option that correspond to the
 # package being enabled. We handle three cases: the special Linux
diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
index bffd79dfb0..34345a0d65 100644
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -62,6 +62,32 @@ $$(error Package error: use $(2) instead of $(1). Please fix your .mk file)
 endif
 endef
 
+ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
+# rsync the contents of per-package directories
+# $1: space-separated list of packages to rsync from
+# $2: 'host' or 'target'
+# $3: destination directory
+define per-package-rsync
+	mkdir -p $(3)
+	$(foreach pkg,$(1),\
+		rsync -a --link-dest=$(PER_PACKAGE_DIR)/$(pkg)/$(2)/ \
+		$(PER_PACKAGE_DIR)/$(pkg)/$(2)/ \
+		$(3)$(sep))
+endef
+
+# prepares the per-package HOST_DIR and TARGET_DIR of the current
+# package, by rsync the host and target directories of the
+# dependencies of this package. The list of dependencies is passed as
+# argument, so that this function can be used to prepare with
+# different set of dependencies (download, extract, configure, etc.)
+#
+# $1: space-separated list of packages to rsync from
+define prepare-per-package-directory
+	$(call per-package-rsync,$(1),host,$(HOST_DIR))
+	$(call per-package-rsync,$(1),target,$(TARGET_DIR))
+endef
+endif
+
 #
 # legal-info helper functions
 #
diff --git a/support/scripts/check-host-rpath b/support/scripts/check-host-rpath
index c8939569e2..d903a82958 100755
--- a/support/scripts/check-host-rpath
+++ b/support/scripts/check-host-rpath
@@ -11,6 +11,7 @@ export LC_ALL=C
 main() {
     local pkg="${1}"
     local hostdir="${2}"
+    local perpackagedir="${3}"
     local file ret
 
     # Remove duplicate and trailing '/' for proper match
@@ -20,7 +21,7 @@ main() {
     while read file; do
         is_elf "${file}" || continue
         elf_needs_rpath "${file}" "${hostdir}" || continue
-        check_elf_has_rpath "${file}" "${hostdir}" && continue
+        check_elf_has_rpath "${file}" "${hostdir}" "${perpackagedir}" && continue
         if [ ${ret} -eq 0 ]; then
             ret=1
             printf "***\n"
@@ -44,6 +45,15 @@ is_elf() {
 # needs such an RPATH if at least of the libraries used by the ELF
 # executable is available in the host library directory. This function
 # returns 0 when a RPATH is needed, 1 otherwise.
+#
+# With per-package directory support, ${hostdir} will point to the
+# current package per-package host directory, and this is where this
+# function will check if the libraries needed by the executable are
+# located (or not). In practice, the ELF executable RPATH may point to
+# another package per-package host directory, but that is fine because
+# if such an executable is within the current package per-package host
+# directory, its libraries will also have been copied into the current
+# package per-package host directory.
 elf_needs_rpath() {
     local file="${1}"
     local hostdir="${2}"
@@ -62,13 +72,19 @@ elf_needs_rpath() {
 # This function checks whether at least one of the RPATH of the given
 # ELF executable (first argument) properly points to the host library
 # directory (second argument), either through an absolute RPATH or a
-# relative RPATH. Having such a RPATH will make sure the ELF
-# executable will find at runtime the shared libraries it depends
-# on. This function returns 0 when a proper RPATH was found, or 1
-# otherwise.
+# relative RPATH. In the context of per-package directory support,
+# ${hostdir} (second argument) points to the current package host
+# directory. However, it is perfectly valid for an ELF binary to have
+# a RPATH pointing to another package per-package host directory,
+# which is why such RPATH is also accepted (the per-package directory
+# gets passed as third argument). Having a RPATH pointing to the host
+# directory will make sure the ELF executable will find at runtime the
+# shared libraries it depends on. This function returns 0 when a
+# proper RPATH was found, or 1 otherwise.
 check_elf_has_rpath() {
     local file="${1}"
     local hostdir="${2}"
+    local perpackagedir="${3}"
     local rpath dir
 
     while read rpath; do
@@ -77,6 +93,7 @@ check_elf_has_rpath() {
             dir="$( sed -r -e 's:/+:/:g; s:/$::;' <<<"${dir}" )"
             [ "${dir}" = "${hostdir}/lib" ] && return 0
             [ "${dir}" = "\$ORIGIN/../lib" ] && return 0
+            [[ ${dir} =~ ${perpackagedir}/[^/]*/host/lib ]] && return 0
         done
     done < <( readelf -d "${file}"                                              \
               |sed -r -e '/.* \(R(UN)?PATH\) +Library r(un)?path: \[(.+)\]$/!d' \
diff --git a/support/scripts/fix-rpath b/support/scripts/fix-rpath
index fa138ca15a..926767a54f 100755
--- a/support/scripts/fix-rpath
+++ b/support/scripts/fix-rpath
@@ -127,14 +127,29 @@ main() {
 
     while read file ; do
         # check if it's an ELF file
-        if ${PATCHELF} --print-rpath "${file}" > /dev/null 2>&1; then
-            # make files writable if necessary
-            changed=$(chmod -c u+w "${file}")
-            # call patchelf to sanitize the rpath
-            ${PATCHELF} --make-rpath-relative "${rootdir}" ${sanitize_extra_args[@]} "${file}"
-            # restore the original permission
-            test "${changed}" != "" && chmod u-w "${file}"
+        rpath=$(${PATCHELF} --print-rpath "${file}" 2>&1)
+        if test $? -ne 0 ; then
+            continue
         fi
+
+        # make files writable if necessary
+        changed=$(chmod -c u+w "${file}")
+
+        # With per-package directory support, most RPATH of host
+        # binaries will point to per-package directories. This won't
+        # work with the --make-rpath-relative ${rootdir} invocation as
+        # the per-package host directory is not within ${rootdir}. So,
+        # we rewrite all RPATHs pointing to per-package directories so
+        # that they point to the global host directry.
+        changed_rpath=$(echo ${rpath} | sed "s@${PER_PACKAGE_DIR}/[^/]*/host@${HOST_DIR}@")
+        if test "${rpath}" != "${changed_rpath}" ; then
+            ${PATCHELF} --set-rpath ${changed_rpath} "${file}"
+        fi
+
+        # call patchelf to sanitize the rpath
+        ${PATCHELF} --make-rpath-relative "${rootdir}" ${sanitize_extra_args[@]} "${file}"
+        # restore the original permission
+        test "${changed}" != "" && chmod u-w "${file}"
     done < <(find "${rootdir}" ${find_args[@]})
 
     # Restore patched patchelf utility
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 07/13] Makefile: allow top-level parallel build with BR2_PER_PACKAGE_DIRECTORIES=y
  2019-03-14  9:40 [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Andreas Naumann
                   ` (5 preceding siblings ...)
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 06/13] core: implement per-package SDK and target Andreas Naumann
@ 2019-03-14  9:40 ` Andreas Naumann
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 08/13] package/pkg-generic: make libtool .la files compatible with per-package directories Andreas Naumann
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Andreas Naumann @ 2019-03-14  9:40 UTC (permalink / raw)
  To: buildroot

From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

With per-package folder support, top-level parallel build becomes
safe, so we can enclose the .NOTPARALLEL statement in a
!BR2_PER_PACKAGE_DIRECTORIES condition.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
 Makefile | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index 58282dc098..4bbc3e5be9 100644
--- a/Makefile
+++ b/Makefile
@@ -228,21 +228,12 @@ ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
 -include $(BR2_CONFIG)
 endif
 
-# Parallel execution of this Makefile is disabled because it changes
-# the packages building order, that can be a problem for two reasons:
-# - If a package has an unspecified optional dependency and that
-#   dependency is present when the package is built, it is used,
-#   otherwise it isn't (but compilation happily proceeds) so the end
-#   result will differ if the order is swapped due to parallel
-#   building.
-# - Also changing the building order can be a problem if two packages
-#   manipulate the same file in the target directory.
-#
-# Taking into account the above considerations, if you still want to execute
-# this top-level Makefile in parallel comment the ".NOTPARALLEL" line and
-# use the -j<jobs> option when building, e.g:
-#      make -j$((`getconf _NPROCESSORS_ONLN`+1))
+ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),)
+# Disable top-level parallel build if per-package directories is not
+# used. Indeed, per-package directories is necessary to guarantee
+# determinism and reproducibility with top-level parallel build.
 .NOTPARALLEL:
+endif
 
 # timezone and locale may affect build output
 ifeq ($(BR2_REPRODUCIBLE),y)
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 08/13] package/pkg-generic: make libtool .la files compatible with per-package directories
  2019-03-14  9:40 [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Andreas Naumann
                   ` (6 preceding siblings ...)
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 07/13] Makefile: allow top-level parallel build with BR2_PER_PACKAGE_DIRECTORIES=y Andreas Naumann
@ 2019-03-14  9:40 ` Andreas Naumann
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 09/13] package/pkg-kconfig: handle KCONFIG_DEPENDENCIES " Andreas Naumann
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Andreas Naumann @ 2019-03-14  9:40 UTC (permalink / raw)
  To: buildroot

From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Libtool .la files unfortunately contain a number of absolute paths,
which now refer to per-package directories. Due to this, when building
package A, .la files may contain absolute paths referring to
directories in package B per-package sysroot. This causes some -L
flags referring to other sysroot from being added, which doesn't work
as the linker no longer realizes that such paths are within its
sysroot.

To fix this, we introduce a replacement step of .la files in the
configure step, to make sure all paths refer to this package
per-package directory.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
 package/pkg-generic.mk | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index e406abadd6..6d4442b824 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -134,6 +134,21 @@ endef
 GLOBAL_INSTRUMENTATION_HOOKS += step_user
 endif
 
+#######################################
+# Helper functions
+
+# Make sure .la files only reference the current per-package
+# directory.
+
+# $1: package name (lower case)
+# $2: staging directory of the package
+ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
+define fixup-libtool-files
+	$(Q)find $(2)/usr/lib* -name "*.la" | xargs --no-run-if-empty \
+		$(SED) "s:$(PER_PACKAGE_DIR)/[^/]*/:$(PER_PACKAGE_DIR)/$(1)/:g"
+endef
+endif
+
 ################################################################################
 # Implicit targets -- produce a stamp file for each step of a package build
 ################################################################################
@@ -230,6 +245,7 @@ $(BUILD_DIR)/%/.stamp_configured:
 	@$(call step_start,configure)
 	@$(call MESSAGE,"Configuring")
 	$(call prepare-per-package-directory,$($(PKG)_FINAL_DEPENDENCIES))
+	$(call fixup-libtool-files,$(NAME),$(STAGING_DIR))
 	$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
 	$($(PKG)_CONFIGURE_CMDS)
 	$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
@@ -890,6 +906,7 @@ $$($(2)_TARGET_INSTALL_IMAGES):		PKG=$(2)
 $$($(2)_TARGET_INSTALL_HOST):		PKG=$(2)
 $$($(2)_TARGET_BUILD):			PKG=$(2)
 $$($(2)_TARGET_CONFIGURE):		PKG=$(2)
+$$($(2)_TARGET_CONFIGURE):		NAME=$(1)
 $$($(2)_TARGET_RSYNC):			SRCDIR=$$($(2)_OVERRIDE_SRCDIR)
 $$($(2)_TARGET_RSYNC):			PKG=$(2)
 $$($(2)_TARGET_PATCH):			PKG=$(2)
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 09/13] package/pkg-kconfig: handle KCONFIG_DEPENDENCIES with per-package directories
  2019-03-14  9:40 [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Andreas Naumann
                   ` (7 preceding siblings ...)
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 08/13] package/pkg-generic: make libtool .la files compatible with per-package directories Andreas Naumann
@ 2019-03-14  9:40 ` Andreas Naumann
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 10/13] docs/manual: add details about top-level parallel build support Andreas Naumann
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Andreas Naumann @ 2019-03-14  9:40 UTC (permalink / raw)
  To: buildroot

From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

The pkg-kconfig infrastructure hijacks the regular chain of build
steps to insert its own step to prepare the configuration of kconfig
packages. This additional step may have dependencies of its own, such
as host-flex, host-bison or toolchain.

In the context of per-package directory support, those dependencies
must be copied to the per-package directory of the current package
prior to doing the config preparation. This commit implements this
logic by adding a call to prepare-per-package-directory at the right
spot.

Reported-by: Andreas Naumann <anaumann@ultratronik.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
 package/pkg-kconfig.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk
index ce11e14824..5a29490473 100644
--- a/package/pkg-kconfig.mk
+++ b/package/pkg-kconfig.mk
@@ -117,6 +117,7 @@ endef
 # Since the file could be a defconfig file it needs to be expanded to a
 # full .config first.
 $$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG): $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES)
+	$$(call prepare-per-package-directory,$$($(2)_KCONFIG_DEPENDENCIES))
 	$$(Q)$$(if $$($(2)_KCONFIG_DEFCONFIG), \
 		$$($(2)_KCONFIG_MAKE) $$($(2)_KCONFIG_DEFCONFIG), \
 		$$(INSTALL) -m 0644 -D $$($(2)_KCONFIG_FILE) $$(@))
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 10/13] docs/manual: add details about top-level parallel build support
  2019-03-14  9:40 [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Andreas Naumann
                   ` (8 preceding siblings ...)
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 09/13] package/pkg-kconfig: handle KCONFIG_DEPENDENCIES " Andreas Naumann
@ 2019-03-14  9:40 ` Andreas Naumann
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 11/13] docs/manual: document the effect of per-package directory on variables Andreas Naumann
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Andreas Naumann @ 2019-03-14  9:40 UTC (permalink / raw)
  To: buildroot

From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
 docs/manual/common-usage.txt        | 44 +++++++++++++++++++++++++++++
 docs/manual/faq-troubleshooting.txt |  3 ++
 docs/manual/quickstart.txt          |  8 +++---
 3 files changed, 51 insertions(+), 4 deletions(-)

diff --git a/docs/manual/common-usage.txt b/docs/manual/common-usage.txt
index e3d7578c85..ebe3238e38 100644
--- a/docs/manual/common-usage.txt
+++ b/docs/manual/common-usage.txt
@@ -329,6 +329,50 @@ Refer to the help text of this script for more details:
 utils/size-stats-compare -h
 ----------------
 
+[[top-level-parallel-build]]
+=== Top-level parallel build
+
+Buildroot has always been capable of using parallel build on a per
+package basis: each package is built by Buildroot using +make -jN+ (or
+the equivalent invocation for non-make-based build systems). The level
+of parallelism is by default number of CPUs + 1, but it can be
+adjusted using the +BR2_JLEVEL+ configuration option.
+
+Until 2019.02, Buildroot was however building packages in a serial
+fashion: each package was built one after the other, without
+parallelization of the build between packages. As of 2019.02,
+Buildroot has experimental support for *top-level parallel build*,
+which allows some signicant build time savings by building packages
+that have no dependency relationship in parallel. This feature is
+however marked as experimental and is known to not work in all
+situations.
+
+In order to use top-level parallel build, one must:
+
+. Enable the option +BR2_PER_PACKAGE_DIRECTORIES+ in the Buildroot
+configuration
+
+. Use +make -jN+ when starting the Buildroot build
+
+Internally, the +BR2_PER_PACKAGE_DIRECTORIES+ will enable a mechanism
+called *per-package directories*, which will have the following
+effects:
+
+* Instead of a global _target_ directory and a global _host_ directory
+  common to all packages, per-package _target_ and _host_ directories
+  will be used, in +$(O)/per-package/<pkg>/target/+ and
+  +$(O)/per-package/<pkg>/host/+ respectively. Those folders will be
+  populated from the corresponding folders of the package dependencies
+  at the beginning of +<pkg>+ build. The compiler and all other tools
+  will therefore only be able to see and access files installed by
+  dependencies explicitly listed by +<pkg>+.
+
+* At the end of the build, the global _target_ and _host_ directories
+  will be populated, located in +$(O)/target+ and +$(O)/host+
+  respectively. This means that during the build, those folders will
+  be empty and it's only at the very end of the build that they will
+  be populated.
+
 include::eclipse-integration.txt[]
 
 include::advanced.txt[]
diff --git a/docs/manual/faq-troubleshooting.txt b/docs/manual/faq-troubleshooting.txt
index b144c9e7f0..5adf3fa6ce 100644
--- a/docs/manual/faq-troubleshooting.txt
+++ b/docs/manual/faq-troubleshooting.txt
@@ -239,3 +239,6 @@ help reduce the build time:
 
  * Buy new hardware. SSDs and lots of RAM are key to speeding up the
    builds.
+
+ * Experiment with top-level parallel build, see
+   xref:top-level-parallel-build[].
diff --git a/docs/manual/quickstart.txt b/docs/manual/quickstart.txt
index 74158ae249..77b73ef116 100644
--- a/docs/manual/quickstart.txt
+++ b/docs/manual/quickstart.txt
@@ -60,10 +60,10 @@ To start the build process, simply run:
  $ make
 --------------------
 
-You *should never* use +make -jN+ with Buildroot: top-level parallel
-make is currently not supported. Instead, use the +BR2_JLEVEL+ option
-to tell Buildroot to run the compilation of each individual package
-with +make -jN+.
+By default, Buildroot does not support top-level parallel build, so
+running +make -jN+ is not necessary. There is however experimental
+support for top-level parallel build, see
+xref:top-level-parallel-build[].
 
 The `make` command will generally perform the following steps:
 
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 11/13] docs/manual: document the effect of per-package directory on variables
  2019-03-14  9:40 [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Andreas Naumann
                   ` (9 preceding siblings ...)
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 10/13] docs/manual: add details about top-level parallel build support Andreas Naumann
@ 2019-03-14  9:40 ` Andreas Naumann
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 12/13] qt5: Prepare qmake for per-package infrastructure Andreas Naumann
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Andreas Naumann @ 2019-03-14  9:40 UTC (permalink / raw)
  To: buildroot

From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

As suggested by Arnout Vandecappelle, this commit adjusts the
generic-package documentation to document the effect of per-package
directory support on HOST_DIR, STAGING_DIR and TARGET_DIR.

Suggested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
 docs/manual/adding-packages-generic.txt | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt
index 7be1754f54..4a991140a8 100644
--- a/docs/manual/adding-packages-generic.txt
+++ b/docs/manual/adding-packages-generic.txt
@@ -578,6 +578,13 @@ In the action definitions, you can use the following variables:
 * +$(TARGET_CROSS)+ to get the cross-compilation toolchain prefix
 
 * Of course the +$(HOST_DIR)+, +$(STAGING_DIR)+ and +$(TARGET_DIR)+
-  variables to install the packages properly.
+  variables to install the packages properly. Those variables point to
+  the global _host_, _staging_ and _target_ directories, unless
+  _per-package directory_ support is used, in which case they point to
+  the current package _host_, _staging_ and _target_ directories. In
+  both cases, it doesn't make any difference from the package point of
+  view: it should simply use +HOST_DIR+, +STAGING_DIR+ and
+  +TARGET_DIR+. See xref:top-level-parallel-build[] for more details
+  about _per-package directory_ support.
 
 Finally, you can also use hooks. See xref:hooks[] for more information.
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 12/13] qt5: Prepare qmake for per-package infrastructure
  2019-03-14  9:40 [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Andreas Naumann
                   ` (10 preceding siblings ...)
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 11/13] docs/manual: document the effect of per-package directory on variables Andreas Naumann
@ 2019-03-14  9:40 ` Andreas Naumann
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 13/13] qt5: Fix pkgconfig search path " Andreas Naumann
  2019-03-14 11:03 ` [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Arnout Vandecappelle
  13 siblings, 0 replies; 23+ messages in thread
From: Andreas Naumann @ 2019-03-14  9:40 UTC (permalink / raw)
  To: buildroot

Qmake configured packages will, by default, use the absolute HostPrefix/Sysroot
pathes set during configuration/building of qt5base for their install
destinations.
For the per-package host/staging infrastructure, this causes non-qt5base
packages to litter the qt5base folders. In addition, buildroots target-install
step subsequently fails because the respective files are missing from the proper
locations of the package itself.

Fortunately, qmake's built-in pathes can be overridden by either placing a
custom qt.conf next to the qmake binary or running qmake with the -qtconf
parameter.
The former variant is already used to facilitate SDK relocation. So for per-
package path manipulation we can reuse the existing qt.conf. But rather than
in place, a modified copy is created in the package's build folder. This avoids
headaches when finally merging the per-package host folders.

Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
 package/python-sip/python-sip.mk                       | 1 +
 package/qt5/qt5.mk                                     | 9 ++++++++-
 package/qt5/qt53d/qt53d.mk                             | 1 +
 package/qt5/qt5canvas3d/qt5canvas3d.mk                 | 1 +
 package/qt5/qt5charts/qt5charts.mk                     | 1 +
 package/qt5/qt5connectivity/qt5connectivity.mk         | 1 +
 package/qt5/qt5declarative/qt5declarative.mk           | 1 +
 package/qt5/qt5enginio/qt5enginio.mk                   | 1 +
 package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk | 1 +
 package/qt5/qt5imageformats/qt5imageformats.mk         | 1 +
 package/qt5/qt5location/qt5location.mk                 | 1 +
 package/qt5/qt5multimedia/qt5multimedia.mk             | 1 +
 package/qt5/qt5quickcontrols/qt5quickcontrols.mk       | 1 +
 package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk     | 1 +
 package/qt5/qt5script/qt5script.mk                     | 1 +
 package/qt5/qt5scxml/qt5scxml.mk                       | 1 +
 package/qt5/qt5sensors/qt5sensors.mk                   | 1 +
 package/qt5/qt5serialbus/qt5serialbus.mk               | 1 +
 package/qt5/qt5serialport/qt5serialport.mk             | 1 +
 package/qt5/qt5svg/qt5svg.mk                           | 1 +
 package/qt5/qt5tools/qt5tools.mk                       | 1 +
 package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk   | 1 +
 package/qt5/qt5wayland/qt5wayland.mk                   | 1 +
 package/qt5/qt5webchannel/qt5webchannel.mk             | 1 +
 package/qt5/qt5webengine/qt5webengine.mk               | 1 +
 package/qt5/qt5webkit-examples/qt5webkit-examples.mk   | 1 +
 package/qt5/qt5webkit/qt5webkit.mk                     | 1 +
 package/qt5/qt5websockets/qt5websockets.mk             | 1 +
 package/qt5/qt5x11extras/qt5x11extras.mk               | 1 +
 package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk           | 1 +
 package/qt5cinex/qt5cinex.mk                           | 1 +
 package/qwt/qwt.mk                                     | 1 +
 32 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/package/python-sip/python-sip.mk b/package/python-sip/python-sip.mk
index 3e4f2545e7..98c3c736d4 100644
--- a/package/python-sip/python-sip.mk
+++ b/package/python-sip/python-sip.mk
@@ -38,6 +38,7 @@ define HOST_PYTHON_SIP_INSTALL_CMDS
 endef
 
 define PYTHON_SIP_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); \
 		$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(HOST_DIR)/bin/python configure.py \
 			--bindir $(TARGET_DIR)/usr/bin \
diff --git a/package/qt5/qt5.mk b/package/qt5/qt5.mk
index 772551cae4..15ca188c8c 100644
--- a/package/qt5/qt5.mk
+++ b/package/qt5/qt5.mk
@@ -25,5 +25,12 @@ define QT5_INSTALL_TARGET
 		| rsync -arv --files-from=- $(STAGING_DIR)/usr $(TARGET_DIR)/usr
 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
+define QT5_QTCONF_FIXUP
+        sed -e "s|@@HOST_DIR@@|$(HOST_DIR)|" -e "s|@@STAGING_DIR@@|$(STAGING_DIR)|" \
+                $(QT5BASE_PKGDIR)/qt.conf.in > $(@D)/qt.conf
+endef
+
 # Variable for other Qt applications to use
-QT5_QMAKE = $(HOST_DIR)/bin/qmake -spec devices/linux-buildroot-g++
+QT5_QMAKE = $(HOST_DIR)/bin/qmake -spec devices/linux-buildroot-g++ -qtconf $(@D)/qt.conf
diff --git a/package/qt5/qt53d/qt53d.mk b/package/qt5/qt53d/qt53d.mk
index 53bf3d8e43..83dce14e56 100644
--- a/package/qt5/qt53d/qt53d.mk
+++ b/package/qt5/qt53d/qt53d.mk
@@ -18,6 +18,7 @@ QT53D_LICENSE = GPL-2.0 or GPL-3.0 or LGPL-3.0
 QT53D_LICENSE_FILES = LICENSE.GPL LICENSE.GPLv3 LICENSE.LGPLv3
 
 define QT53D_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5canvas3d/qt5canvas3d.mk b/package/qt5/qt5canvas3d/qt5canvas3d.mk
index 3ea9afb928..cc84661e55 100644
--- a/package/qt5/qt5canvas3d/qt5canvas3d.mk
+++ b/package/qt5/qt5canvas3d/qt5canvas3d.mk
@@ -19,6 +19,7 @@ QT5CANVAS3D_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv3
 endif
 
 define QT5CANVAS3D_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5charts/qt5charts.mk b/package/qt5/qt5charts/qt5charts.mk
index cbb92e5f12..9907c4fc1a 100644
--- a/package/qt5/qt5charts/qt5charts.mk
+++ b/package/qt5/qt5charts/qt5charts.mk
@@ -25,6 +25,7 @@ QT5CHARTS_DEPENDENCIES += qt5declarative
 endif
 
 define QT5CHARTS_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5connectivity/qt5connectivity.mk b/package/qt5/qt5connectivity/qt5connectivity.mk
index 549f2e16fa..d18082903d 100644
--- a/package/qt5/qt5connectivity/qt5connectivity.mk
+++ b/package/qt5/qt5connectivity/qt5connectivity.mk
@@ -27,6 +27,7 @@ QT5CONNECTIVITY_DEPENDENCIES += $(if $(BR2_PACKAGE_BLUEZ5_UTILS),bluez5_utils)
 QT5CONNECTIVITY_DEPENDENCIES += $(if $(BR2_PACKAGE_NEARD),neard)
 
 define QT5CONNECTIVITY_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5declarative/qt5declarative.mk b/package/qt5/qt5declarative/qt5declarative.mk
index 9099ff7cc7..c540fb46c5 100644
--- a/package/qt5/qt5declarative/qt5declarative.mk
+++ b/package/qt5/qt5declarative/qt5declarative.mk
@@ -19,6 +19,7 @@ QT5DECLARATIVE_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt
 endif
 
 define QT5DECLARATIVE_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5enginio/qt5enginio.mk b/package/qt5/qt5enginio/qt5enginio.mk
index 968c47e283..7ca1e14650 100644
--- a/package/qt5/qt5enginio/qt5enginio.mk
+++ b/package/qt5/qt5enginio/qt5enginio.mk
@@ -23,6 +23,7 @@ QT5ENGINIO_DEPENDENCIES += qt5declarative
 endif
 
 define QT5ENGINIO_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk b/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk
index 6fed650248..fcfc581b73 100644
--- a/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk
+++ b/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk
@@ -19,6 +19,7 @@ QT5GRAPHICALEFFECTS_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv21
 endif
 
 define QT5GRAPHICALEFFECTS_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5imageformats/qt5imageformats.mk b/package/qt5/qt5imageformats/qt5imageformats.mk
index 6ec9c8eaa1..655bd29c55 100644
--- a/package/qt5/qt5imageformats/qt5imageformats.mk
+++ b/package/qt5/qt5imageformats/qt5imageformats.mk
@@ -19,6 +19,7 @@ QT5IMAGEFORMATS_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv21 LGPL
 endif
 
 define QT5IMAGEFORMATS_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5location/qt5location.mk b/package/qt5/qt5location/qt5location.mk
index 8911ca0b22..03a71202ad 100644
--- a/package/qt5/qt5location/qt5location.mk
+++ b/package/qt5/qt5location/qt5location.mk
@@ -23,6 +23,7 @@ QT5LOCATION_DEPENDENCIES += qt5declarative
 endif
 
 define QT5LOCATION_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5multimedia/qt5multimedia.mk b/package/qt5/qt5multimedia/qt5multimedia.mk
index 5d92fb9e62..46d6455b77 100644
--- a/package/qt5/qt5multimedia/qt5multimedia.mk
+++ b/package/qt5/qt5multimedia/qt5multimedia.mk
@@ -35,6 +35,7 @@ QT5MULTIMEDIA_DEPENDENCIES += alsa-lib
 endif
 
 define QT5MULTIMEDIA_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5quickcontrols/qt5quickcontrols.mk b/package/qt5/qt5quickcontrols/qt5quickcontrols.mk
index 1c152636a9..e114e77678 100644
--- a/package/qt5/qt5quickcontrols/qt5quickcontrols.mk
+++ b/package/qt5/qt5quickcontrols/qt5quickcontrols.mk
@@ -19,6 +19,7 @@ QT5QUICKCONTROLS_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv3 LICE
 endif
 
 define QT5QUICKCONTROLS_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk b/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk
index b7e28330a3..c09fdb1aeb 100644
--- a/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk
+++ b/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk
@@ -14,6 +14,7 @@ QT5QUICKCONTROLS2_LICENSE = GPL-3.0 or LGPL-3.0, GFDL-1.3 (docs)
 QT5QUICKCONTROLS2_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv3 LICENSE.FDL
 
 define QT5QUICKCONTROLS2_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5script/qt5script.mk b/package/qt5/qt5script/qt5script.mk
index 698fa75a9f..58f24bdb7b 100644
--- a/package/qt5/qt5script/qt5script.mk
+++ b/package/qt5/qt5script/qt5script.mk
@@ -28,6 +28,7 @@ QT5SCRIPT_LICENSE_FILES += \
 	src/3rdparty/javascriptcore/JavaScriptCore/pcre/COPYING
 
 define QT5SCRIPT_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5scxml/qt5scxml.mk b/package/qt5/qt5scxml/qt5scxml.mk
index 6f8b85972e..eb2d8857d2 100644
--- a/package/qt5/qt5scxml/qt5scxml.mk
+++ b/package/qt5/qt5scxml/qt5scxml.mk
@@ -17,6 +17,7 @@ QT5SCXML_LICENSE := $(QT5SCXML_LICENSE), BSD-3-Clause (examples)
 endif
 
 define QT5SCXML_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5sensors/qt5sensors.mk b/package/qt5/qt5sensors/qt5sensors.mk
index 0dd499211d..1f5af1f78f 100644
--- a/package/qt5/qt5sensors/qt5sensors.mk
+++ b/package/qt5/qt5sensors/qt5sensors.mk
@@ -23,6 +23,7 @@ QT5SENSORS_DEPENDENCIES += qt5declarative
 endif
 
 define QT5SENSORS_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5serialbus/qt5serialbus.mk b/package/qt5/qt5serialbus/qt5serialbus.mk
index 7e972e2b47..f3d86cc180 100644
--- a/package/qt5/qt5serialbus/qt5serialbus.mk
+++ b/package/qt5/qt5serialbus/qt5serialbus.mk
@@ -14,6 +14,7 @@ QT5SERIALBUS_LICENSE = GPL-2.0 or GPL-3.0 or LGPL-3.0, GFDL-1.3 (docs)
 QT5SERIALBUS_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv3 LICENSE.FDL
 
 define QT5SERIALBUS_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5serialport/qt5serialport.mk b/package/qt5/qt5serialport/qt5serialport.mk
index b6cfbbefbf..e85b8cca86 100644
--- a/package/qt5/qt5serialport/qt5serialport.mk
+++ b/package/qt5/qt5serialport/qt5serialport.mk
@@ -19,6 +19,7 @@ QT5SERIALPORT_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_E
 endif
 
 define QT5SERIALPORT_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5svg/qt5svg.mk b/package/qt5/qt5svg/qt5svg.mk
index e9250179dc..3829b33ce7 100644
--- a/package/qt5/qt5svg/qt5svg.mk
+++ b/package/qt5/qt5svg/qt5svg.mk
@@ -19,6 +19,7 @@ QT5SVG_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.
 endif
 
 define QT5SVG_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5tools/qt5tools.mk b/package/qt5/qt5tools/qt5tools.mk
index 64b4620143..aa20353c82 100644
--- a/package/qt5/qt5tools/qt5tools.mk
+++ b/package/qt5/qt5tools/qt5tools.mk
@@ -49,6 +49,7 @@ QT5TOOLS_BUILD_DIRS_$(BR2_PACKAGE_QT5TOOLS_QTPLUGININFO) += qtplugininfo
 QT5TOOLS_INSTALL_TARGET_$(BR2_PACKAGE_QT5TOOLS_QTPLUGININFO) += qtplugininfo
 
 define QT5TOOLS_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk b/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk
index 0970a90d4a..409308b74e 100644
--- a/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk
+++ b/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk
@@ -55,6 +55,7 @@ QT5VIRTUALKEYBOARD_QMAKEFLAGS += CONFIG+=arrow-key-navigation
 endif
 
 define QT5VIRTUALKEYBOARD_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE) $(QT5VIRTUALKEYBOARD_QMAKEFLAGS))
 endef
 
diff --git a/package/qt5/qt5wayland/qt5wayland.mk b/package/qt5/qt5wayland/qt5wayland.mk
index 854b28c481..a79e649375 100644
--- a/package/qt5/qt5wayland/qt5wayland.mk
+++ b/package/qt5/qt5wayland/qt5wayland.mk
@@ -31,6 +31,7 @@ QT5WAYLAND_QMAKEFLAGS += CONFIG+=wayland-compositor
 endif
 
 define QT5WAYLAND_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE) $(QT5WAYLAND_QMAKEFLAGS))
 endef
 
diff --git a/package/qt5/qt5webchannel/qt5webchannel.mk b/package/qt5/qt5webchannel/qt5webchannel.mk
index 9abd9a20a5..4ca74db4ff 100644
--- a/package/qt5/qt5webchannel/qt5webchannel.mk
+++ b/package/qt5/qt5webchannel/qt5webchannel.mk
@@ -26,6 +26,7 @@ QT5WEBCHANNEL_DEPENDENCIES += qt5declarative
 endif
 
 define QT5WEBCHANNEL_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5webengine/qt5webengine.mk b/package/qt5/qt5webengine/qt5webengine.mk
index a50f3dae61..0aa4120bf2 100644
--- a/package/qt5/qt5webengine/qt5webengine.mk
+++ b/package/qt5/qt5webengine/qt5webengine.mk
@@ -64,6 +64,7 @@ QT5WEBENGINE_ENV += GN_PKG_CONFIG_HOST=$(@D)/host-bin/host-pkg-config
 endif
 
 define QT5WEBENGINE_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5WEBENGINE_ENV) $(QT5_QMAKE) $(QT5WEBENGINE_QMAKEFLAGS))
 endef
 
diff --git a/package/qt5/qt5webkit-examples/qt5webkit-examples.mk b/package/qt5/qt5webkit-examples/qt5webkit-examples.mk
index 37e7f28657..146595a1dc 100644
--- a/package/qt5/qt5webkit-examples/qt5webkit-examples.mk
+++ b/package/qt5/qt5webkit-examples/qt5webkit-examples.mk
@@ -27,6 +27,7 @@ QT5WEBKIT_EXAMPLES_DEPENDENCIES += qt5xmlpatterns
 endif
 
 define QT5WEBKIT_EXAMPLES_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5webkit/qt5webkit.mk b/package/qt5/qt5webkit/qt5webkit.mk
index 735aa9f0df..08f3d24496 100644
--- a/package/qt5/qt5webkit/qt5webkit.mk
+++ b/package/qt5/qt5webkit/qt5webkit.mk
@@ -45,6 +45,7 @@ endef
 QT5WEBKIT_PRE_CONFIGURE_HOOKS += QT5WEBKIT_PYTHON2_SYMLINK
 
 define QT5WEBKIT_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5WEBKIT_ENV) $(QT5_QMAKE) WEBKIT_CONFIG+=use_system_leveldb)
 endef
 
diff --git a/package/qt5/qt5websockets/qt5websockets.mk b/package/qt5/qt5websockets/qt5websockets.mk
index d418d7c05c..7173742e25 100644
--- a/package/qt5/qt5websockets/qt5websockets.mk
+++ b/package/qt5/qt5websockets/qt5websockets.mk
@@ -26,6 +26,7 @@ QT5WEBSOCKETS_DEPENDENCIES += qt5declarative
 endif
 
 define QT5WEBSOCKETS_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5x11extras/qt5x11extras.mk b/package/qt5/qt5x11extras/qt5x11extras.mk
index 62ae68a29a..20b1f70816 100644
--- a/package/qt5/qt5x11extras/qt5x11extras.mk
+++ b/package/qt5/qt5x11extras/qt5x11extras.mk
@@ -19,6 +19,7 @@ QT5X11EXTRAS_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EX
 endif
 
 define QT5X11EXTRAS_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk b/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
index 0677d8a72f..cecf3244ad 100644
--- a/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
+++ b/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
@@ -22,6 +22,7 @@ QT5XMLPATTERNS_LICENSE := $(QT5XMLPATTERNS_LICENSE), BSD-3-Clause (examples)
 endif
 
 define QT5XMLPATTERNS_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
diff --git a/package/qt5cinex/qt5cinex.mk b/package/qt5cinex/qt5cinex.mk
index ea8fbb7651..75b1b41665 100644
--- a/package/qt5cinex/qt5cinex.mk
+++ b/package/qt5cinex/qt5cinex.mk
@@ -18,6 +18,7 @@ QT5CINEX_LICENSE = CC-BY-3.0
 QT5CINEX_LICENSE_FILES = README
 
 define QT5CINEX_CONFIGURE_CMDS
+	$(QT5_QTCONF_FIXUP)
 	cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE)
 endef
 
diff --git a/package/qwt/qwt.mk b/package/qwt/qwt.mk
index f381ebbb7a..985de13d3d 100644
--- a/package/qwt/qwt.mk
+++ b/package/qwt/qwt.mk
@@ -43,6 +43,7 @@ endif
 
 define QWT_CONFIGURE_CMDS
 	$(SED) $(QWT_CONFIG) $(@D)/qwtconfig.pri
+	$(QT5_QTCONF_FIXUP)
 	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 13/13] qt5: Fix pkgconfig search path for per-package infrastructure
  2019-03-14  9:40 [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Andreas Naumann
                   ` (11 preceding siblings ...)
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 12/13] qt5: Prepare qmake for per-package infrastructure Andreas Naumann
@ 2019-03-14  9:40 ` Andreas Naumann
  2019-03-14 11:03 ` [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Arnout Vandecappelle
  13 siblings, 0 replies; 23+ messages in thread
From: Andreas Naumann @ 2019-03-14  9:40 UTC (permalink / raw)
  To: buildroot

Per default qmake uses the pkg-config binary and search path detected by qt5base
and set in mkspecs/qconfig.pri. For per-package infra, this leads to packages
not contained in qt5base not being detected.
To overcome this, set the correct pathes in the global QMAKE variable.

Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
 package/qt5/qt5.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/qt5/qt5.mk b/package/qt5/qt5.mk
index 15ca188c8c..15a98ce4ab 100644
--- a/package/qt5/qt5.mk
+++ b/package/qt5/qt5.mk
@@ -33,4 +33,6 @@ define QT5_QTCONF_FIXUP
 endef
 
 # Variable for other Qt applications to use
-QT5_QMAKE = $(HOST_DIR)/bin/qmake -spec devices/linux-buildroot-g++ -qtconf $(@D)/qt.conf
+QT5_QMAKE = $(HOST_DIR)/bin/qmake -spec devices/linux-buildroot-g++ -qtconf $(@D)/qt.conf \
+	PKG_CONFIG_SYSROOT_DIR=$(STAGING_DIR) \
+	PKG_CONFIG_LIBDIR=$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/usr/share/pkgconfig
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 01/13] qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 01/13] qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen Andreas Naumann
@ 2019-03-14 10:07   ` Thomas Petazzoni
  0 siblings, 0 replies; 23+ messages in thread
From: Thomas Petazzoni @ 2019-03-14 10:07 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 14 Mar 2019 10:40:12 +0100
Andreas Naumann <anaumann@ultratronik.de> wrote:

> Traditionlly we configured qt5 to always build shared libraries. This resulted

Typo: traditionally

> in many conditionals when setting buildroot to static-libs only, because each
> module's target install had to be guarded.
> So to avoid this and simplify target install in a subsequent commit, configure
> qt to build (and install) only the type of libs which the buildroot defconfig
> is set to.
> Unfortunately it seems that Qt does not support building both dynamic and static
> libs at the same time, so we still set it shared if buildroot asks for both.
> 
> Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
> ---
>  package/qt5/qt5base/qt5base.mk | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
> index e7f6e658f1..a0492418be 100644
> --- a/package/qt5/qt5base/qt5base.mk
> +++ b/package/qt5/qt5base/qt5base.mk
> @@ -24,8 +24,15 @@ QT5BASE_CONFIGURE_OPTS += \
>  	-no-iconv \
>  	-system-zlib \
>  	-system-pcre \
> -	-no-pch \
> -	-shared
> +	-no-pch
> +
> +ifeq ($(BR2_SHARED_LIBS),y)
> +QT5BASE_CONFIGURE_OPTS += -shared -no-static
> +else ifeq ($(BR2_STATIC_LIBS),y)
> +QT5BASE_CONFIGURE_OPTS += -no-shared -static
> +else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
> +QT5BASE_CONFIGURE_OPTS += -shared

Is there any difference between "-shared -no-static" and just
"-shared" ?

IOW, if Qt doesn't support building both shared and static, then we
should probably do:

ifeq ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
QT5BASE_CONFIGURE_OPTS += -shared -no-static
else
QT5BASE_CONFIGURE_OPTS += -no-shared -static
endif

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 02/13] qt5: Convert to generic target install command
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 02/13] qt5: Convert to generic target install command Andreas Naumann
@ 2019-03-14 10:13   ` Thomas Petazzoni
  2019-03-14 11:01     ` Arnout Vandecappelle
  0 siblings, 1 reply; 23+ messages in thread
From: Thomas Petazzoni @ 2019-03-14 10:13 UTC (permalink / raw)
  To: buildroot

Hello Andreas,

On Thu, 14 Mar 2019 10:40:13 +0100
Andreas Naumann <anaumann@ultratronik.de> wrote:

> This converts the numerous and complex target install steps of almost all Qt5
> related packages to a single rsync call with a pre-filtered list of files from
> the packages staging to the target path.
> The list is created from files in which were created, or have changed, in staging
> after the .stamp_built was made. In order to avoid useless files in target, all
> *.prl, *.la files and the folders /usr/include and /usr/lib/cmake and /usr/doc
> are ignored.

One issue with this approach is that if you do a complete build, and
then do "make qt5base-reinstall", then the date of the .stamp_built
file of qt5base has not changed, and will be older than the one of all
other packages that have been built after qt5base. Therefore, the rsync
that you do will copy again not only the files from qt5base, but also
the ones from all other packages that have been built after qt5base.

I'm really not sure this is what we want to do, we will most likely end
up in TARGET_DIR with a bunch of files we didn't want to see there.

I continue to believe we want to find a solution where "make
INSTALL_ROOT=$(TARGET_DIR) install" and "make
INSTALL_ROOT=$(STAGING_DIR) install" works properly.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 02/13] qt5: Convert to generic target install command
  2019-03-14 10:13   ` Thomas Petazzoni
@ 2019-03-14 11:01     ` Arnout Vandecappelle
  2019-03-14 11:06       ` Thomas Petazzoni
  0 siblings, 1 reply; 23+ messages in thread
From: Arnout Vandecappelle @ 2019-03-14 11:01 UTC (permalink / raw)
  To: buildroot



On 14/03/2019 11:13, Thomas Petazzoni wrote:
> Hello Andreas,
> 
> On Thu, 14 Mar 2019 10:40:13 +0100
> Andreas Naumann <anaumann@ultratronik.de> wrote:
> 
>> This converts the numerous and complex target install steps of almost all Qt5
>> related packages to a single rsync call with a pre-filtered list of files from
>> the packages staging to the target path.
>> The list is created from files in which were created, or have changed, in staging
>> after the .stamp_built was made. In order to avoid useless files in target, all
>> *.prl, *.la files and the folders /usr/include and /usr/lib/cmake and /usr/doc
>> are ignored.
> 
> One issue with this approach is that if you do a complete build, and
> then do "make qt5base-reinstall", then the date of the .stamp_built
> file of qt5base has not changed, and will be older than the one of all
> other packages that have been built after qt5base. Therefore, the rsync
> that you do will copy again not only the files from qt5base, but also
> the ones from all other packages that have been built after qt5base.

 I agree that this is a problem.

 But I think it can be easily solved by using the pkg-file-list instead of find.
Since we already have a dependency of target on staging, we know that the
pkg-file-list is up-to-date.


> I'm really not sure this is what we want to do, we will most likely end
> up in TARGET_DIR with a bunch of files we didn't want to see there.
> 
> I continue to believe we want to find a solution where "make
> INSTALL_ROOT=$(TARGET_DIR) install" and "make
> INSTALL_ROOT=$(STAGING_DIR) install" works properly.

 I disagree. I think the pattern of installing to staging and then copying to
target is a good pattern.

 Regards,
 Arnout

> 
> Best regards,
> 
> Thomas
> 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install
  2019-03-14  9:40 [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Andreas Naumann
                   ` (12 preceding siblings ...)
  2019-03-14  9:40 ` [Buildroot] [PATCH v2 13/13] qt5: Fix pkgconfig search path " Andreas Naumann
@ 2019-03-14 11:03 ` Arnout Vandecappelle
  13 siblings, 0 replies; 23+ messages in thread
From: Arnout Vandecappelle @ 2019-03-14 11:03 UTC (permalink / raw)
  To: buildroot



On 14/03/2019 10:40, Andreas Naumann wrote:
> - I have tested with Qt5.12.1 only. Qt5.6 should but might not always do the right
>   thing. However I think it was decided to remove support for 5.6 anyway.?

 The plan was to remove 5.6 after it has gone EOL, which is supposed to be in
March 2019 (3 years after the initial release in March 2016). So, the plan was
to still update to 5.6.4, include that in Buildroot 2019.05 and 2019.02.x, and
remove it after 2019.05.

 However, on the release wiki [1] I now see

Phase 	Original plan 	Updated plan 	Realized
5.6.4 	Not yet defined 		Won't be done at all

so maybe we can expedite the removal.

 Regards,
 Arnout

[1] https://wiki.qt.io/Qt_5.6_Release

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 02/13] qt5: Convert to generic target install command
  2019-03-14 11:01     ` Arnout Vandecappelle
@ 2019-03-14 11:06       ` Thomas Petazzoni
  2019-03-14 11:20         ` Arnout Vandecappelle
  0 siblings, 1 reply; 23+ messages in thread
From: Thomas Petazzoni @ 2019-03-14 11:06 UTC (permalink / raw)
  To: buildroot

On Thu, 14 Mar 2019 12:01:16 +0100
Arnout Vandecappelle <arnout@mind.be> wrote:

> > One issue with this approach is that if you do a complete build, and
> > then do "make qt5base-reinstall", then the date of the .stamp_built
> > file of qt5base has not changed, and will be older than the one of all
> > other packages that have been built after qt5base. Therefore, the rsync
> > that you do will copy again not only the files from qt5base, but also
> > the ones from all other packages that have been built after qt5base.  
> 
>  I agree that this is a problem.
> 
>  But I think it can be easily solved by using the pkg-file-list instead of find.
> Since we already have a dependency of target on staging, we know that the
> pkg-file-list is up-to-date.

True.

> > I continue to believe we want to find a solution where "make
> > INSTALL_ROOT=$(TARGET_DIR) install" and "make
> > INSTALL_ROOT=$(STAGING_DIR) install" works properly.  
> 
>  I disagree. I think the pattern of installing to staging and then copying to
> target is a good pattern.

We basically don't use this pattern anywhere. I would agree with the
general direction of killing the staging vs. target difference, and
simply produce "target" out of "staging" at the very end of the build,
but that's a huge undertaking.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 02/13] qt5: Convert to generic target install command
  2019-03-14 11:06       ` Thomas Petazzoni
@ 2019-03-14 11:20         ` Arnout Vandecappelle
  2019-03-14 13:30           ` Thomas Petazzoni
  2019-03-14 13:35           ` Andreas Naumann
  0 siblings, 2 replies; 23+ messages in thread
From: Arnout Vandecappelle @ 2019-03-14 11:20 UTC (permalink / raw)
  To: buildroot



On 14/03/2019 12:06, Thomas Petazzoni wrote:
> On Thu, 14 Mar 2019 12:01:16 +0100
> Arnout Vandecappelle <arnout@mind.be> wrote:
> 
>>> One issue with this approach is that if you do a complete build, and
>>> then do "make qt5base-reinstall", then the date of the .stamp_built
>>> file of qt5base has not changed, and will be older than the one of all
>>> other packages that have been built after qt5base. Therefore, the rsync
>>> that you do will copy again not only the files from qt5base, but also
>>> the ones from all other packages that have been built after qt5base.  
>>
>>  I agree that this is a problem.
>>
>>  But I think it can be easily solved by using the pkg-file-list instead of find.
>> Since we already have a dependency of target on staging, we know that the
>> pkg-file-list is up-to-date.
> 
> True.
> 
>>> I continue to believe we want to find a solution where "make
>>> INSTALL_ROOT=$(TARGET_DIR) install" and "make
>>> INSTALL_ROOT=$(STAGING_DIR) install" works properly.  
>>
>>  I disagree. I think the pattern of installing to staging and then copying to
>> target is a good pattern.
> 
> We basically don't use this pattern anywhere.

 A quick grep gives me alsa-utils, dmalloc, libfuse, liblockfile, qt5*. So it is
rare, but "don't use it anywhere" is an overstatement.

> I would agree with the
> general direction of killing the staging vs. target difference, and
> simply produce "target" out of "staging" at the very end of the build,
> but that's a huge undertaking.

 So my point is: using this pattern for a few packages is a good step in that
direction, because it teaches us something about the implications.

 Regards,
 Arnout

> 
> Best regards,
> 
> Thomas
> 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 02/13] qt5: Convert to generic target install command
  2019-03-14 11:20         ` Arnout Vandecappelle
@ 2019-03-14 13:30           ` Thomas Petazzoni
  2019-03-14 13:35           ` Andreas Naumann
  1 sibling, 0 replies; 23+ messages in thread
From: Thomas Petazzoni @ 2019-03-14 13:30 UTC (permalink / raw)
  To: buildroot

On Thu, 14 Mar 2019 12:20:14 +0100
Arnout Vandecappelle <arnout@mind.be> wrote:

> >>  I disagree. I think the pattern of installing to staging and then copying to
> >> target is a good pattern.  
> > 
> > We basically don't use this pattern anywhere.  
> 
>  A quick grep gives me alsa-utils, dmalloc, libfuse, liblockfile, qt5*. So it is
> rare, but "don't use it anywhere" is an overstatement.

These are totally different: they copy an explicit list of files from
staging to target as their target installation logic. This is very
different from the more "systematic" approach of using files newer
than .stamp_built or using package-file-lists.txt that Andreas is
proposing.

So, I maintain that we don't use anywhere the pattern proposed by
Andreas at the moment, it is not an overstatement :-)

> > I would agree with the
> > general direction of killing the staging vs. target difference, and
> > simply produce "target" out of "staging" at the very end of the build,
> > but that's a huge undertaking.  
> 
>  So my point is: using this pattern for a few packages is a good step in that
> direction, because it teaches us something about the implications.

That is a very valid argument, indeed.

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 02/13] qt5: Convert to generic target install command
  2019-03-14 11:20         ` Arnout Vandecappelle
  2019-03-14 13:30           ` Thomas Petazzoni
@ 2019-03-14 13:35           ` Andreas Naumann
  2019-03-14 13:49             ` Thomas Petazzoni
  1 sibling, 1 reply; 23+ messages in thread
From: Andreas Naumann @ 2019-03-14 13:35 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

Am 14.03.19 um 12:20 schrieb Arnout Vandecappelle:
> 
> 
> On 14/03/2019 12:06, Thomas Petazzoni wrote:
>> On Thu, 14 Mar 2019 12:01:16 +0100 Arnout Vandecappelle 
>> <arnout@mind.be> wrote:
>> 
>>>> One issue with this approach is that if you do a complete 
>>>> build, and then do "make qt5base-reinstall", then the date of 
>>>> the .stamp_built file of qt5base has not changed, and will be 
>>>> older than the one of all other packages that have been built 
>>>> after qt5base. Therefore, the rsync that you do will copy again
>>>> not only the files from qt5base, but also the ones from all
>>>> other packages that have been built after qt5base.
>>> 
>>> I agree that this is a problem.

Ok, I oversaw this because I was focused on ppsh, where it is much less
of a problem. It still is because the various la/prl fixups do touch the
hardlinked files in other packages staging area. But this would have to
be fixed anyway to avoid race conditions when compiling packages in
parallel.

However, the issue should be solved if another file than .stamp_built is
touched at the beginning of staging and its timestamp is then used as
reference. After all -reinstall runs both staging and target installs.

>>> 
>>> But I think it can be easily solved by using the pkg-file-list 
>>> instead of find. Since we already have a dependency of target on
>>>  staging, we know that the pkg-file-list is up-to-date.>>
>> True.

True, pkg-file-list is another implementation trying to do the same
thing: identify which files were copied/created. However, it is
currently broken for parallel builds.
I submitted a patch a few weeks ago, but its not be perfect yet and Yann 
had some objections.

>> 
>>>> I continue to believe we want to find a solution where "make 
>>>> INSTALL_ROOT=$(TARGET_DIR) install" and "make 
>>>> INSTALL_ROOT=$(STAGING_DIR) install" works properly.

After my original post, I tried very hard to tweak qt.conf to help us
here without the need for patching the generated Makefiles. First it
looked promising but unfortunately it seem that it's not possible to
install into a temporary sysroot because it automoatically is used to
pull -I includes from.

>>> 
>>> I disagree. I think the pattern of installing to staging and then
>>> copying to target is a good pattern.

I only started going into this direction after Yann pointed out that
this might be a longterm goal.

>> 
>> We basically don't use this pattern anywhere.
> 
> A quick grep gives me alsa-utils, dmalloc, libfuse, liblockfile, 
> qt5*. So it is rare, but "don't use it anywhere" is an 
> overstatement.
> 
>> I would agree with the general direction of killing the staging vs.
>> target difference, and simply produce "target" out of "staging" at
>> the very end of the build, but that's a huge undertaking.
> 
> So my point is: using this pattern for a few packages is a good step
>  in that direction, because it teaches us something about the 
> implications.

My personal impression is, that it might be less "huge" after having 
converted to per-package staging.


best regards,
Andreas



> 
> Regards, Arnout
> 
>> 
>> Best regards,
>> 
>> Thomas
>> 
> 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v2 02/13] qt5: Convert to generic target install command
  2019-03-14 13:35           ` Andreas Naumann
@ 2019-03-14 13:49             ` Thomas Petazzoni
  0 siblings, 0 replies; 23+ messages in thread
From: Thomas Petazzoni @ 2019-03-14 13:49 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 14 Mar 2019 14:35:39 +0100
Andreas Naumann <dev@andin.de> wrote:

> Ok, I oversaw this because I was focused on ppsh, where it is much less
> of a problem.

Indeed.

> After my original post, I tried very hard to tweak qt.conf to help us
> here without the need for patching the generated Makefiles. First it
> looked promising but unfortunately it seem that it's not possible to
> install into a temporary sysroot because it automoatically is used to
> pull -I includes from.

Yeah, I also tried quite hard to make the installation with
INSTALL_ROOT work properly, but couldn't find a good solution.

> > So my point is: using this pattern for a few packages is a good step
> >  in that direction, because it teaches us something about the 
> > implications.  
> 
> My personal impression is, that it might be less "huge" after having 
> converted to per-package staging.

The thing is that per-package directories is going to remain optional
for a bit of time. It is a fairly radical change, probably going to
break a bunch of things. So we'll have to live with the two
possibilities (per-package disabled, per-package enabled) for at least
a few release I believe.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2019-03-14 13:49 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-14  9:40 [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Andreas Naumann
2019-03-14  9:40 ` [Buildroot] [PATCH v2 01/13] qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen Andreas Naumann
2019-03-14 10:07   ` Thomas Petazzoni
2019-03-14  9:40 ` [Buildroot] [PATCH v2 02/13] qt5: Convert to generic target install command Andreas Naumann
2019-03-14 10:13   ` Thomas Petazzoni
2019-03-14 11:01     ` Arnout Vandecappelle
2019-03-14 11:06       ` Thomas Petazzoni
2019-03-14 11:20         ` Arnout Vandecappelle
2019-03-14 13:30           ` Thomas Petazzoni
2019-03-14 13:35           ` Andreas Naumann
2019-03-14 13:49             ` Thomas Petazzoni
2019-03-14  9:40 ` [Buildroot] [PATCH v2 03/13] qt5base: Fix inconsistencies when overriding qmake properties Andreas Naumann
2019-03-14  9:40 ` [Buildroot] [PATCH v2 04/13] qt5: Remove *.la/*.prl fixup script Andreas Naumann
2019-03-14  9:40 ` [Buildroot] [PATCH v2 05/13] qt5: Use qmake via QT5_QMAKE variable Andreas Naumann
2019-03-14  9:40 ` [Buildroot] [PATCH v2 06/13] core: implement per-package SDK and target Andreas Naumann
2019-03-14  9:40 ` [Buildroot] [PATCH v2 07/13] Makefile: allow top-level parallel build with BR2_PER_PACKAGE_DIRECTORIES=y Andreas Naumann
2019-03-14  9:40 ` [Buildroot] [PATCH v2 08/13] package/pkg-generic: make libtool .la files compatible with per-package directories Andreas Naumann
2019-03-14  9:40 ` [Buildroot] [PATCH v2 09/13] package/pkg-kconfig: handle KCONFIG_DEPENDENCIES " Andreas Naumann
2019-03-14  9:40 ` [Buildroot] [PATCH v2 10/13] docs/manual: add details about top-level parallel build support Andreas Naumann
2019-03-14  9:40 ` [Buildroot] [PATCH v2 11/13] docs/manual: document the effect of per-package directory on variables Andreas Naumann
2019-03-14  9:40 ` [Buildroot] [PATCH v2 12/13] qt5: Prepare qmake for per-package infrastructure Andreas Naumann
2019-03-14  9:40 ` [Buildroot] [PATCH v2 13/13] qt5: Fix pkgconfig search path " Andreas Naumann
2019-03-14 11:03 ` [Buildroot] [PATCH v2 00/13] ppsh compatible Qt5 / generic qmake target install Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.