From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>,
Norbert Lange <nolange79@gmail.com>,
Samuel Martin <s.martin49@gmail.com>,
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v3 1/1] package/pkg-meson: use meson to build/install packages
Date: Sun, 24 Jul 2022 17:37:36 +0200 [thread overview]
Message-ID: <20220724153736.GY2641@scaer> (raw)
In-Reply-To: <20220722060936.566534-1-james.hilliard1@gmail.com>
James, All,
On 2022-07-22 00:09 -0600, James Hilliard spake thusly:
> As of version 0.54.0 meson has had the ability to build and install
> packages rather than having to run ninja directly as before.
>
> This will allow us to use features such as meson install tags in
> the future which require meson to be used for the installation.
>
> It appears we need to ensure the cmake prefix path is set for the
> meson generated relocatable pkg-config format to work properly.
>
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
[--SNIP--]
> diff --git a/docs/manual/adding-packages-meson.txt b/docs/manual/adding-packages-meson.txt
> index 029c8c2488..c8aed65c2f 100644
> --- a/docs/manual/adding-packages-meson.txt
> +++ b/docs/manual/adding-packages-meson.txt
> @@ -125,8 +125,8 @@ will therefore only use a few of them.
> +c_link_args+, +cpp_args+, +cpp_link_args+, +sys_root+, and
> +pkg_config_libdir+.
>
> -* +FOO_NINJA_ENV+, to specify additional environment variables to pass to
> - +ninja+, meson companion tool in charge of the build operations. By default,
> +* +FOO_MESON_ENV+, to specify additional environment variables to pass to
> + +meson+, meson tool in charge of the build/install operations. By default,
> empty.
IIRC, the topic of what to do about external packages that set their
FOO_NINJA_ENV, was raised in a previous iteration.
I understand that the conclusion was basically "the probability is low,
we don't handle it". This should have been noted in the commit log.
> * +FOO_NINJA_OPTS+, to specify a space-separated list of targets to build. By
Now that we use meson to build and instal, does it still make sense to
have FOO_NINJA_OPTS to be the list of targets to install?
I mean, isn't there a way to tell meson what to install, instead?
[--SNIP--]
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index 3b1db35fb6..4fa620080d 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -90,6 +90,8 @@ define $(2)_CONFIGURE_CMDS
> $$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
> -DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/share/buildroot/toolchainfile.cmake" \
> -DCMAKE_INSTALL_PREFIX="/usr" \
> + -DCMAKE_PREFIX_PATH="$$(STAGING_DIR)/usr" \
> + -DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON \
But doesn't that needs to be in a separate patch? I mean, does it not
make sense opn its own?
[--SNIP--]
> diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
> index 0835e08e3a..de5817d5da 100644
> --- a/package/pkg-meson.mk
> +++ b/package/pkg-meson.mk
[--SNIP--]
> @@ -138,6 +138,7 @@ define $(2)_CONFIGURE_CMDS
> $$(MESON) \
> --prefix=/usr \
> --libdir=lib \
> + --pkgconfig.relocatable \
Please explain what that means and why this is needed in the context of
a target package.
> --default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
> --buildtype=$(if $(BR2_ENABLE_RUNTIME_DEBUG),debug,release) \
> --cross-file=$$($$(PKG)_SRCDIR)/build/cross-compilation.conf \
> @@ -156,10 +157,11 @@ define $(2)_CONFIGURE_CMDS
> mkdir -p $$($$(PKG)_SRCDIR)/build
> $$(HOST_CONFIGURE_OPTS) \
> $$($$(PKG)_CONF_ENV) $$(MESON) \
> - --prefix=$$(HOST_DIR) \
> + --prefix=/ \
It is very weird that host packages are configured with / as prefix, and
then installed in HOST_DIR set as DEST_DIR.
I guess this is working thanks to --pkgconfig.relocatable a few lines
below?
This must be explained in the commit log (and probably a little comment
above $(2)_CONFIGURE_CMDS for host packages.
> --libdir=lib \
> - --sysconfdir=$$(HOST_DIR)/etc \
> - --localstatedir=$$(HOST_DIR)/var \
> + --pkgconfig.relocatable \
> + --sysconfdir=etc \
> + --localstatedir=var \
Ditto for etc and var?
So, to make it easier to follow, I'd change the ordering:
--pkgconfig.relocatable \
--prefix=/ \
--sysconfdir=etc \
--localstatedir=var \
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-07-24 15:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-22 6:09 [Buildroot] [PATCH v3 1/1] package/pkg-meson: use meson to build/install packages James Hilliard
2022-07-24 15:37 ` Yann E. MORIN [this message]
2022-07-24 19:30 ` Arnout Vandecappelle
2022-07-26 4:59 ` James Hilliard
2022-07-26 7:31 ` Arnout Vandecappelle
2022-07-28 1:53 ` James Hilliard
2022-07-24 19:42 ` Arnout Vandecappelle
2022-07-26 5:05 ` James Hilliard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220724153736.GY2641@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=eric.le.bihan.dev@free.fr \
--cc=james.hilliard1@gmail.com \
--cc=nolange79@gmail.com \
--cc=s.martin49@gmail.com \
--cc=thomas.de_schampheleire@nokia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox