All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4 0/6] Qt5 qmake infra with generic target install
@ 2019-03-22 18:38 Andreas Naumann
  2019-03-22 18:38 ` [Buildroot] [PATCH v4 1/6] qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen Andreas Naumann
                   ` (6 more replies)
  0 siblings, 7 replies; 33+ messages in thread
From: Andreas Naumann @ 2019-03-22 18:38 UTC (permalink / raw)
  To: buildroot

Hi all,

here is the fourth iteration of my efforts to prepare Qt5 packages for ppsh.

Originally I had prepared v3 with a fix for the reinstall issue found by Thomas,
which included conversion to a new qmake infra as suggested by Arnout.

However, having done that I had the idea to use a folder inside the package 
build dir as INSTALL_ROOT, which makes it possible to to isolate the staging
files and copy them to target without relying on timestamps. So I ditched v3
and carried on doing that as v4. (If somebody is interested in v3 I can still
 send it.)

This avoids the controversial discussed "install to staging only" approach,
for which I'm not sure if it actually has enough advantages to be worth the
hassle of dealing with timestamps and such.


regards,
Andreas



v3 -> v4:
  - changed time-stamp based target install to using INSTALL_ROOT
  - exclude ppsh specific patches

v2 -> v3 (not published):
  - convert to qmake infra
  - use a custom .stamp_staging_started to fix the -reinstall issue

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


