build-system/meson: Add the output directory to RUNPATH.

* guix/build/meson-build-system.scm (configure): Set LDFLAGS before invoking meson.
This commit is contained in:
Marius Bakke 2018-03-09 17:30:22 +01:00
parent 3f6c185e0c
commit 09a45ffb14
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
1 changed files with 9 additions and 0 deletions

View File

@ -46,6 +46,15 @@
,(string-append "--buildtype=" build-type)
,@configure-flags
,source-dir)))
;; Meson lacks good facilities for dealing with RUNPATH, so we
;; add the output "lib" directory here to avoid doing that in
;; many users. Related issues:
;; * <https://github.com/mesonbuild/meson/issues/314>
;; * <https://github.com/mesonbuild/meson/issues/3038>
;; * <https://github.com/NixOS/nixpkgs/issues/31222>
(setenv "LDFLAGS" (string-append "-Wl,-rpath=" out "/lib"))
(mkdir build-dir)
(chdir build-dir)
(zero? (apply system* "meson" args))))