[PATCH weston] build: don't manually parse the weston.ini.in templates

Emil Velikov emil.l.velikov at gmail.com
Mon Jul 2 07:37:52 UTC 2018


Hi All,

Tl;Dr: Silly brain of mine auto-expanded $(foo). Patch might work, but
as Quentin mentioned it won't majority of the time.
Please consider this binned.

On 29 June 2018 at 08:37, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> On Thu, 28 Jun 2018 18:59:01 +0100
> Emil Velikov <emil.l.velikov at gmail.com> wrote:
>
>> On 28 June 2018 at 10:58, Quentin Glidic
>> <sardemff7+wayland at sardemff7.net> wrote:
>> > On 6/27/18 3:04 PM, Emil Velikov wrote:
>> >>
>> >> From: Emil Velikov <emil.velikov at collabora.com>
>> >>
>> >> Adding those to configure.ac ensures that:
>> >>   - the weston.ini files are {re,}generated only when needed
>> >>   - the .in files are shipped in the tarball
>> >>   - all the manual handling of the above can be removed ;-)
>> >
>> >
>> > Did you actually test that?
>> > In configure.ac, "bindir" is "${prefix}/bin" (default value), so you’d end
>> > up with "path=${prefix}/bin/weston-flower", and obviously, it won’t launch.
Weirdly enough, I do actually set the folders passed to configure when
building a local distro package.

Turns out that brain of mine auto-expanded $[prefix}, going foobar
with your comment.
The variable is stored literally, thus patch will work only in corner cases.

Thank you for this.

>> > Also, though it’s not that used, you can override directories at "make"
>> > time.
>> > In the end, Makefile is the only place we know the full usable value for
>> > directories. (Otherwise, the only case it’ll work is when you pass all the
>> > directories as full paths to "./configure".)
>> >
>> Hmm I think a good point is to step back a bit and say how the
>> weston.ini files should be used.
>> Are they meant for builddir only usage (a), are they sort of a
>> template that one should copy (b) or other (c).
>
> I believe the weston.ini files in root and ivi-shell/ directories are
> examples, which could be used as templates for a custom config
> primarily. It would be good if they are correct and usable as is, that
> is, they use the directories used by 'make install' when DESTDIR is
> *not* given. That way a user can copy the file, have a test run that
> works, and then tweak further.
>
> Weston will pick weston.ini from CWD only if it finds it nowhere else,
> see weston.ini.man.
>
Right, I will send a patch later adding a small comment at the top of the files.

 "This file is a drop-in template. See `man weston.ini' for more"

> If weston cannot find any weston.ini, it will still run with built-in
> defaults, which include one launcher icon that should start
> weston-terminal. So there is a precedent of a built-in path already
> that cannot change at install time. (Whether that should rely on PATH
> instead is another question - maybe it should?)
>
Relying on PATH seems reasonable. But it's not my call at the end of the day.

> IMO it would be fine to just remove weston-flower and any client that
> is normally not installed from the example ini files. weston-terminal
> is the most important launcher.
>
AFAICT weston-flower is the only instance that needs a
builddir->install dir fix.
It's one of the base demos.

>> The patch from Emre suggest (b). My current assumption is on the same
>> page, based on the bindir/weston-foo (and friends) instances in
>> weston.ini.in.
>>
>> I wonder if "make allows you to override everything" is not it's bane.
>> Just because you can, don't mean one should.
>> All in all people who thinker with that should really know what they're doing.
>
> If Quentin was referring to DESTDIR only, then there should be no
> problem. DESTDIR is used for installing into a staging tree which
> cannot be executed from. One is expected to copy that into the proper
> $prefix before running is possible.
>
Agreed, DESTDIR in itself should be (and is) fine.
Some illustrations on the "disaster" mentioned earlier.

git clean
./configure
make // implicit all - weston.ini is generated
make bindir=foo install // weston.ini is not regenerated, bindir is ignored

git clean
./configure
make bindir=foo
make install // the previous bindir is used, even when you did not ask for it

git clean
./configure
make bindir=foo install // implicit all, bindir is used

Thanks
Emil


More information about the wayland-devel mailing list