aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-03-09 17:30:22 +0100
committerMarius Bakke <mbakke@fastmail.com>2018-03-12 17:27:07 +0100
commit09a45ffb146fda75b87f89c729c31d1da5bf93da (patch)
tree754ab15a780e1da89619d8454542a964c8e2e406
parent3f6c185e0c2e800efed15761f5769761c8405289 (diff)
downloadgnu-guix-09a45ffb146fda75b87f89c729c31d1da5bf93da.tar
gnu-guix-09a45ffb146fda75b87f89c729c31d1da5bf93da.tar.gz
build-system/meson: Add the output directory to RUNPATH.
* guix/build/meson-build-system.scm (configure): Set LDFLAGS before invoking meson.
-rw-r--r--guix/build/meson-build-system.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/guix/build/meson-build-system.scm b/guix/build/meson-build-system.scm
index 2b92240c52..e8cb5440eb 100644
--- a/guix/build/meson-build-system.scm
+++ b/guix/build/meson-build-system.scm
@@ -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))))