Subject: [bug#30761] [PATCH staging 4/9] build-system/meson: Add the output directory to RUNPATH.

From: Marius Bakke <[email-masked]>
Date: Mon, 12 Mar 2018 14:04:24 +0100

Ludovic Courtès <[email-masked]> writes:

> Marius Bakke <[email-masked]> skribis:
>
>> * guix/build/meson-build-system.scm (configure): Set LDFLAGS before invoking meson.
>
> [...]
>
>> +    (setenv "LDFLAGS" (string-append "-Wl,-rpath=" out "/lib"))
>
> Can we pass them as an argument to ‘meson’ somehow instead of defining a
> global variable?
>
> (For example Autoconf-generated configure scripts can read variable
> definitions passed as arguments:
>
>   ./configure LDFLAGS=foo
>
> That way we don’t have to define the variable globally, which could have
> unintended effects.)
>
> If not, that’s fine.

Unfortunately, this is the only supported way of adding extra linker
flags and similar.

http://mesonbuild.com/howtox.html#set-extra-compiler-and-linker-flags-from-the-outside-when-eg-building-distro-packages

There are some open tickets about being able to specify environment in
build definitions, in which case we might be able to add them there.
But for now, this is the way to go.