aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
Diffstat (limited to 'guix')
-rw-r--r--guix/build-system/meson.scm18
-rw-r--r--guix/build/meson-build-system.scm9
2 files changed, 24 insertions, 3 deletions
diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm
index d7754e460a..529a2b8b0f 100644
--- a/guix/build-system/meson.scm
+++ b/guix/build-system/meson.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
+;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -80,8 +81,15 @@
(system system)
(build-inputs `(("meson" ,meson)
("ninja" ,ninja)
- ;; Add patchelf for (guix build rpath) to work.
- ("patchelf" ,(default-patchelf))
+ ;; XXX PatchELF fails to build on armhf, so we skip
+ ;; the 'fix-runpath' phase there for now. It is used
+ ;; to avoid superfluous entries in RUNPATH as described
+ ;; in <https://bugs.gnu.org/28444#46>, so armhf may now
+ ;; have different runtime dependencies from other arches.
+ ,@(if (not (string-prefix? "arm" (or (%current-target-system)
+ (%current-system))))
+ `(("patchelf" ,(default-patchelf)))
+ '())
,@native-inputs))
(host-inputs `(,@(if source
`(("source" ,source))
@@ -139,7 +147,11 @@ has a 'meson.build' file."
#:inputs %build-inputs
#:search-paths ',(map search-path-specification->sexp
search-paths)
- #:phases build-phases
+ #:phases
+ (if (string-prefix? "arm" ,(or (%current-target-system)
+ (%current-system)))
+ (modify-phases build-phases (delete 'fix-runpath))
+ build-phases)
#:configure-flags ,configure-flags
#:build-type ,build-type
#:tests? ,tests?
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))))