From patchwork Mon Jan 3 23:02:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1574906 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=CjefNqXN; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JSWWR4wK6z9sRR for ; Tue, 4 Jan 2022 10:03:31 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E4DBF813D4; Mon, 3 Jan 2022 23:03:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f2DEd6_Z67bm; Mon, 3 Jan 2022 23:03:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 7B58481916; Mon, 3 Jan 2022 23:03:26 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 8B8601BF983 for ; Mon, 3 Jan 2022 23:03:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id CA45B408B1 for ; Mon, 3 Jan 2022 23:03:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mi2yxV-1Mrgb for ; Mon, 3 Jan 2022 23:03:01 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by smtp4.osuosl.org (Postfix) with ESMTPS id 1F5CC408AB for ; Mon, 3 Jan 2022 23:03:00 +0000 (UTC) Received: by mail-pj1-x102a.google.com with SMTP id v13-20020a17090a088d00b001b0e3a74cf7so633021pjc.1 for ; Mon, 03 Jan 2022 15:03:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ga0+9JYc4xm29j5bA2EbGDHcmdEbahze/wwm5QLsPzs=; b=CjefNqXNzIQ4j8B8K49lNNfn29Sc4pZ1BZ9G70gXej58e5b6bT1dYjtt4JbZZQjDvS fQ9xSrmHtRwQijtux9ifc/1bIuZLKHO/i6zkuTET7ifnWInI0QyU9I1XxXxZaBFZa8ym 7EnDtoAY6V3DVgXDJ1rjkFUFAeEkHJlEM3K63AMsgJS/Cbz23fUhQrPbPCLahV/VqewD dVEhjEDIKEDBT6nNoxDjtURio7HloXqANbByR02ieYKhhzNuQDxW+l7gZRDWAvyZYCuh 0ASEiMochEvptfgTLVM7O2rc5t3S+LTIdAh50CI5zAaMUwewUsjky2VH9aoWi62dHVP7 UWhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ga0+9JYc4xm29j5bA2EbGDHcmdEbahze/wwm5QLsPzs=; b=s4+lNRuo/sJV6oSmws0SWTVBhDH93so0+sEdBXQCFBD6pUiVRFKReaP8UpHNqvp9Yd MLLQHdwnoFVJqzdpWNXpy08Z7wtD7ZbrJu1KHt+mKv1gIjYF4AJXns0+gf+p/fD++PYx ldc+tgZSdbdj9/Zb/KKIzdHK4U2/QEtU9AJiZ1xesTLIZao9sw2GcDGbqUawbsn7+Ynr XCPL6yVfKDQmN88WR5M4PhEpLemD65bB534cXaTwyOqUfKZXYV7OGdD20zdi/N6b26fE p2oxHBM8D+f5/egqEty77vYsXm6C9btZcEtopqFqvGIC7kRYkJsf6xb0PFQhSme7t1LS ANAg== X-Gm-Message-State: AOAM533LhmbkTM74KtmeyVUlPczm57axa8xLRryOH86gTldSywgGhhxm ZU7iKqi5XDsJ5xlTuXvoI9g9owj1ANk= X-Google-Smtp-Source: ABdhPJwSVJD0t9fYuxg5ePOkNzBaruJlpvPrI6FjJqh65LP2xuJbljQS4AaoX4fldUuNdI11sttayw== X-Received: by 2002:a17:90b:3891:: with SMTP id mu17mr58325051pjb.242.1641250980032; Mon, 03 Jan 2022 15:03:00 -0800 (PST) Received: from localhost.localdomain ([47.149.13.137]) by smtp.gmail.com with ESMTPSA id o7sm38954864pfu.108.2022.01.03.15.02.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jan 2022 15:02:59 -0800 (PST) From: Adam Duskett To: buildroot@buildroot.org Date: Mon, 3 Jan 2022 15:02:47 -0800 Message-Id: <20220103230249.310062-2-aduskett@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220103230249.310062-1-aduskett@gmail.com> References: <20220103230249.310062-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/3] package/pkg-generic.mk: fix absolute paths in .pc files for per-package builds X-BeenThere: buildroot@buildroot.org 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: Adam Duskett , Samuel Martin , Thomas Petazzoni , Naumann Andreas Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Some packages (notably qmake packages) generate .pc files with absolute paths. Unfortunately, doing so breaks per-package builds because the paths in the .pc file point outside the per-package sysroot. Add the new pre-configure-hook "FIXUP_PC_FILES_ABSOLUTE_PATHS" in package/pkg-generic.mk which searches for all .pc files in a per-package staging directory and removes the $(STAGING_DIR)/ prefix in them. This simple fix allows non-qt5base qt5 packages to build with per-package enabled. Based off of Louis-Paul's earlier work found here: https://lore.kernel.org/buildroot/a339f273-33f3-f232-eac4-6e50427abf6d@cordier.org/ And Yann Morin's feedback found here: https://patchwork.ozlabs.org/project/buildroot/patch/20200217212350.29750-21-anaumann@ultratronik.de/ Signed-off-by: Adam Duskett --- package/pkg-generic.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 5626af1d87..94104cbfa9 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -103,6 +103,17 @@ define fixup-libtool-files endef endif +# When per-package is enabled, packages may generate .pc files with absolute +# paths for the prefix field. Remove the absolute paths from the generated .pc +# files to keep per-package isolation with the build sysroot. +ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y) +define FIXUP_PC_FILES_ABSOLUTE_PATHS + $(Q)find $(STAGING_DIR)/ -name "*.pc" | xargs --no-run-if-empty \ + $(SED) "s:$(STAGING_DIR)::g" +endef +$(2)_PRE_CONFIGURE_HOOKS += FIXUP_PC_ABSOLUTE_PATHS +endif + # Make sure python _sysconfigdata*.py files only reference the current # per-package directory. # From patchwork Mon Jan 3 23:02:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1574905 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=DJzKUP8J; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JSWWB57h9z9sRR for ; Tue, 4 Jan 2022 10:03:18 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 42F4A408B1; Mon, 3 Jan 2022 23:03:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o55XS3XegcAF; Mon, 3 Jan 2022 23:03:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 759BF408AB; Mon, 3 Jan 2022 23:03:14 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 614C51BF358 for ; Mon, 3 Jan 2022 23:03:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 4F5B8813C0 for ; Mon, 3 Jan 2022 23:03:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q8XGSn6Nq_eJ for ; Mon, 3 Jan 2022 23:03:01 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by smtp1.osuosl.org (Postfix) with ESMTPS id 8E8A5813B7 for ; Mon, 3 Jan 2022 23:03:01 +0000 (UTC) Received: by mail-pg1-x531.google.com with SMTP id y9so2647783pgr.11 for ; Mon, 03 Jan 2022 15:03:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zSqlx3sl/8ThYCfGoD6O5z0lQNZ6yo5Tp1TC4BefqFA=; b=DJzKUP8JihEPtE13sAxPRbfimJH9FYrslCTS/mh1MIsSWpM8XiQZqcdVFGzXendZ2s up6idFHj99fiFwFdsn10StUfoteGkQHataYc6ZMiZX+uZGbvCbKNJWFPE9zMj/P5BQGP isq6LAhtwT0lJW7ynod3//VzsK7SMXO1M+O67eSmUcmmc+zyIEBuZeIMUnDTUcG2rgrH vpgjft0kb9QneqdRHWGCOhgxPosFIuhVIYmoHZQ0AIq8TCnKF01fXBKuPmvtIiaU4r/o sckIpgCmRgszQLxBjOszB+y1GofkiPYIvhcZxe+uB/vjnwNOzLa4DYIr60yzkmynxtmB 0G9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zSqlx3sl/8ThYCfGoD6O5z0lQNZ6yo5Tp1TC4BefqFA=; b=Rir76C1cwbSvUz4kKZ4eJcJP5u4Y+oe8QBUWQPQs2aF5dxY0qlpaDcq2d6rfHBY26V Q2sePSc3kGHfw6JvoTBnwVYgWBhn28SSd5tw7BqMH1X3nf0dKQF4iBuqh3TODd8HVlxx YuoT0TNPegh4NQzeYghuwcHzzQ5JkT898K+xDQfZM0IOGkODb5HZcsFF1n+w7t6lHOdn LgWntiuNB9gs2juOA5y7U7YGSIZkqR1n04wSfMQF4CBsPhlUHxx72ZgWUf7xMrNmdk4x pyyamUxEqeZ5wKMstQnE9kcNU6/Or/OI1xiVSUzeYd0+RtOdkOBBwUeOQBkhmgLmD9Ez K0Vw== X-Gm-Message-State: AOAM530yCTK4Ww8FecFtpmmOdpomonCQm0qnHOSDGXu1YZKp2xEQmz2h dOaks6zjpy6J/3Ebxg8eDtizYhdP1uY= X-Google-Smtp-Source: ABdhPJx4NT58X7WNPD0hRVuMQIgcAiuaTZi/KqVKYK/NidJeUfYoZlnuj+U47jHMWaZTMl241fBShA== X-Received: by 2002:aa7:973d:0:b0:4ba:70f9:14a0 with SMTP id k29-20020aa7973d000000b004ba70f914a0mr48218202pfg.37.1641250980814; Mon, 03 Jan 2022 15:03:00 -0800 (PST) Received: from localhost.localdomain ([47.149.13.137]) by smtp.gmail.com with ESMTPSA id o7sm38954864pfu.108.2022.01.03.15.03.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jan 2022 15:03:00 -0800 (PST) From: Adam Duskett To: buildroot@buildroot.org Date: Mon, 3 Jan 2022 15:02:48 -0800 Message-Id: <20220103230249.310062-3-aduskett@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220103230249.310062-1-aduskett@gmail.com> References: <20220103230249.310062-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/3] package/pkg-cmake.mk: fix absolute paths in .cmake files for per-package builds X-BeenThere: buildroot@buildroot.org 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: Adam Duskett , Samuel Martin , Thomas Petazzoni , Naumann Andreas Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Some packages (notably qmake packages) generate .cmake files with absolute paths. Unfortunately, doing so breaks per-package builds because the paths in the .cmake files point outside the per-package sysroot. Add the new pre-configure-hook "FIXUP_CMAKECONFIG_ABSOLUTE_PATHS" in package/pkg-cmake.mk which searches for all .cmake files in a per-package staging directory and removes the $(STAGING_DIR)/ prefix from in them. This simple fix allows non-qt5base qt5 packages to build with per-package enabled. Based off of Louis-Paul's earlier work found here: https://lore.kernel.org/buildroot/a339f273-33f3-f232-eac4-6e50427abf6d@cordier.org/ And Yann Morin's feedback found here: https://patchwork.ozlabs.org/project/buildroot/patch/20200217212350.29750-21-anaumann@ultratronik.de/ Signed-off-by: Adam Duskett --- package/pkg-cmake.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk index 3b1db35fb6..47234fbdd9 100644 --- a/package/pkg-cmake.mk +++ b/package/pkg-cmake.mk @@ -65,6 +65,17 @@ else $(2)_BUILDDIR = $$($(2)_SRCDIR)/buildroot-build endif +# Some packages may generate cmake files with absolute paths. Remove the +# absolute paths from the generated cmake files to keep per-package isolation +# with the build sysroot. +ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y) +define FIXUP_CMAKECONFIG_ABSOLUTE_PATHS + $(Q)find $(STAGING_DIR)/ -name "*.cmake" | xargs --no-run-if-empty \ + $(SED) "s:$(STAGING_DIR)::g" +endef +$(2)_PRE_CONFIGURE_HOOKS += FIXUP_CMAKECONFIG_ABSOLUTE_PATHS +endif + # # Configure step. Only define it if not already defined by the package # .mk file. And take care of the differences between host and target From patchwork Mon Jan 3 23:02:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1574907 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=d9Y68GSH; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JSWWf2fkcz9sRR for ; Tue, 4 Jan 2022 10:03:42 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 4CCA9605E3; Mon, 3 Jan 2022 23:03:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H12E4flyHEtK; Mon, 3 Jan 2022 23:03:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 9B13E60B4C; Mon, 3 Jan 2022 23:03:38 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 538E71BF358 for ; Mon, 3 Jan 2022 23:03:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 3C5C5813C0 for ; Mon, 3 Jan 2022 23:03:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KLgSZEdNo_DY for ; Mon, 3 Jan 2022 23:03:02 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by smtp1.osuosl.org (Postfix) with ESMTPS id 6A2BB813B7 for ; Mon, 3 Jan 2022 23:03:02 +0000 (UTC) Received: by mail-pg1-x52d.google.com with SMTP id v25so31148150pge.2 for ; Mon, 03 Jan 2022 15:03:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IrHLEg1sjCyv6UIqhVu5GtjOW8Xn004x5uU2qBkplgU=; b=d9Y68GSHESoDQgFbQtUbtOj6mthJEeRFvZpsWs2hhISI5wkSsfmIqqvIi3KUvae+he 0uMdJQ4Qxo5SFysmU23h6vF83B9qba7DdwPmx/TBCwtcrHotGz7wVlSx6QyT5F8VbCv6 CUmDtJko4A2DUeMFpjQUY77VaWifP7Nod9obgT2s4C9P2oQrzvZk/JBr6NdWvQ5+7+Jc +2OXGvaaJki8DKY7gVNVTVXTaDoYPmpsSddOeVhG8Ztn7GWWrXk6XDtRdEz7dJbYlBCe uBD8Adkr/SISUtEyVdy5Ny3/SIg9qoGsh1klq6a4R9hMVFWbxujKXze92QiqPZmRVwg2 pGsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IrHLEg1sjCyv6UIqhVu5GtjOW8Xn004x5uU2qBkplgU=; b=AFA3kFd79VdZROTj7QDWfTdad4rNR3x1a4oRVuvJduREk7OlzN0jJspewSmqX0gb24 CFO/9Ka+2xYOmHemUWohTJ84dvxdPSRHsHaP2uePLC/NTEbIj9+RKy3wuJgnGVbVCWW2 jz64v7/d96YSQtlHsu7jo/dOkMUdNiqxbfoRiykMtoz58Kp6om5dwtCNtanBATMxgvPf Ef4mh6xTxsWPQjVsuuOf20M5nYq6zk3gEcmt4bxXQeOeq/uooNYxx43VJgLr7ndfo/Zc mYessp1PtsNGWsTx4RziIh8Gz5KYwLspKweyDNdew0Fwz5L78MI3MHdziOpKSNfFOdzl nZ+A== X-Gm-Message-State: AOAM532Z1YF2MXvkBEU0r3crDYWOHoyz07WqAu5cDLwdNCp4D7eUtfKG CPM9AnwmG8rpuGJUPI6NJk2Z+XAhtZI= X-Google-Smtp-Source: ABdhPJzDA5GMciy9BDgjbVgEtzFag8N87dy85c910j3Cu1hmg4F96kv5BCVQg/J3V7ysfcPze5ruHw== X-Received: by 2002:a62:1642:0:b0:4bb:b3b6:c037 with SMTP id 63-20020a621642000000b004bbb3b6c037mr42818074pfw.50.1641250981653; Mon, 03 Jan 2022 15:03:01 -0800 (PST) Received: from localhost.localdomain ([47.149.13.137]) by smtp.gmail.com with ESMTPSA id o7sm38954864pfu.108.2022.01.03.15.03.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jan 2022 15:03:01 -0800 (PST) From: Adam Duskett To: buildroot@buildroot.org Date: Mon, 3 Jan 2022 15:02:49 -0800 Message-Id: <20220103230249.310062-4-aduskett@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220103230249.310062-1-aduskett@gmail.com> References: <20220103230249.310062-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/3] package/pkg-qmake.mk: fix absolute paths in .pri files for per-package builds X-BeenThere: buildroot@buildroot.org 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: Adam Duskett , Samuel Martin , Thomas Petazzoni , Naumann Andreas Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Qmake generates .pri files with absolute paths. Unfortunately, doing so breaks per-package builds because the paths in the .pri files point outside the per-package sysroot. Add the new pre-configure-hook "FIXUP_PRI_FILES_ABSOLUTE_PATHS" in package/pkg-qmake.mk which searches for all .pri files in a per-package staging directory and removes the $(STAGING_DIR)/ prefix in them. This simple fix allows non-qt5base qt5 packages that use .pri files to build with per-package enabled. Based off of Louis-Paul's earlier work found here: https://lore.kernel.org/buildroot/a339f273-33f3-f232-eac4-6e50427abf6d@cordier.org/ And Yann Morin's feedback found here: https://patchwork.ozlabs.org/project/buildroot/patch/20200217212350.29750-21-anaumann@ultratronik.de/ Signed-off-by: Adam Duskett --- package/pkg-qmake.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/package/pkg-qmake.mk b/package/pkg-qmake.mk index 4dcaf6dd62..b847ab0ef8 100644 --- a/package/pkg-qmake.mk +++ b/package/pkg-qmake.mk @@ -27,6 +27,17 @@ define QT_HEADERS_SYNC_HOOK $(Q)cd $($(PKG)_BUILDDIR) && $(HOST_DIR)/bin/syncqt.pl -version $(QT5_VERSION) endef +# When per-package is enabled, qmake packages may generate .pri files with +# absolute paths Remove the absolute paths from the generated .pri files to +# keep per-package isolation with the build sysroot. +ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y) +define FIXUP_PRI_FILES_ABSOLUTE_PATHS + $(Q)find $(HOST_DIR)/ -name "*.pri" | xargs --no-run-if-empty \ + $(SED) "s:$(STAGING_DIR):\$$\$$\[QT_SYSROOT\]:g" +endef +$(2)_PRE_CONFIGURE_HOOKS += FIXUP_PC_ABSOLUTE_PATHS +endif + ################################################################################ # inner-qmake-package -- defines how the configuration, compilation and # installation of a qmake package should be done, implements a few hooks