From patchwork Thu Jan 30 08:47:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Cavallari X-Patchwork-Id: 1231336 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.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=green-communications.fr Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 487Yyw6Z1Rz9sP6 for ; Thu, 30 Jan 2020 19:52:56 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7E66F883DA; Thu, 30 Jan 2020 08:52:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ay9ZxMfzBqO8; Thu, 30 Jan 2020 08:52:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 0C5BB8830F; Thu, 30 Jan 2020 08:52:51 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 304BD1BF289 for ; Thu, 30 Jan 2020 08:52:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2BF70226AF for ; Thu, 30 Jan 2020 08:52:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yBYD8vSrZEBW for ; Thu, 30 Jan 2020 08:52:49 +0000 (UTC) X-Greylist: delayed 00:05:06 by SQLgrey-1.7.6 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10]) by silver.osuosl.org (Postfix) with ESMTPS id 75B742268C for ; Thu, 30 Jan 2020 08:52:48 +0000 (UTC) Received: from evilbit.green-communications.fr ([92.154.77.116]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.184]) with ESMTPSA (Nemesis) id 1M2wbS-1j0Nny3sHk-003OHw; Thu, 30 Jan 2020 09:47:39 +0100 From: Nicolas Cavallari To: buildroot@buildroot.org Date: Thu, 30 Jan 2020 09:47:34 +0100 Message-Id: <20200130084734.20100-1-nicolas.cavallari@green-communications.fr> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:uBP6qgtxXZJZLhoSTx1l/qNxWfLZICjqV1cfMAEE4GOfbWuze9O qVWwNghVwdzf3kUQVbkytM8UdXrP+oeKWPjqfxZYizXpftUKAF8DPQc6yi3NGWxQ/SpUyGU x4qaC9H3ULNV5udSEKnkdnx8WrnR7w1ZLN8/BxDB1PtJX8GXhFszNHCelv5EVHZS9M7Ziu3 8Dq21ldoRqa70wDnZZnqg== X-UI-Out-Filterresults: notjunk:1; V03:K0:t/7gPeWEiRQ=:KHtNqQDuTSs9Coy4b574pG iR2Qa67VtusjgFV3AJZ0Kkp0sFRg3J/Yly9W44O4LvPbBPDFRJHUq6EhwphmQIbhz5DX9sB1z CJs3h6BLkwFS5y+SemtoBZPiFTHxPbk6QrwwujMZ0XBVCx+HJlf6O5cG6DapHH6g4Xu1thhEY mC0l76b+PWTEsEuelx1sSzIPayiGAgvu3mnrQAUGW/TzNrvzK/KlCYeatqSdy1fmpikaHwJ+U AMTLgXO1wJejNPq7mT14drGyBpocnFHf8FdM7Y2vYGJ05Z2GR5KXq08huTQ3PObNqkBkOAO+J iHjjUmr2Q0QIv5rPmiLYIQGWmFLRdosc4H8SwCXOEM2NuPi//PXHoRBOsjl4ZzRr6JibJcknJ 1u5zd3KdNj3vcZ6ng3VrFhO2CT5tgv0Y46e8wsWlzHl7iNyQNlpE3AQY92Z6KXp9myRWqoybg BrACycwAyvEoPHNZXKOLIK/Ju1ondiBjFD4uFIKk/H2oxS4pJzhRwoyGlJ/CahmBPjuDTRmjG ntGGhBJ8DIknds1Mam+EZ7K4xrLwkVklx++9SLlawWhW4KLJxY3OqYvx7g6itIMQdabKD0biM IzlAzKJnOdA9/N+NpK+wt3sXJreydPfpksYox+RIeYI7+5sUaNcaSvVDjpbQv8QI+/AIi0Ahy zMt88UlmtWdo2d186ToIu2PFenwAuwb6lVvrnRjWQWK7/imxzY94SLiyj9QUAtg4cpaneqkgV Kio66S9eWcIKXhf+MJRyE+IMjACqlQgIhImKUvnQMbiqOukssF6O0YeEaT4IQryaI5222NlG1 6v3rpQTI5ad2bgj4K8tIe1iQCKMBOpVeu+jEbU8y9HK0L3K4JXg8cxY4FRx2u6QmJ5bVV7Qf6 S+9axxpWFSA+R2/oMthg== Subject: [Buildroot] [PATCH 1/1] package/pkg-meson: use pkgconf to find host libraries. 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: Eric Le Bihan Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" meson makes a distinction between 'native' (i.e. host) dependencies and 'host' (i.e. target) dependencies and can use a different pkg-config binary for each case. Currently, pkg-meson only pass the target pkg-config and meson automatically guesses the host pkg-config by searching PATH, which finds host/bin/pkg-config, which is the target pkg-config wrapper script. As a result, meson uses the target pkg-config to find host dependencies, with possibly incorrect results. This patch causes meson to use host/bin/pkgconf directly to find host dependencies, using the apparently recommended method[1] of specifing the PKG_CONFIG environment variable. pkgconf does not know about the target sysroot, so only finds host dependencies. [1] https://github.com/mesonbuild/meson/issues/1849 Signed-off-by: Nicolas Cavallari --- This meson.build snippet: ---------------------------- host_glib = dependency('glib-2.0', native: true, method: 'pkg-config') gdbus_codegen = find_program(host_glib.get_pkgconfig_variable('bindir') + '/gdbus-codegen') ---------------------------- Without the patch, it uses the target .pc file with a prefix of /usr, and finds /usr/bin/gdbus-codegen from the host : Found pkg-config: $OUTPUT/host/bin/pkg-config (1.6.1) Build-time dependency glib-2.0 found: YES 2.62.4 Program /usr/bin/gdbus-codegen found: YES (/usr/bin/gdbus-codegen) For a complete dummy example, use this dummy package: base64 -d << EOF | tar -xJv /Td6WFoAAATm1rRGAgAhARwAAAAQz1jM4Cf/AsJdADgYSJnNF3UkZpejSZiTToh3TmWwjd6v7C8E PXLCFsW1o1RD4pKzYIacUzj5A1VS6TvDBN4+ynQO837jjfHvz6kgAyGryHKoSq7OI71xqrwiX/4W E6a5fnuXGGuPAScuqHa/u88SKGfAOmh1xE5guv5qZcgyhDIB5H5nIQwzyb1trdobmRqUMFT1rT5T sON0C/SB59IEbKITx5ItzheQu7D5erkFYrjhcBV1xNCh0J7uwF5XXF9qVHhlvQyp5AJFF9lSUJB2 eTX5ORhCpcGvO/AAhnnlf4DU8C9a7CFVfTfhP+sgs5T7aC1ymojylvBL5TmkAKCna5hN6Ckzr9qH jKYDXAhwJTuMPZkgSFS8OVXkgKnxDS5vG9Ssg0ueb3G7tIEhxt2ehjMgDPK5N/blHnE1t/ZjXe2Q g/TV83LE/MpUKiTQO7JwZ5+tWmT2WWgxK6fG8ckuhlwXhZmVkjWCw+1uxs0C8FrfZFH1ms5MhEyS 6Zgi0803KfOamnH/k6PtEPVB5G7BCWf/b+6Wfo/ZvPSgSYrpcDMJs5j+3KkUjnfpgCuXYXE5TSmE DcrINQHDLYq3hHWklV0n7bFwS3loEWcti/OKQkjeu/3c4E5c/+IWyJFTeLoKEbrNIPtLOYAvsRf+ FJHYzqQyEWoqgAejX6K/XWclKrFAePkjKTouj10ppv9WENd+KCnK7JErZp2zqKwJeGZcOlHsFJ9C dUTWFgOU3VzsWiYMnxuPHnvYt3uXr6XlFQHA818kZdcJIMvfUPLRNhrBwR893vTd5aw6/tb4EPeR HacNklguWar6H9w69r8KY2yqk9cepySCDkomVGFqmi5gPH9anFGfEKEUJhKNdjMqF44jx76odAOZ ijoW+F9h6qHVQFGSLhxchqcMWgA+0aBVz9My+PoRzIsXEmH+21W9ucie9zPCw3QWVVPxgAAAAACQ pqAPsaqrpAAB3gWAUAAAeb5korHEZ/sCAAAAAARZWg== EOF I tested that the following packages still compile: - libglib2 - gst1-plugins-bad - gst1-plugins-base - gst1-plugins-good - gst1-plugins-ugly - gstreamer1 - libdrm - mesa3d --- package/pkg-meson.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk index e7eea2aa58..349da39369 100644 --- a/package/pkg-meson.mk +++ b/package/pkg-meson.mk @@ -84,7 +84,8 @@ define $(2)_CONFIGURE_CMDS ) \ package/meson/cross-compilation.conf.in \ > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf - PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) $$(MESON) \ + PATH=$$(BR_PATH) PKG_CONFIG=$(HOST_DIR)/bin/pkgconf \ + $$($$(PKG)_CONF_ENV) $$(MESON) \ --prefix=/usr \ --libdir=lib \ --default-library=$(if $(BR2_STATIC_LIBS),static,shared) \