Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC PATCH 1/7] pkg-meson: new infrastructure
Date: Tue, 8 May 2018 00:12:44 +0200	[thread overview]
Message-ID: <20180507221244.GC15375@ned> (raw)
In-Reply-To: <20180507214356.3a087000@windsurf>

On 18-05-07 21:43:56, Thomas Petazzoni wrote:
> Hello,
>
> On Mon, 7 May 2018 21:38:50 +0200, Eric Le Bihan wrote:
>
> > > Does this one really needs to be a per-package variable ? It's defined
> > > with "=" so it doesn't even allow a package to customize this value
> > > (but I don't think it would be necessary for packages to customize this
> > > value anyway).
> > >
> > > > +$(2)_NINJA_ENV		?=
> > > > +$(2)_NINJA_OPTS	= $(if $(VERBOSE),-v) -j$(PARALLEL_JOBS)
> > >
> > > Same question for this one.
> >
> > I used variables for ninja executable path and options to avoid
> > cluttering the *_CMDS parts. These are, indeed, not meant to be
> > customized. So, I'll drop them.
>
> You can use variables, but global ones, not per-package ones.
>
> For example
>
> NINJA = $(HOST_DIR)/bin/ninja
> NINJA_OPTS = $(if $(VERBOSE),-v) -j$(PARALLEL_JOBS)
>
> or something like that.

OK.

> > > > +define $(2)_CONFIGURE_CMDS
> > > > +	rm -rf $$($$(PKG)_SRCDIR)/build
> > > > +	mkdir -p $$($$(PKG)_SRCDIR)/build
> > > > +	PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) meson \
> > > > +		--prefix=/usr \
> > > > +		--libdir=/usr/lib \
> > > > +		--default-library $(if $(BR2_STATIC_LIBS),static,shared) \
> > > > +		--buildtype $(if $(BR2_ENABLE_DEBUG),debug,release) \
> > > > +		--cross-file $(HOST_DIR)/etc/meson/cross-compilation.conf \
> > >
> > > So meson is really not consistent, and some options are "--name=value",
> > > and some others are "--name value" ?
> >
> > No. Both patterns are valid for any option. I'll use "--name=value" for
> > consistency.
>
> It would be great to use --name=value everywhere then, including in the
> packages using the meson-package infrastructure. This should perhaps be
> noted in the manual, when describing the <pkg>_CONF_OPTS variable.

The --name=value pattern is used for options related to Meson behavior
and general project configuration, whereas the -Dname=value one is used
for project feature activation/customization. So <pkg>_CONF_OPTS should
most of the time contains elements using the latter (except when
overriding sysconfdir or such locations).

In case of boolean options, Meson assumes that "-Dbaz" means
"-Dbaz=true". Should the example in the infrastructure documentation
look like this:

```
ifeq ($(BR2_PACKAGE_BAZ),y)
FOO_CONF_OPTS += -Dbaz=true
FOO_DEPENDENCIES += baz
else
FOO_CONF_OPTS += -Dbaz=false
endif
```

Or like this:

```
ifeq ($(BR2_PACKAGE_BAZ),y)
FOO_CONF_OPTS += -Dbaz
FOO_DEPENDENCIES += baz
endif
```

> > > DESTDIR=$$(HOST_DIR) is not correct for host installations, since you
> > > already build for prefix=$(HOST_DIR).
> >
> > OK, I'll drop it.
>
> OK. Did you test the host variant of the meson-package infrastructure ?

Good advice! Testing the host variant of a custom library+executable
project brought out that Meson does not automically sets RPATH [1],
which makes support/scripts/check-host-rpath unhappy, and that it
defaults --libdir to "lib64" instead of "lib" [2]. So I'll fix the host
variant accordingly.

[1] http://mesonbuild.com/Reference-manual.html#executable
[2] http://mesonbuild.com/Reference-manual.html#get_option

Regards,

--
ELB

  reply	other threads:[~2018-05-07 22:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-07 10:57 [Buildroot] [RFC PATCH 0/7] Add pkg-meson infrastructure Eric Le Bihan
2018-05-07 10:57 ` [Buildroot] [RFC PATCH 1/7] pkg-meson: new infrastructure Eric Le Bihan
2018-05-07 15:02   ` Thomas Petazzoni
2018-05-07 19:38     ` Eric Le Bihan
2018-05-07 19:43       ` Thomas Petazzoni
2018-05-07 22:12         ` Eric Le Bihan [this message]
2018-05-08 21:00           ` Arnout Vandecappelle
2018-05-09 22:41             ` Eric Le Bihan
2018-05-10  8:40               ` Thomas Petazzoni
2018-05-07 10:57 ` [Buildroot] [RFC PATCH 2/7] docs/manual: document pkg-meson infra Eric Le Bihan
2018-05-07 15:08   ` Thomas Petazzoni
2018-05-07 19:58     ` Eric Le Bihan
2018-05-07 10:57 ` [Buildroot] [RFC PATCH 3/7] libmpdclient: convert to " Eric Le Bihan
2018-05-07 10:57 ` [Buildroot] [RFC PATCH 4/7] systemd: " Eric Le Bihan
2018-05-07 10:57 ` [Buildroot] [RFC PATCH 5/7] ncmpc: " Eric Le Bihan
2018-05-07 10:57 ` [Buildroot] [RFC PATCH 6/7] mpd-mpc: " Eric Le Bihan
2018-05-07 10:57 ` [Buildroot] [RFC PATCH 7/7] enlightenment: " Eric Le Bihan

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=20180507221244.GC15375@ned \
    --to=eric.le.bihan.dev@free.fr \
    --cc=buildroot@busybox.net \
    /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