mirror of
https://https.git.savannah.gnu.org/git/guix.git/
synced 2025-07-15 19:40:46 +02:00
Add (guix build rpath).
* guix/build/rpath.scm: New file. * Makefile.am (MODULES): Add it. * gnu/packages/python.scm (python): Use it; remove local copy of the *rpath* procedures. * gnu/packages/samba.scm (samba): Likewise.
This commit is contained in:
parent
e789d9a80b
commit
3309e3a103
4 changed files with 70 additions and 44 deletions
|
@ -66,34 +66,16 @@
|
|||
|
||||
#:modules ((guix build gnu-build-system)
|
||||
(guix build utils)
|
||||
(ice-9 popen)
|
||||
(ice-9 rdelim)
|
||||
(guix build rpath)
|
||||
(srfi srfi-26))
|
||||
#:imported-modules ((guix build gnu-build-system)
|
||||
(guix build utils)
|
||||
(guix build rpath))
|
||||
|
||||
#:phases
|
||||
(alist-cons-after
|
||||
'strip 'add-lib-to-runpath
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
;; XXX: copied from Samba; TODO: factorize in a module
|
||||
|
||||
(define (file-rpath file)
|
||||
;; Return the RPATH of FILE.
|
||||
(let* ((p (open-pipe* OPEN_READ "patchelf"
|
||||
"--print-rpath" file))
|
||||
(l (read-line p)))
|
||||
(and (zero? (close-pipe p)) l)))
|
||||
|
||||
(define (augment-rpath file dir)
|
||||
;; Add DIR to the RPATH of FILE.
|
||||
(let* ((rpath (file-rpath file))
|
||||
(rpath* (if rpath
|
||||
(string-append dir ":" rpath)
|
||||
dir)))
|
||||
(format #t "~a: changing RPATH from `~a' to `~a'~%"
|
||||
file (or rpath "") rpath*)
|
||||
(zero? (system* "patchelf" "--set-rpath"
|
||||
rpath* file))))
|
||||
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(lib (string-append out "/lib")))
|
||||
;; Add LIB to the RUNPATH of all the executables.
|
||||
|
@ -107,7 +89,7 @@
|
|||
("openssl" ,openssl)
|
||||
("readline" ,readline)
|
||||
("zlib" ,zlib)
|
||||
("patchelf" ,patchelf)))
|
||||
("patchelf" ,patchelf))) ; for (guix build rpath)
|
||||
(native-search-paths
|
||||
(list (search-path-specification
|
||||
(variable "PYTHONPATH")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue