From patchwork Mon Feb 17 21:23:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Naumann X-Patchwork-Id: 1239607 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ultratronik.de Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Lxtm6bQrz9sRG for ; Tue, 18 Feb 2020 08:28:48 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 51E2E85C90; Mon, 17 Feb 2020 21:28:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 55pMjIYi3gxk; Mon, 17 Feb 2020 21:28:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 161178553C; Mon, 17 Feb 2020 21:28:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 9B4811BF37B for ; Mon, 17 Feb 2020 21:28:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 97CE68557B for ; Mon, 17 Feb 2020 21:28:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iMtjlS4ije9F for ; Mon, 17 Feb 2020 21:28:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from dd5108.kasserver.com (dd5108.kasserver.com [85.13.130.47]) by whitealder.osuosl.org (Postfix) with ESMTPS id 29F6884D49 for ; Mon, 17 Feb 2020 21:28:16 +0000 (UTC) Received: from wslxew902.fritz.box (ipb21bd646.dynamic.kabel-deutschland.de [178.27.214.70]) by dd5108.kasserver.com (Postfix) with ESMTPA id 5EBBAB9019C0; Mon, 17 Feb 2020 22:28:14 +0100 (CET) From: Andreas Naumann To: buildroot@buildroot.org Date: Mon, 17 Feb 2020 22:23:41 +0100 Message-Id: <20200217212350.29750-20-anaumann@ultratronik.de> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200217212350.29750-1-anaumann@ultratronik.de> References: <20200217212350.29750-1-anaumann@ultratronik.de> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v6 19/28] core/pkg-infra: Add per-package support in qmake infra X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andreas Naumann , Peter Seiderer , Julien Corjon , Thomas Petazzoni , Thomas De Schampheleire Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Qmake configured packages will, by default, use the absolute HostPrefix/Sysroot pathes set during configuration/building of qt5base for their install destinations. For the per-package host/staging infrastructure, this causes non-qt5base packages to litter the qt5base folders. In addition, buildroots target-install step subsequently fails because the respective files are missing from the per-package sysroot of the package itself. Fortunately, qmake's built-in pathes can be overridden by placing a custom qt.conf next to the qmake binary. This is already used to facilitate SDK relocation. So for per-package path manipulation we can reuse that method, but need to change the host/sysroot values according to each per-package path. Signed-off-by: Andreas Naumann Reviewed-by: Yann E. MORIN --- package/pkg-qmake.mk | 1 + package/qt5/qt5.mk | 15 +++++++++++++++ package/qt5/qt5base/qt5base.mk | 9 +-------- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/package/pkg-qmake.mk b/package/pkg-qmake.mk index 53ac3e4a1c..3aa0dd7101 100644 --- a/package/pkg-qmake.mk +++ b/package/pkg-qmake.mk @@ -46,6 +46,7 @@ $(2)_INSTALL_TARGET_OPTS ?= $$($(2)_INSTALL_STAGING_OPTS) # ifndef $(2)_CONFIGURE_CMDS define $(2)_CONFIGURE_CMDS + $$(QT5_QT_CONF_FIXUP) cd $$($(2)_BUILDDIR) && \ $$(TARGET_MAKE_ENV) $$($(2)_CONF_ENV) $$(QT5_QMAKE) $$($(2)_CONF_OPTS) endef diff --git a/package/qt5/qt5.mk b/package/qt5/qt5.mk index d94d9cc99f..eb2a749678 100644 --- a/package/qt5/qt5.mk +++ b/package/qt5/qt5.mk @@ -17,5 +17,20 @@ QT5_SITE = https://download.qt.io/archive/qt/$(QT5_VERSION_MAJOR)/$(QT5_VERSION) include $(sort $(wildcard package/qt5/*/*.mk)) +# The file "qt.conf" can be used to override the hard-coded paths that are +# compiled into the Qt library. We need it to make "qmake" relocatable and +# tweak the per-package install pathes +define QT5_INSTALL_QT_CONF + rm -f $(HOST_DIR)/bin/qt.conf && \ + sed -e "s|@@HOST_DIR@@|$(HOST_DIR)|" -e "s|@@STAGING_DIR@@|$(STAGING_DIR)|" \ + $(QT5BASE_PKGDIR)/qt.conf.in > $(HOST_DIR)/bin/qt.conf +endef + +ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y) +define QT5_QT_CONF_FIXUP + $(QT5_INSTALL_QT_CONF) +endef +endif + # Variable for other Qt applications to use QT5_QMAKE = $(HOST_DIR)/bin/qmake -spec devices/linux-buildroot-g++ diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk index 03f984ef8c..960a802b3b 100644 --- a/package/qt5/qt5base/qt5base.mk +++ b/package/qt5/qt5base/qt5base.mk @@ -352,13 +352,6 @@ define QT5BASE_CONFIGURE_CMDS ) 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 - sed -e "s|@@HOST_DIR@@|$(HOST_DIR)|" -e "s|@@STAGING_DIR@@|$(STAGING_DIR)|" \ - $(QT5BASE_PKGDIR)/qt.conf.in > $(HOST_DIR)/bin/qt.conf -endef - -QT5BASE_POST_INSTALL_STAGING_HOOKS += QT5BASE_INSTALL_QT_CONF +QT5BASE_POST_INSTALL_STAGING_HOOKS += QT5_INSTALL_QT_CONF $(eval $(qmake-package))