Andreas Naumann (6):
  qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen
  qt5: Provide generic qmake package infrastructure
  qt5: Convert packages to qmake infra
  quazip: Patch .pro file to correctly crosscompile and use qmake infra
  qt5base: Fix inconsistencies when overriding qmake properties
  qt5: Remove *.la/*.prl fixup script

 package/Makefile.in                           |   1 +
 package/pkg-qmake.mk                          | 108 ++++++++++++++++++
 package/qextserialport/qextserialport.mk      |  22 +---
 package/qt-webkit-kiosk/qt-webkit-kiosk.mk    |  11 +-
 package/qt5/qt53d/qt53d.mk                    |  39 +------
 package/qt5/qt5base/qt.conf.in                |  17 +--
 package/qt5/qt5base/qt5base.mk                |  88 ++------------
 package/qt5/qt5canvas3d/qt5canvas3d.mk        |  26 +----
 package/qt5/qt5charts/qt5charts.mk            |  41 +------
 .../qt5/qt5connectivity/qt5connectivity.mk    |  60 +---------
 package/qt5/qt5declarative/qt5declarative.mk  |  48 +-------
 package/qt5/qt5enginio/qt5enginio.mk          |  39 +------
 .../qt5graphicaleffects.mk                    |  18 +--
 .../qt5/qt5imageformats/qt5imageformats.mk    |  20 +---
 package/qt5/qt5location/qt5location.mk        |  50 +-------
 package/qt5/qt5multimedia/qt5multimedia.mk    |  47 +-------
 .../qt5/qt5quickcontrols/qt5quickcontrols.mk  |  41 +------
 .../qt5quickcontrols2/qt5quickcontrols2.mk    |  40 +------
 package/qt5/qt5script/qt5script.mk            |  32 +-----
 package/qt5/qt5scxml/qt5scxml.mk              |  37 +-----
 package/qt5/qt5sensors/qt5sensors.mk          |  40 +------
 package/qt5/qt5serialbus/qt5serialbus.mk      |  38 +-----
 package/qt5/qt5serialport/qt5serialport.mk    |  32 +-----
 package/qt5/qt5svg/qt5svg.mk                  |  40 +------
 package/qt5/qt5tools/qt5tools.mk              |   6 +-
 .../qt5virtualkeyboard/qt5virtualkeyboard.mk  |  63 +---------
 package/qt5/qt5wayland/qt5wayland.mk          |  43 +------
 package/qt5/qt5webchannel/qt5webchannel.mk    |  40 +------
 package/qt5/qt5webengine/qt5webengine.mk      |  50 +-------
 .../qt5webkit-examples/qt5webkit-examples.mk  |  23 +---
 package/qt5/qt5webkit/qt5webkit.mk            |  30 ++---
 package/qt5/qt5websockets/qt5websockets.mk    |  40 +------
 package/qt5/qt5x11extras/qt5x11extras.mk      |  21 +---
 package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk  |  32 +-----
 package/qt5cinex/qt5cinex.mk                  |   9 +-
 ...001-Fix-crosscompile-staging-install.patch |  16 +++
 package/quazip/quazip.mk                      |  18 +--
 package/qwt/qwt.mk                            |   9 +-
 38 files changed, 190 insertions(+), 1145 deletions(-)
 create mode 100644 package/pkg-qmake.mk
 create mode 100644 package/quazip/0001-Fix-crosscompile-staging-install.patch

-- 
2.21.0

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

* [Buildroot] [PATCH v4 1/6] qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen
  2019-03-22 18:38 [Buildroot] [PATCH v4 0/6] Qt5 qmake infra with generic target install Andreas Naumann
@ 2019-03-22 18:38 ` Andreas Naumann
  2019-03-25 22:13   ` Arnout Vandecappelle
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 2/6] qt5: Provide generic qmake package infrastructure Andreas Naumann
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 33+ messages in thread
From: Andreas Naumann @ 2019-03-22 18:38 UTC (permalink / raw)
  To: buildroot

Traditionally 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 | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

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

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

* [Buildroot] [PATCH v4 2/6] qt5: Provide generic qmake package infrastructure
  2019-03-22 18:38 [Buildroot] [PATCH v4 0/6] Qt5 qmake infra with generic target install Andreas Naumann
  2019-03-22 18:38 ` [Buildroot] [PATCH v4 1/6] qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen Andreas Naumann
@ 2019-03-22 18:39 ` Andreas Naumann
  2019-03-25 23:16   ` Arnout Vandecappelle
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 3/6] qt5: Convert packages to qmake infra Andreas Naumann
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 33+ messages in thread
From: Andreas Naumann @ 2019-03-22 18:39 UTC (permalink / raw)
  To: buildroot

This provides generic functions for Qt5 qmake based packages. Besides
being able to remove lots of redundant commands, it should make it possible to
eliminate the numerous and complex target install steps.
This is done by re-running the install step of the qmake generated Makefile
with the package build directory prepended (to the staging/host path). Even
though this does create lengthy pathes it allows for easy separation of the
staging files from the host destined files by just omitting the resulting
BUILD_DIR+HOST_DIR path from the following rsync call to the real target folder.
In addition, rsync excludes all header-, documentation- and cmake-pathes as well
as libtool and prl files in order to avoid unnecessary files accumulating in
target.

Getting rid of the many conditional install commands is possible because qmake
already takes care of this when generating the Makefile install targets with the
given or autodetected configure options of each package.

However, custom install steps may have to remain in cases where a particular
buildroot option has no corresponding setting in the packages configuration
options.

Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
 package/Makefile.in  |   1 +
 package/pkg-qmake.mk | 109 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 110 insertions(+)
 create mode 100644 package/pkg-qmake.mk

diff --git a/package/Makefile.in b/package/Makefile.in
index dc818a2c18..fb0e22114c 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -442,3 +442,4 @@ include package/pkg-kernel-module.mk
 include package/pkg-waf.mk
 include package/pkg-golang.mk
 include package/pkg-meson.mk
+include package/pkg-qmake.mk
diff --git a/package/pkg-qmake.mk b/package/pkg-qmake.mk
new file mode 100644
index 0000000000..11cfb809fc
--- /dev/null
+++ b/package/pkg-qmake.mk
@@ -0,0 +1,109 @@
+################################################################################
+# QMAKE package infrastructure
+#
+# This file implements an infrastructure that eases development of package
+# .mk files for QMAKE packages. It should be used for all packages that use
+# QMAKE as their build system.
+#
+# See the Buildroot documentation for details on the usage of this
+# infrastructure
+#
+# In terms of implementation, this QMAKE infrastructure requires the .mk file
+# to only specify metadata information about the package: name, version,
+# download URL, etc.
+#
+# We still allow the package .mk file to override what the different steps
+# are doing, if needed. For example, if <PKG>_BUILD_CMDS is already defined,
+# it is used as the list of commands to perform to build the package,
+# instead of the default QMAKE behaviour. The package can also define some
+# post operation hooks.
+#
+################################################################################
+
+################################################################################
+# inner-qmake-package -- defines how the configuration, compilation and
+# installation of a qmake package should be done, implements a few hooks
+# to tune the build process for qmake specifities and calls the generic
+# package infrastructure to generate the necessary make targets
+#
+#  argument 1 is the lowercase package name
+#  argument 2 is the uppercase package name, including a HOST_ prefix
+#             for host packages
+#  argument 3 is the uppercase package name, without the HOST_ prefix
+#             for host packages
+#  argument 4 is the type (target or host)
+################################################################################
+
+define inner-qmake-package
+
+$(2)_CONF_ENV			?=
+$(2)_CONF_OPTS			?=
+$(2)_MAKE_ENV			?=
+$(2)_MAKE_OPTS			?=
+$(2)_INSTALL_STAGING_OPTS	?= install
+
+#
+# Configure step. Only define it if not already defined by the package
+# .mk file.
+#
+ifndef $(2)_CONFIGURE_CMDS
+define $(2)_CONFIGURE_CMDS
+	cd $$($$(PKG)_SRCDIR) && \
+	$$(TARGET_MAKE_ENV) \
+	$$($(2)_CONF_ENV) \
+	$$(HOST_DIR)/bin/qmake -spec devices/linux-buildroot-g++ \
+		$$($(2)_CONF_OPTS)
+endef
+endif
+
+#
+# Build step. Only define it if not already defined by the package .mk
+# file.
+#
+ifndef $(2)_BUILD_CMDS
+define $(2)_BUILD_CMDS
+	$$(TARGET_MAKE_ENV) \
+	$$($(2)_MAKE_ENV) \
+	$$(MAKE) -C $$($$(PKG)_SRCDIR) $$($(2)_MAKE_OPTS)
+endef
+endif
+
+#
+# Staging installation step. Only define it if not already defined by
+# the package .mk file.
+#
+ifndef $(2)_INSTALL_STAGING_CMDS
+define $(2)_INSTALL_STAGING_CMDS
+	$$(TARGET_MAKE_ENV) \
+	$$($(2)_MAKE_ENV) \
+	$$(MAKE) -C $$($$(PKG)_SRCDIR) $$($(2)_INSTALL_STAGING_OPTS)
+	$$(QT5_LA_PRL_FILES_FIXUP)
+endef
+endif
+
+#
+# Target installation step. Only define it if not already defined by
+# the package .mk file.
+#
+ifndef $(2)_INSTALL_TARGET_CMDS
+define $(2)_INSTALL_TARGET_CMDS
+	$$(TARGET_MAKE_ENV) \
+	$$($(2)_MAKE_ENV) \
+	$$(MAKE) -C $$($$(PKG)_SRCDIR) INSTALL_ROOT=$$($$(PKG)_SRCDIR)/tmp-target-install $$($(2)_INSTALL_STAGING_OPTS)
+	rsync -arv --exclude usr/include* --exclude usr/lib/cmake* --exclude usr/doc* \
+	           --exclude *.la --exclude *.prl \
+	    $$($$(PKG)_SRCDIR)/tmp-target-install/$$(STAGING_DIR)/ $$(TARGET_DIR)/
+endef
+endif
+
+# Call the generic package infrastructure to generate the necessary
+# make targets
+$(call inner-generic-package,$(1),$(2),$(3),$(4))
+
+endef
+
+################################################################################
+# qmake-package -- the target generator macro for QMAKE packages
+################################################################################
+
+qmake-package = $(call inner-qmake-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target)
-- 
2.21.0

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

* [Buildroot] [PATCH v4 3/6] qt5: Convert packages to qmake infra
  2019-03-22 18:38 [Buildroot] [PATCH v4 0/6] Qt5 qmake infra with generic target install Andreas Naumann
  2019-03-22 18:38 ` [Buildroot] [PATCH v4 1/6] qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen Andreas Naumann
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 2/6] qt5: Provide generic qmake package infrastructure Andreas Naumann
@ 2019-03-22 18:39 ` Andreas Naumann
  2019-03-25 23:43   ` Arnout Vandecappelle
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 4/6] quazip: Patch .pro file to correctly crosscompile and use " Andreas Naumann
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 33+ messages in thread
From: Andreas Naumann @ 2019-03-22 18:39 UTC (permalink / raw)
  To: buildroot

In most cases the configure, build, install-staging and install-target
commands are replaced with the qmake-package generics. In some cases the
custom environment/option variables are renamed to the generic name.

The exception to this are the following cases, where the replacement was
either not straightforward or could not be 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 copied at all. Unsure of its significance the custom
install command is kept in a post install hook.

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      | 22 +-----
 package/qt-webkit-kiosk/qt-webkit-kiosk.mk    | 11 +--
 package/qt5/qt53d/qt53d.mk                    | 39 +--------
 package/qt5/qt5base/qt5base.mk                | 79 +------------------
 package/qt5/qt5canvas3d/qt5canvas3d.mk        | 26 +-----
 package/qt5/qt5charts/qt5charts.mk            | 41 +---------
 .../qt5/qt5connectivity/qt5connectivity.mk    | 60 +-------------
 package/qt5/qt5declarative/qt5declarative.mk  | 48 +----------
 package/qt5/qt5enginio/qt5enginio.mk          | 39 +--------
 .../qt5graphicaleffects.mk                    | 18 +----
 .../qt5/qt5imageformats/qt5imageformats.mk    | 20 +----
 package/qt5/qt5location/qt5location.mk        | 50 +-----------
 package/qt5/qt5multimedia/qt5multimedia.mk    | 47 +----------
 .../qt5/qt5quickcontrols/qt5quickcontrols.mk  | 41 +---------
 .../qt5quickcontrols2/qt5quickcontrols2.mk    | 40 +---------
 package/qt5/qt5script/qt5script.mk            | 32 +-------
 package/qt5/qt5scxml/qt5scxml.mk              | 37 +--------
 package/qt5/qt5sensors/qt5sensors.mk          | 40 +---------
 package/qt5/qt5serialbus/qt5serialbus.mk      | 38 +--------
 package/qt5/qt5serialport/qt5serialport.mk    | 32 +-------
 package/qt5/qt5svg/qt5svg.mk                  | 40 +---------
 package/qt5/qt5tools/qt5tools.mk              |  6 +-
 .../qt5virtualkeyboard/qt5virtualkeyboard.mk  | 63 +--------------
 package/qt5/qt5wayland/qt5wayland.mk          | 43 +---------
 package/qt5/qt5webchannel/qt5webchannel.mk    | 40 +---------
 package/qt5/qt5webengine/qt5webengine.mk      | 50 ++----------
 .../qt5webkit-examples/qt5webkit-examples.mk  | 23 +-----
 package/qt5/qt5webkit/qt5webkit.mk            | 30 ++-----
 package/qt5/qt5websockets/qt5websockets.mk    | 40 +---------
 package/qt5/qt5x11extras/qt5x11extras.mk      | 21 +----
 package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk  | 32 +-------
 package/qt5cinex/qt5cinex.mk                  |  9 +--
 package/quazip/quazip.mk                      | 10 +--
 package/qwt/qwt.mk                            |  9 +--
 34 files changed, 56 insertions(+), 1120 deletions(-)

diff --git a/package/qextserialport/qextserialport.mk b/package/qextserialport/qextserialport.mk
index ecaff21efc..6f14d21fe7 100644
--- a/package/qextserialport/qextserialport.mk
+++ b/package/qextserialport/qextserialport.mk
@@ -16,24 +16,4 @@ endif
 
 QEXTSERIALPORT_DEPENDENCIES = qt5base
 
-define QEXTSERIALPORT_CONFIGURE_CMDS
-	cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE) $(QEXTSERIALPORT_CONF_OPTS)
-endef
-
-define QEXTSERIALPORT_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-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
-endef
-endif
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt-webkit-kiosk/qt-webkit-kiosk.mk b/package/qt-webkit-kiosk/qt-webkit-kiosk.mk
index a714fca9c9..22cbf3cb87 100644
--- a/package/qt-webkit-kiosk/qt-webkit-kiosk.mk
+++ b/package/qt-webkit-kiosk/qt-webkit-kiosk.mk
@@ -11,13 +11,8 @@ QT_WEBKIT_KIOSK_DEPENDENCIES = qt5webkit qt5multimedia
 QT_WEBKIT_KIOSK_LICENSE = LGPL-3.0
 QT_WEBKIT_KIOSK_LICENSE_FILES = doc/lgpl.html
 
-define QT_WEBKIT_KIOSK_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE) PREFIX=/usr)
-endef
-
-define QT_WEBKIT_KIOSK_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
+QT_WEBKIT_KIOSK_INSTALL_STAGING = NO
+QT_WEBKIT_KIOSK_CONF_OPTS = PREFIX=/usr
 
 define QT_WEBKIT_KIOSK_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src -f Makefile.qt-webkit-kiosk \
@@ -29,4 +24,4 @@ define QT_WEBKIT_KIOSK_INSTALL_TARGET_CMDS
 		$(if $(BR2_PACKAGE_QT_WEBKIT_KIOSK_SOUNDS),install_sound)
 endef
 
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt53d/qt53d.mk b/package/qt5/qt53d/qt53d.mk
index 48a931d60b..eeb1b3644c 100644
--- a/package/qt5/qt53d/qt53d.mk
+++ b/package/qt5/qt53d/qt53d.mk
@@ -17,41 +17,4 @@ endif
 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)
-endef
-
-define QT53D_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT53D_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-endif
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index a8bec84123..744c6c57ae 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -252,30 +252,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
@@ -342,10 +318,6 @@ define QT5BASE_CONFIGURE_CMDS
 	)
 endef
 
-define QT5BASE_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-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 QT5BASE_INSTALL_QT_CONF
@@ -353,53 +325,6 @@ define QT5BASE_INSTALL_QT_CONF
 		$(QT5BASE_PKGDIR)/qt.conf.in > $(HOST_DIR)/bin/qt.conf
 endef
 
-define QT5BASE_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
-	$(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 \
-		mkdir -p $(TARGET_DIR)/usr/lib/fonts ; \
-		cp -dpfr $(STAGING_DIR)/usr/lib/fonts/* $(TARGET_DIR)/usr/lib/fonts ; \
-	fi
-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
-	$(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
+QT5BASE_POST_INSTALL_STAGING_HOOKS += QT5BASE_INSTALL_QT_CONF
 
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5canvas3d/qt5canvas3d.mk b/package/qt5/qt5canvas3d/qt5canvas3d.mk
index ef5b373d02..711d0175d4 100644
--- a/package/qt5/qt5canvas3d/qt5canvas3d.mk
+++ b/package/qt5/qt5canvas3d/qt5canvas3d.mk
@@ -18,28 +18,4 @@ QT5CANVAS3D_LICENSE = GPL-2.0 or GPL-3.0 or LGPL-3.0
 QT5CANVAS3D_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv3
 endif
 
-define QT5CANVAS3D_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5CANVAS3D_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5CANVAS3D_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5charts/qt5charts.mk b/package/qt5/qt5charts/qt5charts.mk
index 9e2e6de881..40f5efc2da 100644
--- a/package/qt5/qt5charts/qt5charts.mk
+++ b/package/qt5/qt5charts/qt5charts.mk
@@ -24,43 +24,4 @@ ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
 QT5CHARTS_DEPENDENCIES += qt5declarative
 endif
 
-define QT5CHARTS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5CHARTS_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5CHARTS_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5connectivity/qt5connectivity.mk b/package/qt5/qt5connectivity/qt5connectivity.mk
index 6de1536b78..6648a66d4f 100644
--- a/package/qt5/qt5connectivity/qt5connectivity.mk
+++ b/package/qt5/qt5connectivity/qt5connectivity.mk
@@ -26,62 +26,4 @@ QT5CONNECTIVITY_DEPENDENCIES += $(if $(BR2_PACKAGE_BLUEZ_UTILS),bluez_utils)
 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)
-endef
-
-define QT5CONNECTIVITY_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5CONNECTIVITY_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5declarative/qt5declarative.mk b/package/qt5/qt5declarative/qt5declarative.mk
index 2fe72b3be6..42c60ed3eb 100644
--- a/package/qt5/qt5declarative/qt5declarative.mk
+++ b/package/qt5/qt5declarative/qt5declarative.mk
@@ -18,50 +18,4 @@ QT5DECLARATIVE_LICENSE = GPL-3.0 or LGPL-2.1 with exception or LGPL-3.0, GFDL-1.
 QT5DECLARATIVE_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
 endif
 
-define QT5DECLARATIVE_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5DECLARATIVE_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5DECLARATIVE_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5enginio/qt5enginio.mk b/package/qt5/qt5enginio/qt5enginio.mk
index 38f309646f..cb1558e4b8 100644
--- a/package/qt5/qt5enginio/qt5enginio.mk
+++ b/package/qt5/qt5enginio/qt5enginio.mk
@@ -22,41 +22,4 @@ ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
 QT5ENGINIO_DEPENDENCIES += qt5declarative
 endif
 
-define QT5ENGINIO_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5ENGINIO_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5ENGINIO_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk b/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk
index c5011a94f0..92a3c1b8fb 100644
--- a/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk
+++ b/package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk
@@ -18,20 +18,4 @@ QT5GRAPHICALEFFECTS_LICENSE = GPL-2.0 or GPL-3.0 or LGPL-2.1 with exception or L
 QT5GRAPHICALEFFECTS_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
 endif
 
-define QT5GRAPHICALEFFECTS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5GRAPHICALEFFECTS_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5GRAPHICALEFFECTS_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-endef
-
-define QT5GRAPHICALEFFECTS_INSTALL_TARGET_CMDS
-	cp -dpfr $(STAGING_DIR)/usr/qml/QtGraphicalEffects $(TARGET_DIR)/usr/qml
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5imageformats/qt5imageformats.mk b/package/qt5/qt5imageformats/qt5imageformats.mk
index fa13ebedaf..662215521c 100644
--- a/package/qt5/qt5imageformats/qt5imageformats.mk
+++ b/package/qt5/qt5imageformats/qt5imageformats.mk
@@ -18,22 +18,4 @@ QT5IMAGEFORMATS_LICENSE = GPL-2.0 or GPL-3.0 or LGPL-2.1 with exception or LGPL-
 QT5IMAGEFORMATS_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
 endif
 
-define QT5IMAGEFORMATS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5IMAGEFORMATS_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-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/
-endef
-endif
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5location/qt5location.mk b/package/qt5/qt5location/qt5location.mk
index da0aad7961..8face619d8 100644
--- a/package/qt5/qt5location/qt5location.mk
+++ b/package/qt5/qt5location/qt5location.mk
@@ -22,52 +22,4 @@ ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
 QT5LOCATION_DEPENDENCIES += qt5declarative
 endif
 
-define QT5LOCATION_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5LOCATION_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5LOCATION_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5multimedia/qt5multimedia.mk b/package/qt5/qt5multimedia/qt5multimedia.mk
index d044b7b96c..2f34a40178 100644
--- a/package/qt5/qt5multimedia/qt5multimedia.mk
+++ b/package/qt5/qt5multimedia/qt5multimedia.mk
@@ -34,54 +34,9 @@ ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
 QT5MULTIMEDIA_DEPENDENCIES += alsa-lib
 endif
 
-define QT5MULTIMEDIA_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5MULTIMEDIA_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5MULTIMEDIA_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5quickcontrols/qt5quickcontrols.mk b/package/qt5/qt5quickcontrols/qt5quickcontrols.mk
index 3e0c5effb3..d6a0d2218c 100644
--- a/package/qt5/qt5quickcontrols/qt5quickcontrols.mk
+++ b/package/qt5/qt5quickcontrols/qt5quickcontrols.mk
@@ -18,43 +18,4 @@ else
 QT5QUICKCONTROLS_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv3 LICENSE.FDL
 endif
 
-define QT5QUICKCONTROLS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5QUICKCONTROLS_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk b/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk
index c2004c2ee7..51d8b60741 100644
--- a/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk
+++ b/package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk
@@ -13,42 +13,4 @@ QT5QUICKCONTROLS2_INSTALL_STAGING = YES
 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)
-endef
-
-define QT5QUICKCONTROLS2_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-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)
-endef
-endif
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5script/qt5script.mk b/package/qt5/qt5script/qt5script.mk
index 4a292c95a5..e2a1bb2812 100644
--- a/package/qt5/qt5script/qt5script.mk
+++ b/package/qt5/qt5script/qt5script.mk
@@ -27,34 +27,4 @@ QT5SCRIPT_LICENSE_FILES += \
 	src/3rdparty/javascriptcore/JavaScriptCore/COPYING.LIB \
 	src/3rdparty/javascriptcore/JavaScriptCore/pcre/COPYING
 
-define QT5SCRIPT_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5SCRIPT_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5SCRIPT_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5scxml/qt5scxml.mk b/package/qt5/qt5scxml/qt5scxml.mk
index de9ece597c..cb6b83052f 100644
--- a/package/qt5/qt5scxml/qt5scxml.mk
+++ b/package/qt5/qt5scxml/qt5scxml.mk
@@ -16,39 +16,4 @@ ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
 QT5SCXML_LICENSE := $(QT5SCXML_LICENSE), BSD-3-Clause (examples)
 endif
 
-define QT5SCXML_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5SCXML_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5SCXML_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5sensors/qt5sensors.mk b/package/qt5/qt5sensors/qt5sensors.mk
index 2d5cf327a6..7a3c5b7ef5 100644
--- a/package/qt5/qt5sensors/qt5sensors.mk
+++ b/package/qt5/qt5sensors/qt5sensors.mk
@@ -22,42 +22,4 @@ ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
 QT5SENSORS_DEPENDENCIES += qt5declarative
 endif
 
-define QT5SENSORS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5SENSORS_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5SENSORS_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5serialbus/qt5serialbus.mk b/package/qt5/qt5serialbus/qt5serialbus.mk
index 98c4466cb8..0ee351afe2 100644
--- a/package/qt5/qt5serialbus/qt5serialbus.mk
+++ b/package/qt5/qt5serialbus/qt5serialbus.mk
@@ -13,40 +13,4 @@ QT5SERIALBUS_INSTALL_STAGING = YES
 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)
-endef
-
-define QT5SERIALBUS_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5SERIALBUS_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5serialport/qt5serialport.mk b/package/qt5/qt5serialport/qt5serialport.mk
index 2b0953586b..f08fac6002 100644
--- a/package/qt5/qt5serialport/qt5serialport.mk
+++ b/package/qt5/qt5serialport/qt5serialport.mk
@@ -18,34 +18,4 @@ QT5SERIALPORT_LICENSE = GPL-2.0 or GPL-3.0 or LGPL-2.1 with exception or LGPL-3.
 QT5SERIALPORT_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
 endif
 
-define QT5SERIALPORT_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5SERIALPORT_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5SERIALPORT_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5svg/qt5svg.mk b/package/qt5/qt5svg/qt5svg.mk
index 48ff04bd75..2d8dade407 100644
--- a/package/qt5/qt5svg/qt5svg.mk
+++ b/package/qt5/qt5svg/qt5svg.mk
@@ -18,42 +18,4 @@ QT5SVG_LICENSE = GPL-3.0 or LGPL-2.1 with exception or LGPL-3.0, GFDL-1.3 (docs)
 QT5SVG_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
 endif
 
-define QT5SVG_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5SVG_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5SVG_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5tools/qt5tools.mk b/package/qt5/qt5tools/qt5tools.mk
index a972756d3a..6351375757 100644
--- a/package/qt5/qt5tools/qt5tools.mk
+++ b/package/qt5/qt5tools/qt5tools.mk
@@ -48,10 +48,6 @@ QT5TOOLS_INSTALL_TARGET_$(BR2_PACKAGE_QT5TOOLS_QTPATHS) += qtpaths
 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)
-endef
-
 define QT5TOOLS_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) sub-src-qmake_all
 	$(foreach p,$(QT5TOOLS_BUILD_DIRS_y), \
@@ -63,4 +59,4 @@ define QT5TOOLS_INSTALL_TARGET_CMDS
 		$(INSTALL) -D -m0755 $(@D)/bin/$(p) $(TARGET_DIR)/usr/bin/$(p)$(sep))
 endef
 
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk b/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk
index 3f1ebdbaa4..93a69c8452 100644
--- a/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk
+++ b/package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk
@@ -22,7 +22,7 @@ endif
 
 QT5VIRTUALKEYBOARD_LANGUAGE_LAYOUTS = $(call qstrip,$(BR2_PACKAGE_QT5VIRTUALKEYBOARD_LANGUAGE_LAYOUTS))
 ifneq ($(strip $(QT5VIRTUALKEYBOARD_LANGUAGE_LAYOUTS)),)
-QT5VIRTUALKEYBOARD_QMAKEFLAGS += CONFIG+="$(foreach lang,$(QT5VIRTUALKEYBOARD_LANGUAGE_LAYOUTS),lang-$(lang))"
+QT5VIRTUALKEYBOARD_CONF_OPTS += CONFIG+="$(foreach lang,$(QT5VIRTUALKEYBOARD_LANGUAGE_LAYOUTS),lang-$(lang))"
 
 ifneq ($(filter ja_JP all,$(QT5VIRTUALKEYBOARD_LANGUAGE_LAYOUTS)),)
 QT5VIRTUALKEYBOARD_LICENSE := $(QT5VIRTUALKEYBOARD_LICENSE), Apache-2.0 (openwnn)
@@ -30,21 +30,18 @@ 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_CONF_OPTS += CONFIG+=handwriting
 QT5VIRTUALKEYBOARD_LICENSE := $(QT5VIRTUALKEYBOARD_LICENSE), MIT (lipi-toolkit)
 ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
 QT5VIRTUALKEYBOARD_LICENSE_FILES += src/virtualkeyboard/3rdparty/lipi-toolkit/license.txt
@@ -54,59 +51,7 @@ endif
 endif
 
 ifeq ($(BR2_PACKAGE_QT5VIRTUALKEYBOARD_ARROW_KEY_NAVIGATION),y)
-QT5VIRTUALKEYBOARD_QMAKEFLAGS += CONFIG+=arrow-key-navigation
+QT5VIRTUALKEYBOARD_CONF_OPTS += 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
-
-define QT5VIRTUALKEYBOARD_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-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
-
-ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST):$(BR2_STATIC_LIBS),y:)
-define QT5VIRTUALKEYBOARD_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5VirtualKeyboard*.so.* $(TARGET_DIR)/usr/lib
-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_LIBS)
-	$(QT5VIRTUALKEYBOARD_INSTALL_TARGET_QML)
-	$(QT5VIRTUALKEYBOARD_INSTALL_TARGET_3RDPARTY_PARTS)
-	$(QT5VIRTUALKEYBOARD_INSTALL_TARGET_EXAMPLES)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5wayland/qt5wayland.mk b/package/qt5/qt5wayland/qt5wayland.mk
index d6fb6e1888..2a1c005d37 100644
--- a/package/qt5/qt5wayland/qt5wayland.mk
+++ b/package/qt5/qt5wayland/qt5wayland.mk
@@ -27,46 +27,7 @@ QT5WAYLAND_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICE
 endif
 
 ifeq ($(BR2_PACKAGE_QT5WAYLAND_COMPOSITOR),y)
-QT5WAYLAND_QMAKEFLAGS += CONFIG+=wayland-compositor
+QT5WAYLAND_CONF_OTPS += CONFIG+=wayland-compositor
 endif
 
-define QT5WAYLAND_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake $(QT5WAYLAND_QMAKEFLAGS))
-endef
-
-define QT5WAYLAND_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5WAYLAND_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5webchannel/qt5webchannel.mk b/package/qt5/qt5webchannel/qt5webchannel.mk
index f1c08532c0..6b273544d4 100644
--- a/package/qt5/qt5webchannel/qt5webchannel.mk
+++ b/package/qt5/qt5webchannel/qt5webchannel.mk
@@ -25,19 +25,6 @@ ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
 QT5WEBCHANNEL_DEPENDENCIES += qt5declarative
 endif
 
-define QT5WEBCHANNEL_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5WEBCHANNEL_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-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)
 define QT5WEBCHANNEL_INSTALL_TARGET_JAVASCRIPT
 	$(INSTALL) -m 0644 -D $(@D)/examples/webchannel/shared/qwebchannel.js \
@@ -50,29 +37,6 @@ 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)
-	$(QT5WEBCHANNEL_INSTALL_TARGET_JAVASCRIPT)
-	$(QT5WEBCHANNEL_INSTALL_TARGET_EXAMPLES)
-endef
+QT5WEBCHANNEL_POST_INSTALL_TARGET_HOOKS += QT5WEBCHANNEL_INSTALL_TARGET_JAVASCRIPT
 
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5webengine/qt5webengine.mk b/package/qt5/qt5webengine/qt5webengine.mk
index a3cfcec26e..54fb576d91 100644
--- a/package/qt5/qt5webengine/qt5webengine.mk
+++ b/package/qt5/qt5webengine/qt5webengine.mk
@@ -7,10 +7,9 @@
 QT5WEBENGINE_VERSION = $(QT5_VERSION)
 QT5WEBENGINE_SITE = $(QT5_SITE)
 QT5WEBENGINE_SOURCE = qtwebengine-$(QT5_SOURCE_TARBALL_PREFIX)-$(QT5WEBENGINE_VERSION).tar.xz
-QT5WEBENGINE_DEPENDENCIES = ffmpeg libglib2 libvpx opus webp qt5base \
+QT5WEBENGINE_DEPENDENCIES = ffmpeg libglib2 libvpx opus webp \
 	qt5declarative qt5webchannel host-bison host-flex host-gperf \
 	host-pkgconf host-python
-QT5WEBENGINE_INSTALL_STAGING = YES
 
 ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
 include package/qt5/qt5webengine/chromium-latest.inc
@@ -30,16 +29,16 @@ ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
 QT5WEBENGINE_DEPENDENCIES += host-libpng host-libnss libnss
 endif
 
-QT5WEBENGINE_QMAKEFLAGS += WEBENGINE_CONFIG+=use_system_ffmpeg
+QT5WEBENGINE_CONF_OPTS += WEBENGINE_CONFIG+=use_system_ffmpeg
 
 ifeq ($(BR2_PACKAGE_QT5WEBENGINE_PROPRIETARY_CODECS),y)
-QT5WEBENGINE_QMAKEFLAGS += WEBENGINE_CONFIG+=use_proprietary_codecs
+QT5WEBENGINE_CONF_OPTS += WEBENGINE_CONFIG+=use_proprietary_codecs
 endif
 
 ifeq ($(BR2_PACKAGE_QT5WEBENGINE_ALSA),y)
 QT5WEBENGINE_DEPENDENCIES += alsa-lib
 else
-QT5WEBENGINE_QMAKEFLAGS += QT_CONFIG-=alsa
+QT5WEBENGINE_CONF_OPTS += QT_CONFIG-=alsa
 endif
 
 # QtWebengine's build system uses python, but only supports python2. We work
@@ -63,43 +62,6 @@ QT5WEBENGINE_PRE_CONFIGURE_HOOKS += QT5WEBENGINE_CREATE_HOST_PKG_CONFIG
 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))
-endef
-
-define QT5WEBENGINE_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(QT5WEBENGINE_ENV) $(MAKE) -C $(@D)
-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_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)
-endef
+QT5WEBENGINE_CONF_ENV = $(QT5WEBENGINE_ENV)
+QT5WEBENGINE_MAKE_ENV = $(QT5WEBENGINE_ENV)
 
-$(eval $(generic-package))
diff --git a/package/qt5/qt5webkit-examples/qt5webkit-examples.mk b/package/qt5/qt5webkit-examples/qt5webkit-examples.mk
index 94153fd652..1f6058657d 100644
--- a/package/qt5/qt5webkit-examples/qt5webkit-examples.mk
+++ b/package/qt5/qt5webkit-examples/qt5webkit-examples.mk
@@ -26,29 +26,8 @@ ifeq ($(BR2_PACKAGE_QT5XMLPATTERNS),y)
 QT5WEBKIT_EXAMPLES_DEPENDENCIES += qt5xmlpatterns
 endif
 
-define QT5WEBKIT_EXAMPLES_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5WEBKIT_EXAMPLES_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5WEBKIT_EXAMPLES_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5webkit/qt5webkit.mk b/package/qt5/qt5webkit/qt5webkit.mk
index a0a0998d12..7878e94e6e 100644
--- a/package/qt5/qt5webkit/qt5webkit.mk
+++ b/package/qt5/qt5webkit/qt5webkit.mk
@@ -37,36 +37,20 @@ endif
 # QtWebkit's build system uses python, but only supports python2. We work
 # around this by forcing python2 early in the PATH, via a python->python2
 # symlink.
-QT5WEBKIT_ENV = PATH=$(@D)/host-bin:$(BR_PATH)
+QT5WEBKIT_CONF_ENV = PATH=$(@D)/host-bin:$(BR_PATH)
+QT5WEBKIT_MAKE_ENV = PATH=$(@D)/host-bin:$(BR_PATH)
 define QT5WEBKIT_PYTHON2_SYMLINK
 	mkdir -p $(@D)/host-bin
 	ln -sf $(HOST_DIR)/bin/python2 $(@D)/host-bin/python
 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)
-endef
-
-define QT5WEBKIT_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(QT5WEBKIT_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5WEBKIT_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(QT5WEBKIT_ENV) $(MAKE) -C $(@D) install
-	$(QT5_LA_PRL_FILES_FIXUP)
-endef
+QT5WEBKIT_CONF_OPTS =  WEBKIT_CONFIG+=use_system_leveldb
 
-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
+define QT5WEBKIT_INSTALL_TARGET_EXTRAS
 	cp -dpf $(@D)/bin/* $(TARGET_DIR)/usr/bin/
-	$(QT5WEBKIT_INSTALL_TARGET_QMLS)
 endef
 
-$(eval $(generic-package))
+QT5WEBKIT_POST_INSTALL_TARGET_HOOKS += QT5WEBKIT_INSTALL_TARGET_EXTRAS
+
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5websockets/qt5websockets.mk b/package/qt5/qt5websockets/qt5websockets.mk
index c67db198db..247031e53c 100644
--- a/package/qt5/qt5websockets/qt5websockets.mk
+++ b/package/qt5/qt5websockets/qt5websockets.mk
@@ -25,42 +25,4 @@ ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
 QT5WEBSOCKETS_DEPENDENCIES += qt5declarative
 endif
 
-define QT5WEBSOCKETS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5WEBSOCKETS_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5WEBSOCKETS_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5x11extras/qt5x11extras.mk b/package/qt5/qt5x11extras/qt5x11extras.mk
index 9d54c11061..8590f543c6 100644
--- a/package/qt5/qt5x11extras/qt5x11extras.mk
+++ b/package/qt5/qt5x11extras/qt5x11extras.mk
@@ -18,23 +18,4 @@ QT5X11EXTRAS_LICENSE = GPL-2.0 or GPL-3.0 or LGPL-2.1 with exception or LGPL-3.0
 QT5X11EXTRAS_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
 endif
 
-define QT5X11EXTRAS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5X11EXTRAS_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5X11EXTRAS_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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
-endef
-endif
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk b/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
index 0a8b47ac53..4efbf43da7 100644
--- a/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
+++ b/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
@@ -21,34 +21,4 @@ ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
 QT5XMLPATTERNS_LICENSE := $(QT5XMLPATTERNS_LICENSE), BSD-3-Clause (examples)
 endif
 
-define QT5XMLPATTERNS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
-endef
-
-define QT5XMLPATTERNS_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define QT5XMLPATTERNS_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	$(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)
-endef
-
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qt5cinex/qt5cinex.mk b/package/qt5cinex/qt5cinex.mk
index 89c38ee3f5..2b27f651d8 100644
--- a/package/qt5cinex/qt5cinex.mk
+++ b/package/qt5cinex/qt5cinex.mk
@@ -17,13 +17,6 @@ QT5CINEX_DEPENDENCIES = qt5base qt5declarative
 QT5CINEX_LICENSE = CC-BY-3.0
 QT5CINEX_LICENSE_FILES = README
 
-define QT5CINEX_CONFIGURE_CMDS
-	cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake
-endef
-
-define QT5CINEX_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
 
 # In addition to the Cinematic Experience itself, we also install a
 # wrapper shell script to /usr/bin: the Cinematic Experience binary
@@ -39,4 +32,4 @@ define QT5CINEX_INSTALL_TARGET_CMDS
 		$(TARGET_DIR)/usr/bin/CinematicExperience-demo
 endef
 
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/quazip/quazip.mk b/package/quazip/quazip.mk
index aba8274506..eef423b58a 100644
--- a/package/quazip/quazip.mk
+++ b/package/quazip/quazip.mk
@@ -13,13 +13,7 @@ QUAZIP_DEPENDENCIES = \
 QUAZIP_LICENSE = LGPL-2.1
 QUAZIP_LICENSE_FILES = COPYING
 
-define QUAZIP_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE) PREFIX=/usr)
-endef
-
-define QUAZIP_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
+QUAZIP_CONF_OPTS = PREFIX=/usr
 
 define QUAZIP_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install INSTALL_ROOT=$(STAGING_DIR)
@@ -29,4 +23,4 @@ define QUAZIP_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install INSTALL_ROOT=$(TARGET_DIR)
 endef
 
-$(eval $(generic-package))
+$(eval $(qmake-package))
diff --git a/package/qwt/qwt.mk b/package/qwt/qwt.mk
index f381ebbb7a..bed510c598 100644
--- a/package/qwt/qwt.mk
+++ b/package/qwt/qwt.mk
@@ -41,14 +41,11 @@ else
 QWT_CONFIG += -e 's/^.*QWT_CONFIG.*QwtDll.*$$/QWT_CONFIG += QwtDll/'
 endif
 
-define QWT_CONFIGURE_CMDS
+define QWT_PRE_CONFIGURE_CMD
 	$(SED) $(QWT_CONFIG) $(@D)/qwtconfig.pri
-	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE))
 endef
 
-define QWT_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
-endef
+QWT_PRE_CONFIGURE_HOOKS += QWT_PRE_CONFIGURE_CMD
 
 # After installation, we fixup the INSTALL_PREFIX in qwtconfig.pri so
 # that when building with qmake, -L$(STAGING_DIR)/usr/lib is used and
@@ -64,4 +61,4 @@ define QWT_INSTALL_TARGET_CMDS
 	rm -Rf $(TARGET_DIR)/usr/mkspecs
 endef
 
-$(eval $(generic-package))
+$(eval $(qmake-package))
-- 
2.21.0

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

* [Buildroot] [PATCH v4 4/6] quazip: Patch .pro file to correctly crosscompile and use qmake infra
  2019-03-22 18:38 [Buildroot] [PATCH v4 0/6] Qt5 qmake infra with generic target install Andreas Naumann
                   ` (2 preceding siblings ...)
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 3/6] qt5: Convert packages to qmake infra Andreas Naumann
@ 2019-03-22 18:39 ` Andreas Naumann
  2019-03-26  0:03   ` Arnout Vandecappelle
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 5/6] qt5base: Fix inconsistencies when overriding qmake properties Andreas Naumann
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 33+ messages in thread
From: Andreas Naumann @ 2019-03-22 18:39 UTC (permalink / raw)
  To: buildroot

The quazip .pro files uses the target only prefix for cross staging install.
This breaks using the new qmake infra, so add a minor patch to fix this.

Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
 .../0001-Fix-crosscompile-staging-install.patch  | 16 ++++++++++++++++
 package/quazip/quazip.mk                         | 10 ----------
 2 files changed, 16 insertions(+), 10 deletions(-)
 create mode 100644 package/quazip/0001-Fix-crosscompile-staging-install.patch

diff --git a/package/quazip/0001-Fix-crosscompile-staging-install.patch b/package/quazip/0001-Fix-crosscompile-staging-install.patch
new file mode 100644
index 0000000000..96cae37283
--- /dev/null
+++ b/package/quazip/0001-Fix-crosscompile-staging-install.patch
@@ -0,0 +1,16 @@
+Index: quazip-0.7.6/quazip/quazip.pro
+===================================================================
+--- quazip-0.7.6.orig/quazip/quazip.pro
++++ quazip-0.7.6/quazip/quazip.pro
+@@ -47,9 +47,9 @@ CONFIG(debug, debug|release) {
+ }
+ 
+ unix:!symbian {
+-    headers.path=$$PREFIX/include/quazip
++    headers.path=$$[QT_INSTALL_PREFIX]/include/quazip
+     headers.files=$$HEADERS
+-    target.path=$$PREFIX/lib/$${LIB_ARCH}
++    target.path=$$[QT_INSTALL_PREFIX]/lib/$${LIB_ARCH}
+     QMAKE_PKGCONFIG_DESTDIR = pkgconfig
+     INSTALLS += headers target
+ 
diff --git a/package/quazip/quazip.mk b/package/quazip/quazip.mk
index eef423b58a..1b34c9fc2a 100644
--- a/package/quazip/quazip.mk
+++ b/package/quazip/quazip.mk
@@ -13,14 +13,4 @@ QUAZIP_DEPENDENCIES = \
 QUAZIP_LICENSE = LGPL-2.1
 QUAZIP_LICENSE_FILES = COPYING
 
-QUAZIP_CONF_OPTS = PREFIX=/usr
-
-define QUAZIP_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install INSTALL_ROOT=$(STAGING_DIR)
-endef
-
-define QUAZIP_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install INSTALL_ROOT=$(TARGET_DIR)
-endef
-
 $(eval $(qmake-package))
-- 
2.21.0

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

* [Buildroot] [PATCH v4 5/6] qt5base: Fix inconsistencies when overriding qmake properties
  2019-03-22 18:38 [Buildroot] [PATCH v4 0/6] Qt5 qmake infra with generic target install Andreas Naumann
                   ` (3 preceding siblings ...)
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 4/6] quazip: Patch .pro file to correctly crosscompile and use " Andreas Naumann
@ 2019-03-22 18:39 ` Andreas Naumann
  2019-03-25 23:50   ` Arnout Vandecappelle
  2019-04-14 10:12   ` Arnout Vandecappelle
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 6/6] qt5: Remove *.la/*.prl fixup script Andreas Naumann
  2019-03-26  0:09 ` [Buildroot] [PATCH v4 0/6] Qt5 qmake infra with generic target install Arnout Vandecappelle
  6 siblings, 2 replies; 33+ messages in thread
From: Andreas Naumann @ 2019-03-22 18:39 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] 33+ messages in thread

* [Buildroot] [PATCH v4 6/6] qt5: Remove *.la/*.prl fixup script
  2019-03-22 18:38 [Buildroot] [PATCH v4 0/6] Qt5 qmake infra with generic target install Andreas Naumann
                   ` (4 preceding siblings ...)
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 5/6] qt5base: Fix inconsistencies when overriding qmake properties Andreas Naumann
@ 2019-03-22 18:39 ` Andreas Naumann
  2019-03-27 22:13   ` Andreas Naumann
  2019-03-26  0:09 ` [Buildroot] [PATCH v4 0/6] Qt5 qmake infra with generic target install Arnout Vandecappelle
  6 siblings, 1 reply; 33+ messages in thread
From: Andreas Naumann @ 2019-03-22 18:39 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/pkg-qmake.mk | 1 -
 1 file changed, 1 deletion(-)

diff --git a/package/pkg-qmake.mk b/package/pkg-qmake.mk
index 11cfb809fc..9293253fae 100644
--- a/package/pkg-qmake.mk
+++ b/package/pkg-qmake.mk
@@ -77,7 +77,6 @@ define $(2)_INSTALL_STAGING_CMDS
 	$$(TARGET_MAKE_ENV) \
 	$$($(2)_MAKE_ENV) \
 	$$(MAKE) -C $$($$(PKG)_SRCDIR) $$($(2)_INSTALL_STAGING_OPTS)
-	$$(QT5_LA_PRL_FILES_FIXUP)
 endef
 endif
 
-- 
2.21.0

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

* [Buildroot] [PATCH v4 1/6] qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen
  2019-03-22 18:38 ` [Buildroot] [PATCH v4 1/6] qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen Andreas Naumann
@ 2019-03-25 22:13   ` Arnout Vandecappelle
  2019-03-27 22:08     ` Andreas Naumann
  0 siblings, 1 reply; 33+ messages in thread
From: Arnout Vandecappelle @ 2019-03-25 22:13 UTC (permalink / raw)
  To: buildroot



On 22/03/2019 19:38, Andreas Naumann wrote:
> Traditionally 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 | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
> index 14536980a8..a8bec84123 100644
> --- a/package/qt5/qt5base/qt5base.mk
> +++ b/package/qt5/qt5base/qt5base.mk
> @@ -24,8 +24,13 @@ QT5BASE_CONFIGURE_OPTS += \
>  	-no-iconv \
>  	-system-zlib \
>  	-system-pcre \
> -	-no-pch \
> -	-shared
> +	-no-pch
> +
> +ifeq ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
> +QT5BASE_CONFIGURE_OPTS += -shared
> +else ifeq ($(BR2_STATIC_LIBS),y)
> +QT5BASE_CONFIGURE_OPTS += -static
> +endif

 For cmake-package, we do the equivalent of

ifeq ($(BR2_STATIC_LIBS),y)
QT5BASE_CONFIGURE_OPTS += -static
else
QT5BASE_CONFIGURE_OPTS += -shared
endif

which is IMO both correct and readable.

 Regards,
 Arnout


>  
>  ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
>  QT5BASE_DEPENDENCIES += pcre
> 

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

* [Buildroot] [PATCH v4 2/6] qt5: Provide generic qmake package infrastructure
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 2/6] qt5: Provide generic qmake package infrastructure Andreas Naumann
@ 2019-03-25 23:16   ` Arnout Vandecappelle
  2019-03-26  7:18     ` Thomas Petazzoni
  2019-03-27 22:09     ` Andreas Naumann
  0 siblings, 2 replies; 33+ messages in thread
From: Arnout Vandecappelle @ 2019-03-25 23:16 UTC (permalink / raw)
  To: buildroot

 Hi Andreas,

On 22/03/2019 19:39, Andreas Naumann wrote:
> This provides generic functions for Qt5 qmake based packages. Besides
> being able to remove lots of redundant commands, it should make it possible to
> eliminate the numerous and complex target install steps.

 The commands are not really redundant (otherwise you could just remove them
anyway) and eliminating the target install steps is more or less the same thing.
And anyway, this infra doesn't allow that by itself, because you could just do
it per package. It just makes it easier to do it consistently for all packages,
makes it easier to add a new qmake package, and it makes it easier to change how
the target installation is done.

> This is done by re-running the install step of the qmake generated Makefile
> with the package build directory prepended (to the staging/host path). Even
> though this does create lengthy pathes it allows for easy separation of the
> staging files from the host destined files by just omitting the resulting
> BUILD_DIR+HOST_DIR path from the following rsync call to the real target folder.

 We have not converged yet on whether this is the right approach. So maybe, in
order to move forward, it would be better to split the patch up into a first bit
that creates the qmake package but does not define target install steps, then
convert the relevant packages to qmake packages, and finally change the qmake
infra to do target install and changes all the packages again. It's more work to
do it this way, obviously, but it would allow us to already commit part of the
series before we have converged on it completely.


> In addition, rsync excludes all header-, documentation- and cmake-pathes as well
> as libtool and prl files in order to avoid unnecessary files accumulating in
> target.

 All of these (except *.prl) are anyway cleaned up in target finalize, so by
itself it's not that useful.


> Getting rid of the many conditional install commands is possible because qmake
> already takes care of this when generating the Makefile install targets with the
> given or autodetected configure options of each package.
> 
> However, custom install steps may have to remain in cases where a particular
> buildroot option has no corresponding setting in the packages configuration
> options.

 This is also something that probably will need more discussion.


> Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
> ---
>  package/Makefile.in  |   1 +
>  package/pkg-qmake.mk | 109 +++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 110 insertions(+)
>  create mode 100644 package/pkg-qmake.mk
> 
> diff --git a/package/Makefile.in b/package/Makefile.in
> index dc818a2c18..fb0e22114c 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -442,3 +442,4 @@ include package/pkg-kernel-module.mk
>  include package/pkg-waf.mk
>  include package/pkg-golang.mk
>  include package/pkg-meson.mk
> +include package/pkg-qmake.mk
> diff --git a/package/pkg-qmake.mk b/package/pkg-qmake.mk
> new file mode 100644
> index 0000000000..11cfb809fc
> --- /dev/null
> +++ b/package/pkg-qmake.mk
> @@ -0,0 +1,109 @@
> +################################################################################
> +# QMAKE package infrastructure
> +#
> +# This file implements an infrastructure that eases development of package
> +# .mk files for QMAKE packages. It should be used for all packages that use

 It's called qmake, not QMAKE.

> +# QMAKE as their build system.
> +#
> +# See the Buildroot documentation for details on the usage of this
> +# infrastructure

 You have not actually added documentation :-)

> +#
> +# In terms of implementation, this QMAKE infrastructure requires the .mk file
> +# to only specify metadata information about the package: name, version,
> +# download URL, etc.
> +#
> +# We still allow the package .mk file to override what the different steps
> +# are doing, if needed. For example, if <PKG>_BUILD_CMDS is already defined,
> +# it is used as the list of commands to perform to build the package,
> +# instead of the default QMAKE behaviour. The package can also define some
> +# post operation hooks.
> +#
> +################################################################################
> +
> +################################################################################
> +# inner-qmake-package -- defines how the configuration, compilation and
> +# installation of a qmake package should be done, implements a few hooks
> +# to tune the build process for qmake specifities and calls the generic
> +# package infrastructure to generate the necessary make targets
> +#
> +#  argument 1 is the lowercase package name
> +#  argument 2 is the uppercase package name, including a HOST_ prefix
> +#             for host packages
> +#  argument 3 is the uppercase package name, without the HOST_ prefix
> +#             for host packages
> +#  argument 4 is the type (target or host)

 Since we don't support a host variant (yet), I would prefer to leave out
argument 3 and 4. That makes it more explicit that the whole thing needs to be
reviewed when a host variant gets added.

> +################################################################################
> +
> +define inner-qmake-package
> +
> +$(2)_CONF_ENV			?=
> +$(2)_CONF_OPTS			?=
> +$(2)_MAKE_ENV			?=
> +$(2)_MAKE_OPTS			?=
> +$(2)_INSTALL_STAGING_OPTS	?= install

 Even though target install reuses staging install, I'd allow overriding it:

$(2)_INSTALL_TARGET_OPTS ?= $$($(2)_INSTALL_STAGING_OPTS)

> +
> +#
> +# Configure step. Only define it if not already defined by the package
> +# .mk file.
> +#
> +ifndef $(2)_CONFIGURE_CMDS
> +define $(2)_CONFIGURE_CMDS
> +	cd $$($$(PKG)_SRCDIR) && \

 I realize it is currently not done consistently at all, but _SRCDIR should only
be used for extract and patch. _BUILDDIR should be used for configure, build,
install.

> +	$$(TARGET_MAKE_ENV) \> +	$$($(2)_CONF_ENV) \

 This would still fit on the preceding line.

 Also, it's weird that you mix $(2) with $$(PKG). Although I'm generally in
favour of using PKG, I think that inside the inner- macros it's better to
consistently use $(2).

> +	$$(HOST_DIR)/bin/qmake -spec devices/linux-buildroot-g++ \

 All the qt.io packages currently seem to use qmake without -spec option, and
the external packages use $$(QT5_QMAKE). I'm not entirely sure which is best,
but I'd go for QT5_QMAKE.

 With that, it would also fit together into a single line with the ENV settings.

> +		$$($(2)_CONF_OPTS)
> +endef
> +endif
> +
> +#
> +# Build step. Only define it if not already defined by the package .mk
> +# file.
> +#
> +ifndef $(2)_BUILD_CMDS
> +define $(2)_BUILD_CMDS
> +	$$(TARGET_MAKE_ENV) \
> +	$$($(2)_MAKE_ENV) \
> +	$$(MAKE) -C $$($$(PKG)_SRCDIR) $$($(2)_MAKE_OPTS)
> +endef
> +endif
> +
> +#
> +# Staging installation step. Only define it if not already defined by
> +# the package .mk file.
> +#
> +ifndef $(2)_INSTALL_STAGING_CMDS
> +define $(2)_INSTALL_STAGING_CMDS
> +	$$(TARGET_MAKE_ENV) \
> +	$$($(2)_MAKE_ENV) \
> +	$$(MAKE) -C $$($$(PKG)_SRCDIR) $$($(2)_INSTALL_STAGING_OPTS)
> +	$$(QT5_LA_PRL_FILES_FIXUP)

 H, the QT5_LA_PRL_FILES_FIXUP really only applies to the qt.io packages,
because other packages don't necessarily install as libQt5*.

 Actually, this fixup is also partially redundant with the existing fixup in the
install staging rule. So perhaps that rule should be extended with a way to
specify additional sed lines for the package, e.g.

        @$(call MESSAGE,"Fixing libtool files")
        for la in $$(find $(STAGING_DIR)/usr/lib* -name "*.la"); do \
                cp -a "$${la}" "$${la}.fixed" && \
                $(SED) "s:$(BASE_DIR):@BASE_DIR@:g" \
...
                        -e "s:@BASE_DIR@:$(BASE_DIR):g" \
			$($(PKG)_FIX_LIBTOOL_SED_EXPR) \
                        "$${la}.fixed" && \
...

and setting

$(2)_FIX_LIBTOOL_SED_EXPR = -e "/^dependency_libs=/s%-L/usr/lib %%g"

in inner-qmake-package.

 But that would first need to be refactored in two separate patches, of course.
So, to not make things more complicated than they are already, I'm OK with your
current proposal as well.


> +endef
> +endif
> +
> +#
> +# Target installation step. Only define it if not already defined by
> +# the package .mk file.
> +#
> +ifndef $(2)_INSTALL_TARGET_CMDS
> +define $(2)_INSTALL_TARGET_CMDS
> +	$$(TARGET_MAKE_ENV) \
> +	$$($(2)_MAKE_ENV) \
> +	$$(MAKE) -C $$($$(PKG)_SRCDIR) INSTALL_ROOT=$$($$(PKG)_SRCDIR)/tmp-target-install $$($(2)_INSTALL_STAGING_OPTS)

 This part really needs some explanation in the comment above, because it is
*very* counter-intuitive. You should explain why INSTALL_ROOT is used here and
not for staging install, and what its effect is exactly, i.e. that qmake
configures things with STAGING_DIR as the prefix and that INSTALL_ROOT goes
before it, so you end up with everything under
$(@D)/tmp-target-install/$(STAGING_DIR)

 However, I'm not sure that this is the way we want to go. What is wrong with
the pkg-files-list? You said before that it was incorrect, but if that is the
case, it should be fixed.

 Regards,
 Arnout

> +	rsync -arv --exclude usr/include* --exclude usr/lib/cmake* --exclude usr/doc* \
> +	           --exclude *.la --exclude *.prl \
> +	    $$($$(PKG)_SRCDIR)/tmp-target-install/$$(STAGING_DIR)/ $$(TARGET_DIR)/
> +endef
> +endif
> +
> +# Call the generic package infrastructure to generate the necessary
> +# make targets
> +$(call inner-generic-package,$(1),$(2),$(3),$(4))
> +
> +endef
> +
> +################################################################################
> +# qmake-package -- the target generator macro for QMAKE packages
> +################################################################################
> +
> +qmake-package = $(call inner-qmake-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target)
> 

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

* [Buildroot] [PATCH v4 3/6] qt5: Convert packages to qmake infra
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 3/6] qt5: Convert packages to qmake infra Andreas Naumann
@ 2019-03-25 23:43   ` Arnout Vandecappelle
  2019-03-27 22:11     ` Andreas Naumann
  0 siblings, 1 reply; 33+ messages in thread
From: Arnout Vandecappelle @ 2019-03-25 23:43 UTC (permalink / raw)
  To: buildroot

 Hi Andreas,

 Such a huge patch is pretty difficult to review and commit in one shot...

 It would be a lot easier with one patch per package, because then we can apply
a few and leave the rest for another day.

On 22/03/2019 19:39, Andreas Naumann wrote:
> In most cases the configure, build, install-staging and install-target
> commands are replaced with the qmake-package generics. In some cases the
> custom environment/option variables are renamed to the generic name.

[snip]
> diff --git a/package/qt-webkit-kiosk/qt-webkit-kiosk.mk b/package/qt-webkit-kiosk/qt-webkit-kiosk.mk
> index a714fca9c9..22cbf3cb87 100644
> --- a/package/qt-webkit-kiosk/qt-webkit-kiosk.mk
> +++ b/package/qt-webkit-kiosk/qt-webkit-kiosk.mk
> @@ -11,13 +11,8 @@ QT_WEBKIT_KIOSK_DEPENDENCIES = qt5webkit qt5multimedia
>  QT_WEBKIT_KIOSK_LICENSE = LGPL-3.0
>  QT_WEBKIT_KIOSK_LICENSE_FILES = doc/lgpl.html
>  
> -define QT_WEBKIT_KIOSK_CONFIGURE_CMDS
> -	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE) PREFIX=/usr)
> -endef
> -
> -define QT_WEBKIT_KIOSK_BUILD_CMDS
> -	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
> -endef
> +QT_WEBKIT_KIOSK_INSTALL_STAGING = NO

 This isn't needed, it's the default.

> +QT_WEBKIT_KIOSK_CONF_OPTS = PREFIX=/usr
>  
>  define QT_WEBKIT_KIOSK_INSTALL_TARGET_CMDS
>  	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src -f Makefile.qt-webkit-kiosk \
> @@ -29,4 +24,4 @@ define QT_WEBKIT_KIOSK_INSTALL_TARGET_CMDS
>  		$(if $(BR2_PACKAGE_QT_WEBKIT_KIOSK_SOUNDS),install_sound)
>  endef
>  
> -$(eval $(generic-package))
> +$(eval $(qmake-package))
> diff --git a/package/qt5/qt53d/qt53d.mk b/package/qt5/qt53d/qt53d.mk
> index 48a931d60b..eeb1b3644c 100644
> --- a/package/qt5/qt53d/qt53d.mk
> +++ b/package/qt5/qt53d/qt53d.mk
> @@ -17,41 +17,4 @@ endif
>  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)
> -endef
> -
> -define QT53D_BUILD_CMDS
> -	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
> -endef
> -
> -define QT53D_INSTALL_STAGING_CMDS
> -	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
> -	$(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/

 So, how is the examples case handled now?

> -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)
> -endef
> -endif
> -
> -$(eval $(generic-package))
> +$(eval $(qmake-package))

[snip]

 I didn't look at the rest yet.

 Regards,
 Arnout

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

* [Buildroot] [PATCH v4 5/6] qt5base: Fix inconsistencies when overriding qmake properties
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 5/6] qt5base: Fix inconsistencies when overriding qmake properties Andreas Naumann
@ 2019-03-25 23:50   ` Arnout Vandecappelle
  2019-03-27 22:13     ` Andreas Naumann
  2019-04-14 10:12   ` Arnout Vandecappelle
  1 sibling, 1 reply; 33+ messages in thread
From: Arnout Vandecappelle @ 2019-03-25 23:50 UTC (permalink / raw)
  To: buildroot



On 22/03/2019 19:39, Andreas Naumann wrote:
> 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.

 This used to be the first patch in the series, and AFAICS it should indeed be
OK to apply it already. Or am I mistaken? Have you tested some packages with
just this patch?

 The changelog in the cover letter doesn't bring enlightenment...

 Regards,
 Arnout

> 
> 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
> 

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

* [Buildroot] [PATCH v4 4/6] quazip: Patch .pro file to correctly crosscompile and use qmake infra
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 4/6] quazip: Patch .pro file to correctly crosscompile and use " Andreas Naumann
@ 2019-03-26  0:03   ` Arnout Vandecappelle
  2019-03-27 22:14     ` Andreas Naumann
  0 siblings, 1 reply; 33+ messages in thread
From: Arnout Vandecappelle @ 2019-03-26  0:03 UTC (permalink / raw)
  To: buildroot



On 22/03/2019 19:39, Andreas Naumann wrote:
> The quazip .pro files uses the target only prefix for cross staging install.
> This breaks using the new qmake infra, so add a minor patch to fix this.
> 
> Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
> ---
>  .../0001-Fix-crosscompile-staging-install.patch  | 16 ++++++++++++++++
>  package/quazip/quazip.mk                         | 10 ----------
>  2 files changed, 16 insertions(+), 10 deletions(-)
>  create mode 100644 package/quazip/0001-Fix-crosscompile-staging-install.patch
> 
> diff --git a/package/quazip/0001-Fix-crosscompile-staging-install.patch b/package/quazip/0001-Fix-crosscompile-staging-install.patch
> new file mode 100644
> index 0000000000..96cae37283
> --- /dev/null
> +++ b/package/quazip/0001-Fix-crosscompile-staging-install.patch
> @@ -0,0 +1,16 @@

 You need a commit message and a SoB here. Also, preferably a git formatted patch.

 There's an active upstream at https://github.com/stachenov/quazip so please
send a PR.

> +Index: quazip-0.7.6/quazip/quazip.pro
> +===================================================================
> +--- quazip-0.7.6.orig/quazip/quazip.pro
> ++++ quazip-0.7.6/quazip/quazip.pro
> +@@ -47,9 +47,9 @@ CONFIG(debug, debug|release) {
> + }
> + 
> + unix:!symbian {
> +-    headers.path=$$PREFIX/include/quazip
> ++    headers.path=$$[QT_INSTALL_PREFIX]/include/quazip
> +     headers.files=$$HEADERS
> +-    target.path=$$PREFIX/lib/$${LIB_ARCH}
> ++    target.path=$$[QT_INSTALL_PREFIX]/lib/$${LIB_ARCH}
> +     QMAKE_PKGCONFIG_DESTDIR = pkgconfig
> +     INSTALLS += headers target
> + 
> diff --git a/package/quazip/quazip.mk b/package/quazip/quazip.mk
> index eef423b58a..1b34c9fc2a 100644
> --- a/package/quazip/quazip.mk
> +++ b/package/quazip/quazip.mk
> @@ -13,14 +13,4 @@ QUAZIP_DEPENDENCIES = \
>  QUAZIP_LICENSE = LGPL-2.1
>  QUAZIP_LICENSE_FILES = COPYING
>  
> -QUAZIP_CONF_OPTS = PREFIX=/usr
> -
> -define QUAZIP_INSTALL_STAGING_CMDS
> -	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install INSTALL_ROOT=$(STAGING_DIR)
> -endef
> -
> -define QUAZIP_INSTALL_TARGET_CMDS
> -	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install INSTALL_ROOT=$(TARGET_DIR)

 How come this used to work if they were using PREFIX instead of QT_INSTALL_PREFIX?

 Regards,
 Arnout

> -endef
> -
>  $(eval $(qmake-package))
> 

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

* [Buildroot] [PATCH v4 0/6] Qt5 qmake infra with generic target install
  2019-03-22 18:38 [Buildroot] [PATCH v4 0/6] Qt5 qmake infra with generic target install Andreas Naumann
                   ` (5 preceding siblings ...)
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 6/6] qt5: Remove *.la/*.prl fixup script Andreas Naumann
@ 2019-03-26  0:09 ` Arnout Vandecappelle
  2019-03-27 22:07   ` Andreas Naumann
  6 siblings, 1 reply; 33+ messages in thread
From: Arnout Vandecappelle @ 2019-03-26  0:09 UTC (permalink / raw)
  To: buildroot



On 22/03/2019 19:38, Andreas Naumann wrote:
> Hi all,
> 
> here is the fourth iteration of my efforts to prepare Qt5 packages for ppsh.
> 
> Originally I had prepared v3 with a fix for the reinstall issue found by Thomas,
> which included conversion to a new qmake infra as suggested by Arnout.
> 
> However, having done that I had the idea to use a folder inside the package 
> build dir as INSTALL_ROOT, which makes it possible to to isolate the staging
> files and copy them to target without relying on timestamps. So I ditched v3
> and carried on doing that as v4. (If somebody is interested in v3 I can still
>  send it.)
> 
> This avoids the controversial discussed "install to staging only" approach,
> for which I'm not sure if it actually has enough advantages to be worth the
> hassle of dealing with timestamps and such.

 I've given feedback on all patches and marked as changes requested. Except for
patch 5, which I think can be applied as is. It would be nice to do that first,
because then my comment about the .la/.prl fixup wouldn't apply any more.


> 
> 
> regards,
> Andreas
> 
> 
> 
> v3 -> v4:
>   - changed time-stamp based target install to using INSTALL_ROOT
>   - exclude ppsh specific patches>
> v2 -> v3 (not published):
>   - convert to qmake infra
>   - use a custom .stamp_staging_started to fix the -reinstall issue

 I think the quazip patch is also new.

 Regards,
 Arnout

> 
> 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
> 
> 
> Andreas Naumann (6):
>   qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen
>   qt5: Provide generic qmake package infrastructure
>   qt5: Convert packages to qmake infra
>   quazip: Patch .pro file to correctly crosscompile and use qmake infra
>   qt5base: Fix inconsistencies when overriding qmake properties
>   qt5: Remove *.la/*.prl fixup script
> 
>  package/Makefile.in                           |   1 +
>  package/pkg-qmake.mk                          | 108 ++++++++++++++++++
>  package/qextserialport/qextserialport.mk      |  22 +---
>  package/qt-webkit-kiosk/qt-webkit-kiosk.mk    |  11 +-
>  package/qt5/qt53d/qt53d.mk                    |  39 +------
>  package/qt5/qt5base/qt.conf.in                |  17 +--
>  package/qt5/qt5base/qt5base.mk                |  88 ++------------
>  package/qt5/qt5canvas3d/qt5canvas3d.mk        |  26 +----
>  package/qt5/qt5charts/qt5charts.mk            |  41 +------
>  .../qt5/qt5connectivity/qt5connectivity.mk    |  60 +---------
>  package/qt5/qt5declarative/qt5declarative.mk  |  48 +-------
>  package/qt5/qt5enginio/qt5enginio.mk          |  39 +------
>  .../qt5graphicaleffects.mk                    |  18 +--
>  .../qt5/qt5imageformats/qt5imageformats.mk    |  20 +---
>  package/qt5/qt5location/qt5location.mk        |  50 +-------
>  package/qt5/qt5multimedia/qt5multimedia.mk    |  47 +-------
>  .../qt5/qt5quickcontrols/qt5quickcontrols.mk  |  41 +------
>  .../qt5quickcontrols2/qt5quickcontrols2.mk    |  40 +------
>  package/qt5/qt5script/qt5script.mk            |  32 +-----
>  package/qt5/qt5scxml/qt5scxml.mk              |  37 +-----
>  package/qt5/qt5sensors/qt5sensors.mk          |  40 +------
>  package/qt5/qt5serialbus/qt5serialbus.mk      |  38 +-----
>  package/qt5/qt5serialport/qt5serialport.mk    |  32 +-----
>  package/qt5/qt5svg/qt5svg.mk                  |  40 +------
>  package/qt5/qt5tools/qt5tools.mk              |   6 +-
>  .../qt5virtualkeyboard/qt5virtualkeyboard.mk  |  63 +---------
>  package/qt5/qt5wayland/qt5wayland.mk          |  43 +------
>  package/qt5/qt5webchannel/qt5webchannel.mk    |  40 +------
>  package/qt5/qt5webengine/qt5webengine.mk      |  50 +-------
>  .../qt5webkit-examples/qt5webkit-examples.mk  |  23 +---
>  package/qt5/qt5webkit/qt5webkit.mk            |  30 ++---
>  package/qt5/qt5websockets/qt5websockets.mk    |  40 +------
>  package/qt5/qt5x11extras/qt5x11extras.mk      |  21 +---
>  package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk  |  32 +-----
>  package/qt5cinex/qt5cinex.mk                  |   9 +-
>  ...001-Fix-crosscompile-staging-install.patch |  16 +++
>  package/quazip/quazip.mk                      |  18 +--
>  package/qwt/qwt.mk                            |   9 +-
>  38 files changed, 190 insertions(+), 1145 deletions(-)
>  create mode 100644 package/pkg-qmake.mk
>  create mode 100644 package/quazip/0001-Fix-crosscompile-staging-install.patch
> 

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

* [Buildroot] [PATCH v4 2/6] qt5: Provide generic qmake package infrastructure
  2019-03-25 23:16   ` Arnout Vandecappelle
@ 2019-03-26  7:18     ` Thomas Petazzoni
  2019-03-26 10:09       ` Arnout Vandecappelle
  2019-03-27 22:09     ` Andreas Naumann
  1 sibling, 1 reply; 33+ messages in thread
From: Thomas Petazzoni @ 2019-03-26  7:18 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 26 Mar 2019 00:16:47 +0100
Arnout Vandecappelle <arnout@mind.be> wrote:

> > This is done by re-running the install step of the qmake generated Makefile
> > with the package build directory prepended (to the staging/host path). Even
> > though this does create lengthy pathes it allows for easy separation of the
> > staging files from the host destined files by just omitting the resulting
> > BUILD_DIR+HOST_DIR path from the following rsync call to the real target folder.  
> 
>  We have not converged yet on whether this is the right approach. So maybe, in
> order to move forward, it would be better to split the patch up into a first bit
> that creates the qmake package but does not define target install steps, then
> convert the relevant packages to qmake packages, and finally change the qmake
> infra to do target install and changes all the packages again. It's more work to
> do it this way, obviously, but it would allow us to already commit part of the
> series before we have converged on it completely.

While I understand your idea of splitting things up further in terms of
patches, I think we can try to agree on how the target installation
step should be done and use the approach proposed by Andreas to
directly have the qmake infrastructure use this target installation
logic. Andreas has already done lots of work on this (and building Qt5
modules takes a lot of time, so I suppose this patch series is annoying
like hell to build-test), so I'd like to not raise the barrier too high
here.

> > In addition, rsync excludes all header-, documentation- and cmake-pathes as well
> > as libtool and prl files in order to avoid unnecessary files accumulating in
> > target.  
> 
>  All of these (except *.prl) are anyway cleaned up in target finalize, so by
> itself it's not that useful.

Yes, I also felt that all those exclusions were not really needed, we
should probably keep things simple: rsync everything, and really on
target-finalize for doing the cleanup.

> > Getting rid of the many conditional install commands is possible because qmake
> > already takes care of this when generating the Makefile install targets with the
> > given or autodetected configure options of each package.
> > 
> > However, custom install steps may have to remain in cases where a particular
> > buildroot option has no corresponding setting in the packages configuration
> > options.  
> 
>  This is also something that probably will need more discussion.

Why ?

> > +	$$(MAKE) -C $$($$(PKG)_SRCDIR) INSTALL_ROOT=$$($$(PKG)_SRCDIR)/tmp-target-install $$($(2)_INSTALL_STAGING_OPTS)  
> 
>  This part really needs some explanation in the comment above, because it is
> *very* counter-intuitive. You should explain why INSTALL_ROOT is used here and
> not for staging install, and what its effect is exactly, i.e. that qmake
> configures things with STAGING_DIR as the prefix and that INSTALL_ROOT goes
> before it, so you end up with everything under
> $(@D)/tmp-target-install/$(STAGING_DIR)
> 
>  However, I'm not sure that this is the way we want to go. What is wrong with
> the pkg-files-list? You said before that it was incorrect, but if that is the
> case, it should be fixed.

At this point, I find the approach proposed by Andreas to be pretty
nice. We don't yet use pkg-files-list really as part of the build
process anywhere, I feel a bit more comfortable at this point with what
Andreas is proposing. No strong argument on this, just a general
feeling.

One advantage of Andreas approach is that it does not create a
dependency between the target installation step and the staging
installation step. They can happen in whatever order, or even in
parallel (think top-level parallel build). Indeed our package
infrastructure does not enforce any dependency between target
installation and staging installation. The solution of doing staging
installation, and then use the pkg-file-list of files installed to
staging for the target installation would require adding such a
dependency between the target installation and staging installation.

Best regards,

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

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

* [Buildroot] [PATCH v4 2/6] qt5: Provide generic qmake package infrastructure
  2019-03-26  7:18     ` Thomas Petazzoni
@ 2019-03-26 10:09       ` Arnout Vandecappelle
  2019-03-27 22:10         ` Andreas Naumann
  0 siblings, 1 reply; 33+ messages in thread
From: Arnout Vandecappelle @ 2019-03-26 10:09 UTC (permalink / raw)
  To: buildroot



On 26/03/2019 08:18, Thomas Petazzoni wrote:
> Hello,
> 
> On Tue, 26 Mar 2019 00:16:47 +0100
> Arnout Vandecappelle <arnout@mind.be> wrote:
> 
>>> This is done by re-running the install step of the qmake generated Makefile
>>> with the package build directory prepended (to the staging/host path). Even
>>> though this does create lengthy pathes it allows for easy separation of the
>>> staging files from the host destined files by just omitting the resulting
>>> BUILD_DIR+HOST_DIR path from the following rsync call to the real target folder.  
>>
>>  We have not converged yet on whether this is the right approach. So maybe, in
>> order to move forward, it would be better to split the patch up into a first bit
>> that creates the qmake package but does not define target install steps, then
>> convert the relevant packages to qmake packages, and finally change the qmake
>> infra to do target install and changes all the packages again. It's more work to
>> do it this way, obviously, but it would allow us to already commit part of the
>> series before we have converged on it completely.
> 
> While I understand your idea of splitting things up further in terms of
> patches, I think we can try to agree on how the target installation
> step should be done and use the approach proposed by Andreas to

 Sure, that's why I said "maybe". It's not a requirement, but it is also
frustrating to respinning a series and seeing no progress on it. That's why I
proposed the option.

> directly have the qmake infrastructure use this target installation
> logic. Andreas has already done lots of work on this (and building Qt5
> modules takes a lot of time, so I suppose this patch series is annoying
> like hell to build-test), so I'd like to not raise the barrier too high
> here.
> 
>>> In addition, rsync excludes all header-, documentation- and cmake-pathes as well
>>> as libtool and prl files in order to avoid unnecessary files accumulating in
>>> target.  
>>
>>  All of these (except *.prl) are anyway cleaned up in target finalize, so by
>> itself it's not that useful.
> 
> Yes, I also felt that all those exclusions were not really needed, we
> should probably keep things simple: rsync everything, and really on
> target-finalize for doing the cleanup.
> 
>>> Getting rid of the many conditional install commands is possible because qmake
>>> already takes care of this when generating the Makefile install targets with the
>>> given or autodetected configure options of each package.
>>>
>>> However, custom install steps may have to remain in cases where a particular
>>> buildroot option has no corresponding setting in the packages configuration
>>> options.  
>>
>>  This is also something that probably will need more discussion.
> 
> Why ?

 Uh, I don't see that either anymore...

 Oh, wait, now I remember: at the time I wrote that, I thought that I was going
to give the feedback somewhere that we should have a list of files (wildcards)
to copy from staging to target instead of requiring custom install commands. But
I never got around to making that comment :-)

 Anyway, keeping custom install commands is definitely the way to go as a first
step.

> 
>>> +	$$(MAKE) -C $$($$(PKG)_SRCDIR) INSTALL_ROOT=$$($$(PKG)_SRCDIR)/tmp-target-install $$($(2)_INSTALL_STAGING_OPTS)  
>>
>>  This part really needs some explanation in the comment above, because it is
>> *very* counter-intuitive. You should explain why INSTALL_ROOT is used here and
>> not for staging install, and what its effect is exactly, i.e. that qmake
>> configures things with STAGING_DIR as the prefix and that INSTALL_ROOT goes
>> before it, so you end up with everything under
>> $(@D)/tmp-target-install/$(STAGING_DIR)
>>
>>  However, I'm not sure that this is the way we want to go. What is wrong with
>> the pkg-files-list? You said before that it was incorrect, but if that is the
>> case, it should be fixed.
> 
> At this point, I find the approach proposed by Andreas to be pretty
> nice.

 I'm also starting to warm up to it... Norbert has used the same approach for
libfuse, and mentioned that it is something that could be generalized to all
packages. And I'm starting to see the merit of that.

 I feel more comfortable to do that experiment here than in the libfuse package,
because here it is in infra so relatively easy to change. For example, I guess
it would also be nice to do a common install (in an additional step that both
target and staging install depend on, or maybe just as part of the build step)
into a PPD-like additional directory, and copy from there to the actual target
and staging, preferably using the hardlink approach instead of actual copying.
I'm just dreaming out loud here.

> We don't yet use pkg-files-list really as part of the build
> process anywhere, I feel a bit more comfortable at this point with what
> Andreas is proposing. No strong argument on this, just a general
> feeling.

 Okay, fair enough, let's not go for the pkg-files-list approach.

 Andreas, could you include this sentence from Thomas in the commit message so
we remember what the reason was to choose for this approach rather than
pkg-files-list?


> One advantage of Andreas approach is that it does not create a
> dependency between the target installation step and the staging
> installation step. They can happen in whatever order, or even in
> parallel (think top-level parallel build). Indeed our package
> infrastructure does not enforce any dependency between target
> installation and staging installation.

 Actually it does:

ifeq ($$($(2)_INSTALL_STAGING),YES)
$(1)-install-staging:                   $$($(2)_TARGET_INSTALL_STAGING)
$$($(2)_TARGET_INSTALL_STAGING):        $$($(2)_TARGET_BUILD)
# Some packages use install-staging stuff for install-target
$$($(2)_TARGET_INSTALL_TARGET):         $$($(2)_TARGET_INSTALL_STAGING)
else
$(1)-install-staging:
endif


 Introduced by:

commit 6c5c08b854e4490697076ae3c5a9c587d8672c63
Author: Fabio Porcedda <fabio.porcedda@gmail.com>
Date:   Fri Feb 14 10:55:05 2014

    package: add support for top-level parallel make

    To be able to use top-level parallel make we must not depend in a rule
    on the order of evaluation of the prerequisites, so instead of relying
    on the left to right ordering of evaluation of the prerequisites add
    an explicit rule to describe the dependencies.

    We cannot use the pattern rules because they must have the same
    dependency for every package, but we need to change the dependencies
    depending on $(2)_OVERRIDE_SRCDIR variable value, so we must use a
    more flexible way like $(2)_TARGET_% variables.

    So add explicit dependencies for the following stamp files:
      $(2)_TARGET_EXTRACT
      $(2)_TARGET_PATCH
      $(2)_TARGET_CONFIGURE
      $(2)_TARGET_BUILD
      $(2)_TARGET_INSTALL_STAGING
      $(2)_TARGET_INSTALL_TARGET
      $(2)_TARGET_INSTALL_IMAGES
      $(2)_TARGET_INSTALL_HOST

    Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
    Signed-off-by: Peter Korsgaard <peter@korsgaard.com>


2014... We've been working too long on this stuff...


 Regards,
 Arnout

> The solution of doing staging
> installation, and then use the pkg-file-list of files installed to
> staging for the target installation would require adding such a
> dependency between the target installation and staging installation.
> 
> Best regards,
> 
> Thomas
> 

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

* [Buildroot] [PATCH v4 0/6] Qt5 qmake infra with generic target install
  2019-03-26  0:09 ` [Buildroot] [PATCH v4 0/6] Qt5 qmake infra with generic target install Arnout Vandecappelle
@ 2019-03-27 22:07   ` Andreas Naumann
  0 siblings, 0 replies; 33+ messages in thread
From: Andreas Naumann @ 2019-03-27 22:07 UTC (permalink / raw)
  To: buildroot

Hi Arnout,

Am 26.03.19 um 01:09 schrieb Arnout Vandecappelle:
> 
> 
> On 22/03/2019 19:38, Andreas Naumann wrote:
>> Hi all,
>> 
>> here is the fourth iteration of my efforts to prepare Qt5 packages 
>> for ppsh.
>> 
>> Originally I had prepared v3 with a fix for the reinstall issue 
>> found by Thomas, which included conversion to a new qmake infra as 
>> suggested by Arnout.
>> 
>> However, having done that I had the idea to use a folder inside
>> the package build dir as INSTALL_ROOT, which makes it possible to
>> to isolate the staging files and copy them to target without
>> relying on timestamps. So I ditched v3 and carried on doing that as
>> v4. (If somebody is interested in v3 I can still send it.)
>> 
>> This avoids the controversial discussed "install to staging only" 
>> approach, for which I'm not sure if it actually has enough 
>> advantages to be worth the hassle of dealing with timestamps and 
>> such.
> 
> I've given feedback on all patches and marked as changes requested. 
> Except for patch 5, which I think can be applied as is. It would be 
> nice to do that first, because then my comment about the .la/.prl 
> fixup wouldn't apply any more.

Thank you very much for your review! Yes the coverletter wasnt so
perfect because many things got in the way after creating the set and
before sending the whole thing.
So I really appreciate you took the time!

> 
> 
>> 
>> 
>> regards, Andreas
>> 
>> 
>> 
>> v3 -> v4: - changed time-stamp based target install to using 
>> INSTALL_ROOT - exclude ppsh specific patches> v2 -> v3 (not 
>> published): - convert to qmake infra - use a custom 
>> .stamp_staging_started to fix the -reinstall issue
> 
> I think the quazip patch is also new.

Yes it is.

I'll update in the next iteration.


best regards,
Andreas


> 
> Regards, Arnout
> 
>> 
>> 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
>> 
>> 
>> Andreas Naumann (6): qt5base: Do not build shared libs if 
>> BR2_STATIC_LIBS is chosen qt5: Provide generic qmake package 
>> infrastructure qt5: Convert packages to qmake infra quazip: Patch 
>> .pro file to correctly crosscompile and use qmake infra qt5base: 
>> Fix inconsistencies when overriding qmake properties qt5: Remove 
>> *.la/*.prl fixup script
>> 
>> package/Makefile.in                           |   1 + 
>> package/pkg-qmake.mk                          | 108 
>> ++++++++++++++++++ package/qextserialport/qextserialport.mk      | 
>> 22 +--- package/qt-webkit-kiosk/qt-webkit-kiosk.mk    |  11 +- 
>> package/qt5/qt53d/qt53d.mk                    |  39 +------ 
>> package/qt5/qt5base/qt.conf.in                |  17 +-- 
>> package/qt5/qt5base/qt5base.mk                |  88 ++------------
>>  package/qt5/qt5canvas3d/qt5canvas3d.mk        |  26 +---- 
>> package/qt5/qt5charts/qt5charts.mk            |  41 +------ 
>> .../qt5/qt5connectivity/qt5connectivity.mk    |  60 +--------- 
>> package/qt5/qt5declarative/qt5declarative.mk  |  48 +------- 
>> package/qt5/qt5enginio/qt5enginio.mk          |  39 +------ 
>> .../qt5graphicaleffects.mk                    |  18 +-- 
>> .../qt5/qt5imageformats/qt5imageformats.mk    |  20 +--- 
>> package/qt5/qt5location/qt5location.mk        |  50 +------- 
>> package/qt5/qt5multimedia/qt5multimedia.mk    |  47 +------- 
>> .../qt5/qt5quickcontrols/qt5quickcontrols.mk  |  41 +------ 
>> .../qt5quickcontrols2/qt5quickcontrols2.mk    |  40 +------ 
>> package/qt5/qt5script/qt5script.mk            |  32 +----- 
>> package/qt5/qt5scxml/qt5scxml.mk              |  37 +----- 
>> package/qt5/qt5sensors/qt5sensors.mk          |  40 +------ 
>> package/qt5/qt5serialbus/qt5serialbus.mk      |  38 +----- 
>> package/qt5/qt5serialport/qt5serialport.mk    |  32 +----- 
>> package/qt5/qt5svg/qt5svg.mk                  |  40 +------ 
>> package/qt5/qt5tools/qt5tools.mk              |   6 +- 
>> .../qt5virtualkeyboard/qt5virtualkeyboard.mk  |  63 +--------- 
>> package/qt5/qt5wayland/qt5wayland.mk          |  43 +------ 
>> package/qt5/qt5webchannel/qt5webchannel.mk    |  40 +------ 
>> package/qt5/qt5webengine/qt5webengine.mk      |  50 +------- 
>> .../qt5webkit-examples/qt5webkit-examples.mk  |  23 +--- 
>> package/qt5/qt5webkit/qt5webkit.mk            |  30 ++--- 
>> package/qt5/qt5websockets/qt5websockets.mk    |  40 +------ 
>> package/qt5/qt5x11extras/qt5x11extras.mk      |  21 +--- 
>> package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk  |  32 +----- 
>> package/qt5cinex/qt5cinex.mk                  |   9 +- 
>> ...001-Fix-crosscompile-staging-install.patch |  16 +++ 
>> package/quazip/quazip.mk                      |  18 +-- 
>> package/qwt/qwt.mk                            |   9 +- 38 files 
>> changed, 190 insertions(+), 1145 deletions(-) create mode 100644 
>> package/pkg-qmake.mk create mode 100644 
>> package/quazip/0001-Fix-crosscompile-staging-install.patch
>> 
> 

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

* [Buildroot] [PATCH v4 1/6] qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen
  2019-03-25 22:13   ` Arnout Vandecappelle
@ 2019-03-27 22:08     ` Andreas Naumann
  0 siblings, 0 replies; 33+ messages in thread
From: Andreas Naumann @ 2019-03-27 22:08 UTC (permalink / raw)
  To: buildroot



Am 25.03.19 um 23:13 schrieb Arnout Vandecappelle:
> 
> 
> On 22/03/2019 19:38, Andreas Naumann wrote:
>> Traditionally 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 | 9 +++++++-- 1 file changed, 7 
>> insertions(+), 2 deletions(-)
>> 
>> diff --git a/package/qt5/qt5base/qt5base.mk 
>> b/package/qt5/qt5base/qt5base.mk index 14536980a8..a8bec84123 
>> 100644 --- a/package/qt5/qt5base/qt5base.mk +++ 
>> b/package/qt5/qt5base/qt5base.mk @@ -24,8 +24,13 @@ 
>> QT5BASE_CONFIGURE_OPTS += \ -no-iconv \ -system-zlib \ -system-pcre
>> \ -	-no-pch \ -	-shared +	-no-pch + +ifeq 
>> ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),y) 
>> +QT5BASE_CONFIGURE_OPTS += -shared +else ifeq 
>> ($(BR2_STATIC_LIBS),y) +QT5BASE_CONFIGURE_OPTS += -static +endif
> 
> For cmake-package, we do the equivalent of
> 
> ifeq ($(BR2_STATIC_LIBS),y) QT5BASE_CONFIGURE_OPTS += -static else 
> QT5BASE_CONFIGURE_OPTS += -shared endif
> 
> which is IMO both correct and readable.

True. Same thing, simpler code. I take it.

Regards,
Andreas

> 
> Regards, Arnout
> 
> 
>> 
>> ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y) QT5BASE_DEPENDENCIES += 
>> pcre
>> 
> 

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

* [Buildroot] [PATCH v4 2/6] qt5: Provide generic qmake package infrastructure
  2019-03-25 23:16   ` Arnout Vandecappelle
  2019-03-26  7:18     ` Thomas Petazzoni
@ 2019-03-27 22:09     ` Andreas Naumann
  1 sibling, 0 replies; 33+ messages in thread
From: Andreas Naumann @ 2019-03-27 22:09 UTC (permalink / raw)
  To: buildroot



Am 26.03.19 um 00:16 schrieb Arnout Vandecappelle:
> Hi Andreas,
> 
> On 22/03/2019 19:39, Andreas Naumann wrote:
>> This provides generic functions for Qt5 qmake based packages. 
>> Besides being able to remove lots of redundant commands, it should 
>> make it possible to eliminate the numerous and complex target 
>> install steps.
> 
> The commands are not really redundant (otherwise you could just 
> remove them

I guess I used the wrong word, should be duplicate instead of redundant.

> anyway) and eliminating the target install steps is more or less the 
> same thing.

Yes and no. Target install is done in another way, so why not summarize
that?

> And anyway, this infra doesn't allow that by itself, because you 
> could just do it per package. It just makes it easier to do it 
> consistently for all packages, makes it easier to add a new qmake 
> package, and it makes it easier to change how the target
> installation is done.

True, it's two things at once. I'll split the patch and add your
statements about consistency. More on this in my answer further down the
thread.


regards,
Andreas


> snip
> 

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

* [Buildroot] [PATCH v4 2/6] qt5: Provide generic qmake package infrastructure
  2019-03-26 10:09       ` Arnout Vandecappelle
@ 2019-03-27 22:10         ` Andreas Naumann
  2019-03-28  8:58           ` Arnout Vandecappelle
  0 siblings, 1 reply; 33+ messages in thread
From: Andreas Naumann @ 2019-03-27 22:10 UTC (permalink / raw)
  To: buildroot



Am 26.03.19 um 11:09 schrieb Arnout Vandecappelle:
> 
> 
> On 26/03/2019 08:18, Thomas Petazzoni wrote:
>> Hello,
>> 
>> On Tue, 26 Mar 2019 00:16:47 +0100 Arnout Vandecappelle
>> <arnout@mind.be> wrote:
>> 
>>>> This is done by re-running the install step of the qmake
>>>> generated Makefile with the package build directory prepended
>>>> (to the staging/host path). Even though this does create
>>>> lengthy pathes it allows for easy separation of the staging
>>>> files from the host destined files by just omitting the
>>>> resulting BUILD_DIR+HOST_DIR path from the following rsync call
>>>> to the real target folder.
>>> 
>>> We have not converged yet on whether this is the right approach.
>>> So maybe, in order to move forward, it would be better to split
>>> the patch up into a first bit that creates the qmake package but
>>> does not define target install steps, then convert the relevant
>>> packages to qmake packages, and finally change the qmake infra to
>>> do target install and changes all the packages again. It's more
>>> work to do it this way, obviously, but it would allow us to
>>> already commit part of the series before we have converged on it
>>> completely.
>> 
>> While I understand your idea of splitting things up further in
>> terms of patches, I think we can try to agree on how the target
>> installation step should be done and use the approach proposed by
>> Andreas to
> 
> Sure, that's why I said "maybe". It's not a requirement, but it is
> also frustrating to respinning a series and seeing no progress on it.
> That's why I proposed the option.

Splitting the conversion of each package (and doing this one package at
a time?) really seems like a lot work and I dont know if it leads to a
nicer history.
I propose to split up the infra introduction in two parts
(config,build,staging vs target install), but keep the conversion of
each package in one patch. Or maybe one patch for the straightforward
cases and the rest individually?

> 
>> directly have the qmake infrastructure use this target
>> installation logic. Andreas has already done lots of work on this
>> (and building Qt5 modules takes a lot of time, so I suppose this
>> patch series is annoying like hell to build-test), so I'd like to
>> not raise the barrier too high here.
>> 
>>>> In addition, rsync excludes all header-, documentation- and
>>>> cmake-pathes as well as libtool and prl files in order to avoid
>>>> unnecessary files accumulating in target.
>>> 
>>> All of these (except *.prl) are anyway cleaned up in target
>>> finalize, so by itself it's not that useful.
>> 
>> Yes, I also felt that all those exclusions were not really needed,
>> we should probably keep things simple: rsync everything, and really
>> on target-finalize for doing the cleanup.

Ok, so I add removal of *.prl to target-finalize instead.

>> 
>>>> Getting rid of the many conditional install commands is
>>>> possible because qmake already takes care of this when
>>>> generating the Makefile install targets with the given or
>>>> autodetected configure options of each package.
>>>> 
>>>> However, custom install steps may have to remain in cases where
>>>> a particular buildroot option has no corresponding setting in
>>>> the packages configuration options.
>>> 
>>> This is also something that probably will need more discussion.
>> 
>> Why ?
> 
> Uh, I don't see that either anymore...
> 
> Oh, wait, now I remember: at the time I wrote that, I thought that I
> was going to give the feedback somewhere that we should have a list
> of files (wildcards) to copy from staging to target instead of
> requiring custom install commands. But I never got around to making
> that comment :-)

If we copy everything from staging anyway, what's the list of additional
files good for? The thing is, sometimes we need to copy additional files
from the build directory or the buildroot package directory to target.

> 
> Anyway, keeping custom install commands is definitely the way to go
> as a first step.

I dont know how this can be fixed later, except upstream in some cases.

> 
>> 
>>>> +	$$(MAKE) -C $$($$(PKG)_SRCDIR)
>>>> INSTALL_ROOT=$$($$(PKG)_SRCDIR)/tmp-target-install
>>>> $$($(2)_INSTALL_STAGING_OPTS)
>>> 
>>> This part really needs some explanation in the comment above,
>>> because it is *very* counter-intuitive. You should explain why
>>> INSTALL_ROOT is used here and not for staging install, and what
>>> its effect is exactly, i.e. that qmake configures things with
>>> STAGING_DIR as the prefix and that INSTALL_ROOT goes before it,
>>> so you end up with everything under 
>>> $(@D)/tmp-target-install/$(STAGING_DIR)

I'll add explanation.

>>> 
>>> However, I'm not sure that this is the way we want to go. What is
>>> wrong with the pkg-files-list? You said before that it was
>>> incorrect, but if that is the case, it should be fixed.

pkg-files-list currently breaks the parallel build. I did send a patch
for that.
However I suspect the lists might still not be correct because if a
package provides a file which already exists it wont be recorded, right?
This situation is problematic anyway but currently solved by at least a
deterministic package build/install order in which "the last wins".
Using the staging pkg-files-list for target install would reverse that
to "first package wins".
Finally, when building in parallel, this will become a real issue.

>> 
>> At this point, I find the approach proposed by Andreas to be
>> pretty nice.
> 
> I'm also starting to warm up to it... Norbert has used the same
> approach for libfuse, and mentioned that it is something that could
> be generalized to all packages. And I'm starting to see the merit of
> that.
> 
> I feel more comfortable to do that experiment here than in the
> libfuse package, because here it is in infra so relatively easy to
> change. For example, I guess it would also be nice to do a common
> install (in an additional step that both target and staging install
> depend on, or maybe just as part of the build step) into a PPD-like
> additional directory, and copy from there to the actual target and
> staging, preferably using the hardlink approach instead of actual
> copying. I'm just dreaming out loud here.
> 
>> We don't yet use pkg-files-list really as part of the build process
>> anywhere, I feel a bit more comfortable at this point with what 
>> Andreas is proposing. No strong argument on this, just a general 
>> feeling.
> 
> Okay, fair enough, let's not go for the pkg-files-list approach.
> 
> Andreas, could you include this sentence from Thomas in the commit
> message so we remember what the reason was to choose for this
> approach rather than pkg-files-list?

Will do.


Regards,
Andreas



> 
> 
>> One advantage of Andreas approach is that it does not create a 
>> dependency between the target installation step and the staging 
>> installation step. They can happen in whatever order, or even in 
>> parallel (think top-level parallel build). Indeed our package 
>> infrastructure does not enforce any dependency between target 
>> installation and staging installation.
> 
> Actually it does:
> 
> ifeq ($$($(2)_INSTALL_STAGING),YES) $(1)-install-staging:
> $$($(2)_TARGET_INSTALL_STAGING) $$($(2)_TARGET_INSTALL_STAGING):
> $$($(2)_TARGET_BUILD) # Some packages use install-staging stuff for
> install-target $$($(2)_TARGET_INSTALL_TARGET):
> $$($(2)_TARGET_INSTALL_STAGING) else $(1)-install-staging: endif
> 
> 
> Introduced by:
> 
> commit 6c5c08b854e4490697076ae3c5a9c587d8672c63 Author: Fabio
> Porcedda <fabio.porcedda@gmail.com> Date:   Fri Feb 14 10:55:05 2014
> 
> package: add support for top-level parallel make
> 
> To be able to use top-level parallel make we must not depend in a
> rule on the order of evaluation of the prerequisites, so instead of
> relying on the left to right ordering of evaluation of the
> prerequisites add an explicit rule to describe the dependencies.
> 
> We cannot use the pattern rules because they must have the same 
> dependency for every package, but we need to change the dependencies 
> depending on $(2)_OVERRIDE_SRCDIR variable value, so we must use a 
> more flexible way like $(2)_TARGET_% variables.
> 
> So add explicit dependencies for the following stamp files: 
> $(2)_TARGET_EXTRACT $(2)_TARGET_PATCH $(2)_TARGET_CONFIGURE 
> $(2)_TARGET_BUILD $(2)_TARGET_INSTALL_STAGING 
> $(2)_TARGET_INSTALL_TARGET $(2)_TARGET_INSTALL_IMAGES 
> $(2)_TARGET_INSTALL_HOST
> 
> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com> 
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> 
> 
> 2014... We've been working too long on this stuff...
> 
> 
> Regards, Arnout
> 
>> The solution of doing staging installation, and then use the
>> pkg-file-list of files installed to staging for the target
>> installation would require adding such a dependency between the
>> target installation and staging installation.
>> 
>> Best regards,
>> 
>> Thomas
>> 
> 

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

* [Buildroot] [PATCH v4 3/6] qt5: Convert packages to qmake infra
  2019-03-25 23:43   ` Arnout Vandecappelle
@ 2019-03-27 22:11     ` Andreas Naumann
  2019-03-28  9:01       ` Arnout Vandecappelle
  0 siblings, 1 reply; 33+ messages in thread
From: Andreas Naumann @ 2019-03-27 22:11 UTC (permalink / raw)
  To: buildroot



Am 26.03.19 um 00:43 schrieb Arnout Vandecappelle:
> Hi Andreas,
> 
> Such a huge patch is pretty difficult to review and commit in one 
> shot...
> 
> It would be a lot easier with one patch per package, because then we 
> can apply a few and leave the rest for another day.

I understand. And repeat my proposal to create one patch with all the
straightforward packages and individual patches for the the packages
with hooks or other specials.

> 
> On 22/03/2019 19:39, Andreas Naumann wrote:
>> In most cases the configure, build, install-staging and 
>> install-target commands are replaced with the qmake-package 
>> generics. In some cases the custom environment/option variables
>> are renamed to the generic name.
> 
> [snip]
>> diff --git a/package/qt-webkit-kiosk/qt-webkit-kiosk.mk 
>> b/package/qt-webkit-kiosk/qt-webkit-kiosk.mk index 
>> a714fca9c9..22cbf3cb87 100644 --- 
>> a/package/qt-webkit-kiosk/qt-webkit-kiosk.mk +++ 
>> b/package/qt-webkit-kiosk/qt-webkit-kiosk.mk @@ -11,13 +11,8 @@ 
>> QT_WEBKIT_KIOSK_DEPENDENCIES = qt5webkit qt5multimedia 
>> QT_WEBKIT_KIOSK_LICENSE = LGPL-3.0 QT_WEBKIT_KIOSK_LICENSE_FILES = 
>> doc/lgpl.html
>> 
>> -define QT_WEBKIT_KIOSK_CONFIGURE_CMDS -	(cd $(@D); 
>> $(TARGET_MAKE_ENV) $(QT5_QMAKE) PREFIX=/usr) -endef - -define 
>> QT_WEBKIT_KIOSK_BUILD_CMDS -	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) 
>> -endef +QT_WEBKIT_KIOSK_INSTALL_STAGING = NO
> 
> This isn't needed, it's the default.

True. At first I set _INSTALL_STAGING per default to YES, but removed
that later. Forgot to remove this line then.

> 
>> +QT_WEBKIT_KIOSK_CONF_OPTS = PREFIX=/usr
>> 
>> define QT_WEBKIT_KIOSK_INSTALL_TARGET_CMDS $(TARGET_MAKE_ENV) 
>> $(MAKE) -C $(@D)/src -f Makefile.qt-webkit-kiosk \ @@ -29,4 +24,4 
>> @@ define QT_WEBKIT_KIOSK_INSTALL_TARGET_CMDS $(if 
>> $(BR2_PACKAGE_QT_WEBKIT_KIOSK_SOUNDS),install_sound) endef
>> 
>> -$(eval $(generic-package)) +$(eval $(qmake-package)) diff --git 
>> a/package/qt5/qt53d/qt53d.mk b/package/qt5/qt53d/qt53d.mk index 
>> 48a931d60b..eeb1b3644c 100644 --- a/package/qt5/qt53d/qt53d.mk +++ 
>> b/package/qt5/qt53d/qt53d.mk @@ -17,41 +17,4 @@ endif 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) -endef - -define QT53D_BUILD_CMDS - 
>> $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) -endef - -define 
>> QT53D_INSTALL_STAGING_CMDS -	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) 
>> install -	$(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/
> 
> So, how is the examples case handled now?

To be honest, I dont know how exactly. But I have tested that if qt5base
was configured without examples, they wont be compiled and installed in
the other modules.

> 
>> -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) 
>> -endef -endif - -$(eval $(generic-package)) +$(eval 
>> $(qmake-package))
> 
> [snip]
> 
> I didn't look at the rest yet.

Ok, thanks a lot anyway!


Regards,
Andreas


> 
> Regards, Arnout
> 

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

* [Buildroot] [PATCH v4 5/6] qt5base: Fix inconsistencies when overriding qmake properties
  2019-03-25 23:50   ` Arnout Vandecappelle
@ 2019-03-27 22:13     ` Andreas Naumann
  2019-03-28  9:02       ` Arnout Vandecappelle
  0 siblings, 1 reply; 33+ messages in thread
From: Andreas Naumann @ 2019-03-27 22:13 UTC (permalink / raw)
  To: buildroot



Am 26.03.19 um 00:50 schrieb Arnout Vandecappelle:
> 
> 
> On 22/03/2019 19:39, Andreas Naumann wrote:
>> 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.
> 
> This used to be the first patch in the series, and AFAICS it should 
> indeed be OK to apply it already. Or am I mistaken? Have you tested 
> some packages with just this patch?

After v1 I have not tested just this patch exclusively, but always with
the other patches on top. If something was wrong it should fail anyway
though.
I reordered it because it's not a prerequisite to qmake infra. Actually
I wasn't sure to resend it at all because its more a prerequisite to the
ppsh changes (which I left out at v4).

But true, it stands on its own and I'd be happy if it could be
tested/applied by someone. Should I resend standalone?

Regards,
Andreas



> 
> The changelog in the cover letter doesn't bring enlightenment...
> 
> Regards, Arnout
> 
>> 
>> 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
>> 
> 

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

* [Buildroot] [PATCH v4 6/6] qt5: Remove *.la/*.prl fixup script
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 6/6] qt5: Remove *.la/*.prl fixup script Andreas Naumann
@ 2019-03-27 22:13   ` Andreas Naumann
  2019-04-13 13:08     ` Arnout Vandecappelle
  0 siblings, 1 reply; 33+ messages in thread
From: Andreas Naumann @ 2019-03-27 22:13 UTC (permalink / raw)
  To: buildroot

Hi,

I'd really be interested if somebody remembers why this was needed. *.la
files are fixed in another generic step anyway, so why do it twice?
Also, I have not found absolute /usr/lib pathes in any of the prl files
without this.

regards,
Andreas


Am 22.03.19 um 19:39 schrieb Andreas Naumann:
> 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/pkg-qmake.mk | 1 - 1 file changed, 1 deletion(-)
> 
> diff --git a/package/pkg-qmake.mk b/package/pkg-qmake.mk index 
> 11cfb809fc..9293253fae 100644 --- a/package/pkg-qmake.mk +++ 
> b/package/pkg-qmake.mk @@ -77,7 +77,6 @@ define 
> $(2)_INSTALL_STAGING_CMDS $$(TARGET_MAKE_ENV) \ $$($(2)_MAKE_ENV) \ 
> $$(MAKE) -C $$($$(PKG)_SRCDIR) $$($(2)_INSTALL_STAGING_OPTS) - 
> $$(QT5_LA_PRL_FILES_FIXUP) endef endif
> 
> 

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

* [Buildroot] [PATCH v4 4/6] quazip: Patch .pro file to correctly crosscompile and use qmake infra
  2019-03-26  0:03   ` Arnout Vandecappelle
@ 2019-03-27 22:14     ` Andreas Naumann
  0 siblings, 0 replies; 33+ messages in thread
From: Andreas Naumann @ 2019-03-27 22:14 UTC (permalink / raw)
  To: buildroot



Am 26.03.19 um 01:03 schrieb Arnout Vandecappelle:
> 
> 
> On 22/03/2019 19:39, Andreas Naumann wrote:
>> The quazip .pro files uses the target only prefix for cross staging
>> install. This breaks using the new qmake infra, so add a minor
>> patch to fix this.
>> 
>> Signed-off-by: Andreas Naumann <anaumann@ultratronik.de> --- 
>> .../0001-Fix-crosscompile-staging-install.patch  | 16
>> ++++++++++++++++ package/quazip/quazip.mk                         |
>> 10 ---------- 2 files changed, 16 insertions(+), 10 deletions(-) 
>> create mode 100644
>> package/quazip/0001-Fix-crosscompile-staging-install.patch
>> 
>> diff --git
>> a/package/quazip/0001-Fix-crosscompile-staging-install.patch
>> b/package/quazip/0001-Fix-crosscompile-staging-install.patch new
>> file mode 100644 index 0000000000..96cae37283 --- /dev/null +++
>> b/package/quazip/0001-Fix-crosscompile-staging-install.patch @@
>> -0,0 +1,16 @@
> 
> You need a commit message and a SoB here. Also, preferably a git
> formatted patch.> There's an active upstream at
> https://github.com/stachenov/quazip so please send a PR.

OK.

> 
>> +Index: quazip-0.7.6/quazip/quazip.pro 
>> +===================================================================
>>
>> 
+--- quazip-0.7.6.orig/quazip/quazip.pro
>> ++++ quazip-0.7.6/quazip/quazip.pro +@@ -47,9 +47,9 @@
>> CONFIG(debug, debug|release) { + } + + unix:!symbian { +-
>> headers.path=$$PREFIX/include/quazip ++
>> headers.path=$$[QT_INSTALL_PREFIX]/include/quazip +
>> headers.files=$$HEADERS +-
>> target.path=$$PREFIX/lib/$${LIB_ARCH} ++
>> target.path=$$[QT_INSTALL_PREFIX]/lib/$${LIB_ARCH} +
>> QMAKE_PKGCONFIG_DESTDIR = pkgconfig +     INSTALLS += headers
>> target + diff --git a/package/quazip/quazip.mk
>> b/package/quazip/quazip.mk index eef423b58a..1b34c9fc2a 100644 ---
>> a/package/quazip/quazip.mk +++ b/package/quazip/quazip.mk @@ -13,14
>> +13,4 @@ QUAZIP_DEPENDENCIES = \ QUAZIP_LICENSE = LGPL-2.1 
>> QUAZIP_LICENSE_FILES = COPYING
>> 
>> -QUAZIP_CONF_OPTS = PREFIX=/usr - -define
>> QUAZIP_INSTALL_STAGING_CMDS -	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
>> install INSTALL_ROOT=$(STAGING_DIR) -endef - -define
>> QUAZIP_INSTALL_TARGET_CMDS -	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
>> install INSTALL_ROOT=$(TARGET_DIR)
> 
> How come this used to work if they were using PREFIX instead of
> QT_INSTALL_PREFIX?

Using PREFIX leads to cross-install not being natively supported, but
only with the addition of INSTALL_PREFIX. Thomas tried to utilize this
behaviour for our purpose. However, if a package has files for the
build-host, they will leak into STAGING_DIR and have to be identified
and removed in a later step. This is not optimal which is why Thomas was
looking for another solution in the first place.

Regards,
Andreas

> 
> Regards, Arnout
> 
>> -endef - $(eval $(qmake-package))
>> 
> 

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

* [Buildroot] [PATCH v4 2/6] qt5: Provide generic qmake package infrastructure
  2019-03-27 22:10         ` Andreas Naumann
@ 2019-03-28  8:58           ` Arnout Vandecappelle
  2019-03-28  9:50             ` Andreas Naumann
  0 siblings, 1 reply; 33+ messages in thread
From: Arnout Vandecappelle @ 2019-03-28  8:58 UTC (permalink / raw)
  To: buildroot



On 27/03/2019 23:10, Andreas Naumann wrote:
> 
> 
> Am 26.03.19 um 11:09 schrieb Arnout Vandecappelle:
>>
>>
>> On 26/03/2019 08:18, Thomas Petazzoni wrote:
>>> Hello,
>>>
>>> On Tue, 26 Mar 2019 00:16:47 +0100 Arnout Vandecappelle
>>> <arnout@mind.be> wrote:
>>>
>>>>> This is done by re-running the install step of the qmake
>>>>> generated Makefile with the package build directory prepended
>>>>> (to the staging/host path). Even though this does create
>>>>> lengthy pathes it allows for easy separation of the staging
>>>>> files from the host destined files by just omitting the
>>>>> resulting BUILD_DIR+HOST_DIR path from the following rsync call
>>>>> to the real target folder.
>>>>
>>>> We have not converged yet on whether this is the right approach.
>>>> So maybe, in order to move forward, it would be better to split
>>>> the patch up into a first bit that creates the qmake package but
>>>> does not define target install steps, then convert the relevant
>>>> packages to qmake packages, and finally change the qmake infra to
>>>> do target install and changes all the packages again. It's more
>>>> work to do it this way, obviously, but it would allow us to
>>>> already commit part of the series before we have converged on it
>>>> completely.
>>>
>>> While I understand your idea of splitting things up further in
>>> terms of patches, I think we can try to agree on how the target
>>> installation step should be done and use the approach proposed by
>>> Andreas to
>>
>> Sure, that's why I said "maybe". It's not a requirement, but it is
>> also frustrating to respinning a series and seeing no progress on it.
>> That's why I proposed the option.
> 
> Splitting the conversion of each package (and doing this one package at
> a time?) really seems like a lot work and I dont know if it leads to a
> nicer history.
> I propose to split up the infra introduction in two parts
> (config,build,staging vs target install), but keep the conversion of
> each package in one patch. Or maybe one patch for the straightforward
> cases and the rest individually?

 Sounds good to me. As Thomas wrote: you don't have to do it if it's too much work.

 IIUC your proposal would be:

1. Basic qmake infra
2. Convert all packages to qmake infra (trivial because the difficult cases
still use custom staging/target install commands, you just don't remove them).
3. Add target install support to qmake infra
4. Convert all easy packages to target install from qmake infra (i.e. just
remove the target install commands)
5-N. Convert difficult packages.

 I repeat: it would be nicer this way, but if it's take too much time to do it,
we'll accept it as just two or three patches as well.

[snip]
>>>> However, I'm not sure that this is the way we want to go. What is
>>>> wrong with the pkg-files-list? You said before that it was
>>>> incorrect, but if that is the case, it should be fixed.
> 
> pkg-files-list currently breaks the parallel build. I did send a patch
> for that.
> However I suspect the lists might still not be correct because if a
> package provides a file which already exists it wont be recorded, right?

 It will be recorded twice in that case. And the check-uniq-files script checks
in the finalize step that this doesn't actually happen.

> This situation is problematic anyway but currently solved by at least a
> deterministic package build/install order in which "the last wins".
> Using the staging pkg-files-list for target install would reverse that
> to "first package wins".
> Finally, when building in parallel, this will become a real issue.

 Yes and no. It's not an issue because each package installs in its own
host/staging/target dirs. It may become an issue when combining these dirs from
different packages, but that combination is still deterministic (it is not done
in parallel and the order is fixed with sort).

 But since we agreed to tmpinstall anyway, the point is moot.

 Regards,
 Arnout


[snip]

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

* [Buildroot] [PATCH v4 3/6] qt5: Convert packages to qmake infra
  2019-03-27 22:11     ` Andreas Naumann
@ 2019-03-28  9:01       ` Arnout Vandecappelle
  0 siblings, 0 replies; 33+ messages in thread
From: Arnout Vandecappelle @ 2019-03-28  9:01 UTC (permalink / raw)
  To: buildroot



On 27/03/2019 23:11, Andreas Naumann wrote:
>>> -define QT53D_CONFIGURE_CMDS -??? (cd $(@D); $(TARGET_MAKE_ENV)
>>> $(HOST_DIR)/bin/qmake) -endef - -define QT53D_BUILD_CMDS - $(TARGET_MAKE_ENV)
>>> $(MAKE) -C $(@D) -endef - -define QT53D_INSTALL_STAGING_CMDS -???
>>> $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install -??? $(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/
>>
>> So, how is the examples case handled now?
> 
> To be honest, I dont know how exactly. But I have tested that if qt5base
> was configured without examples, they wont be compiled and installed in
> the other modules.

 Oh, I hadn't noticed that it was in fact QT5BASE_EXAMPLES that was tested. I
had just seen that QT53D_EXAMPLES was not used anywhere else in the .mk file,
and hadn't thought of the possibility that this option would be encoded in the
qt.conf or something like that.

 Regards,
 Arnout

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

* [Buildroot] [PATCH v4 5/6] qt5base: Fix inconsistencies when overriding qmake properties
  2019-03-27 22:13     ` Andreas Naumann
@ 2019-03-28  9:02       ` Arnout Vandecappelle
  0 siblings, 0 replies; 33+ messages in thread
From: Arnout Vandecappelle @ 2019-03-28  9:02 UTC (permalink / raw)
  To: buildroot



On 27/03/2019 23:13, Andreas Naumann wrote:
> But true, it stands on its own and I'd be happy if it could be
> tested/applied by someone. Should I resend standalone?

 No, keep it as part of the series, because the rest of the series depends on
it. You can (if you like) mention in the cover letter or the patch comments
(below the --- line) that it can be applied standalone.

 Regards,
 Arnout

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

* [Buildroot] [PATCH v4 2/6] qt5: Provide generic qmake package infrastructure
  2019-03-28  8:58           ` Arnout Vandecappelle
@ 2019-03-28  9:50             ` Andreas Naumann
  2019-03-28 11:21               ` Arnout Vandecappelle
  0 siblings, 1 reply; 33+ messages in thread
From: Andreas Naumann @ 2019-03-28  9:50 UTC (permalink / raw)
  To: buildroot



Am 28.03.19 um 09:58 schrieb Arnout Vandecappelle:
> 
> 
> On 27/03/2019 23:10, Andreas Naumann wrote:
>> 
>> 
>> Am 26.03.19 um 11:09 schrieb Arnout Vandecappelle:
>>> 
>>> 
>>> On 26/03/2019 08:18, Thomas Petazzoni wrote:
>>>> Hello,
>>>> 
>>>> On Tue, 26 Mar 2019 00:16:47 +0100 Arnout Vandecappelle 
>>>> <arnout@mind.be> wrote:
>>>> 
>>>>>> This is done by re-running the install step of the qmake 
>>>>>> generated Makefile with the package build directory
>>>>>> prepended (to the staging/host path). Even though this does
>>>>>> create lengthy pathes it allows for easy separation of the
>>>>>> staging files from the host destined files by just omitting
>>>>>> the resulting BUILD_DIR+HOST_DIR path from the following
>>>>>> rsync call to the real target folder.
>>>>> 
>>>>> We have not converged yet on whether this is the right
>>>>> approach. So maybe, in order to move forward, it would be
>>>>> better to split the patch up into a first bit that creates
>>>>> the qmake package but does not define target install steps,
>>>>> then convert the relevant packages to qmake packages, and
>>>>> finally change the qmake infra to do target install and
>>>>> changes all the packages again. It's more work to do it this
>>>>> way, obviously, but it would allow us to already commit part
>>>>> of the series before we have converged on it completely.
>>>> 
>>>> While I understand your idea of splitting things up further in 
>>>> terms of patches, I think we can try to agree on how the
>>>> target installation step should be done and use the approach
>>>> proposed by Andreas to
>>> 
>>> Sure, that's why I said "maybe". It's not a requirement, but it
>>> is also frustrating to respinning a series and seeing no progress
>>> on it. That's why I proposed the option.
>> 
>> Splitting the conversion of each package (and doing this one
>> package at a time?) really seems like a lot work and I dont know if
>> it leads to a nicer history. I propose to split up the infra
>> introduction in two parts (config,build,staging vs target install),
>> but keep the conversion of each package in one patch. Or maybe one
>> patch for the straightforward cases and the rest individually?
> 
> Sounds good to me. As Thomas wrote: you don't have to do it if it's
> too much work.
> 
> IIUC your proposal would be:
> 
> 1. Basic qmake infra 2. Convert all packages to qmake infra (trivial
> because the difficult cases still use custom staging/target install
> commands, you just don't remove them). 3. Add target install support
> to qmake infra 4. Convert all easy packages to target install from
> qmake infra (i.e. just remove the target install commands) 5-N.
> Convert difficult packages.
> 

Actually I meant to not do step 2, but this should be doable as well.
I'll see how it goes.

> I repeat: it would be nicer this way, but if it's take too much time
> to do it, we'll accept it as just two or three patches as well.
> 
> [snip]
>>>>> However, I'm not sure that this is the way we want to go.
>>>>> What is wrong with the pkg-files-list? You said before that
>>>>> it was incorrect, but if that is the case, it should be
>>>>> fixed.
>> 
>> pkg-files-list currently breaks the parallel build. I did send a
>> patch for that. However I suspect the lists might still not be
>> correct because if a package provides a file which already exists
>> it wont be recorded, right?
> 
> It will be recorded twice in that case. And the check-uniq-files
> script checks in the finalize step that this doesn't actually
> happen.

oh i see. I didnt fully understand step_pkg_size_inner.

> 
>> This situation is problematic anyway but currently solved by at
>> least a deterministic package build/install order in which "the
>> last wins". Using the staging pkg-files-list for target install
>> would reverse that to "first package wins". Finally, when building
>> in parallel, this will become a real issue.
> 
> Yes and no. It's not an issue because each package installs in its
> own host/staging/target dirs. It may become an issue when combining
> these dirs from different packages, but that combination is still
> deterministic (it is not done in parallel and the order is fixed with
> sort).

True. Thanks for pointing out.


regards,
Andreas

> 
> But since we agreed to tmpinstall anyway, the point is moot.
> 
> Regards, Arnout
> 
> 
> [snip]
> 

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

* [Buildroot] [PATCH v4 2/6] qt5: Provide generic qmake package infrastructure
  2019-03-28  9:50             ` Andreas Naumann
@ 2019-03-28 11:21               ` Arnout Vandecappelle
  0 siblings, 0 replies; 33+ messages in thread
From: Arnout Vandecappelle @ 2019-03-28 11:21 UTC (permalink / raw)
  To: buildroot



On 28/03/2019 10:50, Andreas Naumann wrote:
>> IIUC your proposal would be:
>>
>> 1. Basic qmake infra 2. Convert all packages to qmake infra (trivial
>> because the difficult cases still use custom staging/target install
>> commands, you just don't remove them). 3. Add target install support
>> to qmake infra 4. Convert all easy packages to target install from
>> qmake infra (i.e. just remove the target install commands) 5-N.
>> Convert difficult packages.
>>
> 
> Actually I meant to not do step 2, but this should be doable as well.
> I'll see how it goes.

 Then splitting up the qmake infra in two steps doesn't help much either. And
we've anyway converged on the approach now, so there's no real need to split it
up. So the only thing to split up is the patch that updates the packages: one
big patch for the easy ones, and then more complicated patches for the
individual difficult ones.

 Regards,
 Arnout

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

* [Buildroot] [PATCH v4 6/6] qt5: Remove *.la/*.prl fixup script
  2019-03-27 22:13   ` Andreas Naumann
@ 2019-04-13 13:08     ` Arnout Vandecappelle
  2019-04-13 13:30       ` Thomas Petazzoni
  0 siblings, 1 reply; 33+ messages in thread
From: Arnout Vandecappelle @ 2019-04-13 13:08 UTC (permalink / raw)
  To: buildroot



On 27/03/2019 23:13, Andreas Naumann wrote:
> Hi,
> 
> I'd really be interested if somebody remembers why this was needed. *.la
> files are fixed in another generic step anyway, so why do it twice?

 That's easy: at the time this was added (commit
1737b5648c9f778149eb7da5897b66a9577d22c4 from 2013) the fixup was only done for
autotools packages, not for all packages. That changed only with commit
67f8138a46388f28d00dc8711b64d04ac7ebb464 in 2015.

> Also, I have not found absolute /usr/lib pathes in any of the prl files
> without this.

 This I can't explain. I've added Thomas in Cc but I doubt that he remembers.

 But isn't this exactly what gets fixed by the previous patch?

 BTW, this patch should also remove the definition of the macro.

 Regards,
 Arnout


> 
> regards,
> Andreas
> 
> 
> Am 22.03.19 um 19:39 schrieb Andreas Naumann:
>> 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/pkg-qmake.mk | 1 - 1 file changed, 1 deletion(-)
>>
>> diff --git a/package/pkg-qmake.mk b/package/pkg-qmake.mk index
>> 11cfb809fc..9293253fae 100644 --- a/package/pkg-qmake.mk +++
>> b/package/pkg-qmake.mk @@ -77,7 +77,6 @@ define $(2)_INSTALL_STAGING_CMDS
>> $$(TARGET_MAKE_ENV) \ $$($(2)_MAKE_ENV) \ $$(MAKE) -C $$($$(PKG)_SRCDIR)
>> $$($(2)_INSTALL_STAGING_OPTS) - $$(QT5_LA_PRL_FILES_FIXUP) endef endif
>>
>>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH v4 6/6] qt5: Remove *.la/*.prl fixup script
  2019-04-13 13:08     ` Arnout Vandecappelle
@ 2019-04-13 13:30       ` Thomas Petazzoni
  0 siblings, 0 replies; 33+ messages in thread
From: Thomas Petazzoni @ 2019-04-13 13:30 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 13 Apr 2019 15:08:58 +0200
Arnout Vandecappelle <arnout@mind.be> wrote:

> > Also, I have not found absolute /usr/lib pathes in any of the prl files
> > without this.  
> 
>  This I can't explain. I've added Thomas in Cc but I doubt that he remembers.

I obviously won't remember more than what the commit history has.
However, this .prl fixup has been added a *long* time ago, I believe
right when qt5 support was introduced. It is very well possible that
things changed since then, making the fixup possibly no longer needed.

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

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

* [Buildroot] [PATCH v4 5/6] qt5base: Fix inconsistencies when overriding qmake properties
  2019-03-22 18:39 ` [Buildroot] [PATCH v4 5/6] qt5base: Fix inconsistencies when overriding qmake properties Andreas Naumann
  2019-03-25 23:50   ` Arnout Vandecappelle
@ 2019-04-14 10:12   ` Arnout Vandecappelle
  2019-04-15  6:34     ` Andreas Naumann
  1 sibling, 1 reply; 33+ messages in thread
From: Arnout Vandecappelle @ 2019-04-14 10:12 UTC (permalink / raw)
  To: buildroot



On 22/03/2019 19:39, Andreas Naumann wrote:
> 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.

 Since you said this patch is indeed independent of the rest, I was about to
apply, but then I noticed this...

 In the original qt.conf.in, Settings was explicitly set to /usr. Now, you
change it back to /usr/etc/xdg, which is indeed the Qt default. However, would
this not lead to runtime problems for people who actually use the settings
directory, because it will have changed location after Buildroot upgrade? If we
had the Qt default overridden before, I think we should keep that override (even
if it is maybe not such a great idea to override it).


> 
> 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

 This is the original setting of Settings.

 Regards,
 Arnout

> -Documentation=/usr/doc
> -ArchData=/usr
> -Data=/usr
> +Settings=/usr/etc/xdg
> 

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

* [Buildroot] [PATCH v4 5/6] qt5base: Fix inconsistencies when overriding qmake properties
  2019-04-14 10:12   ` Arnout Vandecappelle
@ 2019-04-15  6:34     ` Andreas Naumann
  2019-04-15  8:55       ` Arnout Vandecappelle
  0 siblings, 1 reply; 33+ messages in thread
From: Andreas Naumann @ 2019-04-15  6:34 UTC (permalink / raw)
  To: buildroot

Hi Arnout,

Am 14.04.19 um 12:12 schrieb Arnout Vandecappelle:
> 
> 
> On 22/03/2019 19:39, Andreas Naumann wrote:
>> 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.
> 
>   Since you said this patch is indeed independent of the rest, I was about to
> apply, but then I noticed this...
> 
>   In the original qt.conf.in, Settings was explicitly set to /usr. Now, you
> change it back to /usr/etc/xdg, which is indeed the Qt default. However, would
> this not lead to runtime problems for people who actually use the settings
> directory, because it will have changed location after Buildroot upgrade? If we
> had the Qt default overridden before, I think we should keep that override (even
> if it is maybe not such a great idea to override it).
> 

I agree and actually was a bit unsure if changing the value would create 
issues for anybody. However within buildroot I have not found a package 
that actually deploys anything to /usr/etc/xdg, which could also mean I 
didnt look hard enough.

I will try to finally prepare v5 of the set tonight. If I dont hear 
anything else, I'll set the value back to /usr.


regards,
Andreas

> 
>>
>> 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
> 
>   This is the original setting of Settings.
> 
>   Regards,
>   Arnout
> 
>> -Documentation=/usr/doc
>> -ArchData=/usr
>> -Data=/usr
>> +Settings=/usr/etc/xdg
>>
> 

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

* [Buildroot] [PATCH v4 5/6] qt5base: Fix inconsistencies when overriding qmake properties
  2019-04-15  6:34     ` Andreas Naumann
@ 2019-04-15  8:55       ` Arnout Vandecappelle
  0 siblings, 0 replies; 33+ messages in thread
From: Arnout Vandecappelle @ 2019-04-15  8:55 UTC (permalink / raw)
  To: buildroot



On 15/04/2019 08:34, Andreas Naumann wrote:
> Hi Arnout,
> 
> Am 14.04.19 um 12:12 schrieb Arnout Vandecappelle:
>>
>>
>> On 22/03/2019 19:39, Andreas Naumann wrote:
>>> 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.
>>
>> ? Since you said this patch is indeed independent of the rest, I was about to
>> apply, but then I noticed this...
>>
>> ? In the original qt.conf.in, Settings was explicitly set to /usr. Now, you
>> change it back to /usr/etc/xdg, which is indeed the Qt default. However, would
>> this not lead to runtime problems for people who actually use the settings
>> directory, because it will have changed location after Buildroot upgrade? If we
>> had the Qt default overridden before, I think we should keep that override (even
>> if it is maybe not such a great idea to override it).
>>
> 
> I agree and actually was a bit unsure if changing the value would create issues
> for anybody. However within buildroot I have not found a package that actually
> deploys anything to /usr/etc/xdg, which could also mean I didnt look hard enough.

 I can't say I *really* know what this Settings configuration is doing, but I
*think* it is used by applications (and we don't ship many qt5-based
applications, mainly libraries). Also I think it will typically not be populated
during installation, but it will be used at runtime to read and save global
settings.


> I will try to finally prepare v5 of the set tonight. If I dont hear anything
> else, I'll set the value back to /usr.

 Okay, thanks.

 Regards,
 Arnout

> 
> 
> regards,
> Andreas
> 
>>
>>>
>>> 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
>>
>> ? This is the original setting of Settings.
>>
>> ? Regards,
>> ? Arnout
>>
>>> -Documentation=/usr/doc
>>> -ArchData=/usr
>>> -Data=/usr
>>> +Settings=/usr/etc/xdg
>>>
>>

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

end of thread, other threads:[~2019-04-15  8:55 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-22 18:38 [Buildroot] [PATCH v4 0/6] Qt5 qmake infra with generic target install Andreas Naumann
2019-03-22 18:38 ` [Buildroot] [PATCH v4 1/6] qt5base: Do not build shared libs if BR2_STATIC_LIBS is chosen Andreas Naumann
2019-03-25 22:13   ` Arnout Vandecappelle
2019-03-27 22:08     ` Andreas Naumann
2019-03-22 18:39 ` [Buildroot] [PATCH v4 2/6] qt5: Provide generic qmake package infrastructure Andreas Naumann
2019-03-25 23:16   ` Arnout Vandecappelle
2019-03-26  7:18     ` Thomas Petazzoni
2019-03-26 10:09       ` Arnout Vandecappelle
2019-03-27 22:10         ` Andreas Naumann
2019-03-28  8:58           ` Arnout Vandecappelle
2019-03-28  9:50             ` Andreas Naumann
2019-03-28 11:21               ` Arnout Vandecappelle
2019-03-27 22:09     ` Andreas Naumann
2019-03-22 18:39 ` [Buildroot] [PATCH v4 3/6] qt5: Convert packages to qmake infra Andreas Naumann
2019-03-25 23:43   ` Arnout Vandecappelle
2019-03-27 22:11     ` Andreas Naumann
2019-03-28  9:01       ` Arnout Vandecappelle
2019-03-22 18:39 ` [Buildroot] [PATCH v4 4/6] quazip: Patch .pro file to correctly crosscompile and use " Andreas Naumann
2019-03-26  0:03   ` Arnout Vandecappelle
2019-03-27 22:14     ` Andreas Naumann
2019-03-22 18:39 ` [Buildroot] [PATCH v4 5/6] qt5base: Fix inconsistencies when overriding qmake properties Andreas Naumann
2019-03-25 23:50   ` Arnout Vandecappelle
2019-03-27 22:13     ` Andreas Naumann
2019-03-28  9:02       ` Arnout Vandecappelle
2019-04-14 10:12   ` Arnout Vandecappelle
2019-04-15  6:34     ` Andreas Naumann
2019-04-15  8:55       ` Arnout Vandecappelle
2019-03-22 18:39 ` [Buildroot] [PATCH v4 6/6] qt5: Remove *.la/*.prl fixup script Andreas Naumann
2019-03-27 22:13   ` Andreas Naumann
2019-04-13 13:08     ` Arnout Vandecappelle
2019-04-13 13:30       ` Thomas Petazzoni
2019-03-26  0:09 ` [Buildroot] [PATCH v4 0/6] Qt5 qmake infra with generic target install Arnout Vandecappelle
2019-03-27 22:07   ` Andreas Naumann

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.