build-system/meson: Remove RUNPATH workarounds.
* guix/build-system/meson.scm (default-patchelf): Remove. (lower)[build-inputs]: Remove PATCHELF. (meson-build): Don't delete 'fix-runpath' phase on armhf. * guix/build/meson-build-system.scm (configure): Add "--c_link_args" and "-cpp_link_args" instead of setting LDFLAGS. (meson-build): Don't apply 'fix-runpath' phase.
This commit is contained in:
parent
963157f1cc
commit
94eb59fb4a
|
@ -58,12 +58,6 @@
|
||||||
(let ((module (resolve-interface '(gnu packages build-tools))))
|
(let ((module (resolve-interface '(gnu packages build-tools))))
|
||||||
(module-ref module 'meson-for-build)))
|
(module-ref module 'meson-for-build)))
|
||||||
|
|
||||||
(define (default-patchelf)
|
|
||||||
"Return the default patchelf package."
|
|
||||||
;; Lazily resolve the binding to avoid a circular dependency.
|
|
||||||
(let ((module (resolve-interface '(gnu packages elf))))
|
|
||||||
(module-ref module 'patchelf)))
|
|
||||||
|
|
||||||
(define* (lower name
|
(define* (lower name
|
||||||
#:key source inputs native-inputs outputs system target
|
#:key source inputs native-inputs outputs system target
|
||||||
(meson (default-meson))
|
(meson (default-meson))
|
||||||
|
@ -81,15 +75,6 @@
|
||||||
(system system)
|
(system system)
|
||||||
(build-inputs `(("meson" ,meson)
|
(build-inputs `(("meson" ,meson)
|
||||||
("ninja" ,ninja)
|
("ninja" ,ninja)
|
||||||
;; 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))
|
,@native-inputs))
|
||||||
(host-inputs `(,@(if source
|
(host-inputs `(,@(if source
|
||||||
`(("source" ,source))
|
`(("source" ,source))
|
||||||
|
@ -147,10 +132,7 @@ has a 'meson.build' file."
|
||||||
#:inputs %build-inputs
|
#:inputs %build-inputs
|
||||||
#:search-paths ',(map search-path-specification->sexp
|
#:search-paths ',(map search-path-specification->sexp
|
||||||
search-paths)
|
search-paths)
|
||||||
#:phases
|
#:phases build-phases
|
||||||
(if (string-prefix? "arm" ,system)
|
|
||||||
(modify-phases build-phases (delete 'fix-runpath))
|
|
||||||
build-phases)
|
|
||||||
#:configure-flags ,configure-flags
|
#:configure-flags ,configure-flags
|
||||||
#:build-type ,build-type
|
#:build-type ,build-type
|
||||||
#:tests? ,tests?
|
#:tests? ,tests?
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
|
;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
|
||||||
|
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -44,18 +45,13 @@
|
||||||
(prefix (assoc-ref outputs "out"))
|
(prefix (assoc-ref outputs "out"))
|
||||||
(args `(,(string-append "--prefix=" prefix)
|
(args `(,(string-append "--prefix=" prefix)
|
||||||
,(string-append "--buildtype=" build-type)
|
,(string-append "--buildtype=" build-type)
|
||||||
|
,(string-append "-Dc_link_args=-Wl,-rpath="
|
||||||
|
(assoc-ref outputs "out") "/lib")
|
||||||
|
,(string-append "-Dcpp_link_args=-Wl,-rpath="
|
||||||
|
(assoc-ref outputs "out") "/lib")
|
||||||
,@configure-flags
|
,@configure-flags
|
||||||
,source-dir)))
|
,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>
|
|
||||||
(unless (getenv "LDFLAGS")
|
|
||||||
(setenv "LDFLAGS" (string-append "-Wl,-rpath=" out "/lib")))
|
|
||||||
|
|
||||||
(mkdir build-dir)
|
(mkdir build-dir)
|
||||||
(chdir build-dir)
|
(chdir build-dir)
|
||||||
(apply invoke "meson" args)))
|
(apply invoke "meson" args)))
|
||||||
|
@ -148,8 +144,13 @@ for example libraries only needed for the tests."
|
||||||
(replace 'configure configure)
|
(replace 'configure configure)
|
||||||
(replace 'build build)
|
(replace 'build build)
|
||||||
(replace 'check check)
|
(replace 'check check)
|
||||||
(replace 'install install)
|
;; XXX: We used to have 'fix-runpath' here, but it appears no longer
|
||||||
(add-after 'strip 'fix-runpath fix-runpath)))
|
;; necessary with newer Meson. However on 'core-updates' there is a
|
||||||
|
;; useful 'strip-runpath' procedure to ensure no bogus directories in
|
||||||
|
;; RUNPATH (remember that we tell Meson to not touch RUNPATH in
|
||||||
|
;; (@ (gnu packages build-tools) meson-for-build)), so it should be
|
||||||
|
;; re-added there sans the augment-rpath calls (which are not needed).
|
||||||
|
(replace 'install install)))
|
||||||
|
|
||||||
(define* (meson-build #:key inputs phases
|
(define* (meson-build #:key inputs phases
|
||||||
#:allow-other-keys #:rest args)
|
#:allow-other-keys #:rest args)
|
||||||
|
|
Loading…
Reference in New Issue