nonguix: Add support for $ORIGIN in RPATH.

* nonguix/build-system/binary.scm (patchelf): Do it.
This commit is contained in:
Pierre Neidhardt 2020-02-27 14:27:36 +01:00
parent 0dd7fd2692
commit d1f687b10c

View File

@ -73,10 +73,12 @@ represent the target full path, which only makes sense for single files."
(define* (patchelf #:key inputs outputs patchelf-plan #:allow-other-keys) (define* (patchelf #:key inputs outputs patchelf-plan #:allow-other-keys)
"Set the interpreter and the RPATH of files as per the PATCHELF-PLAN. "Set the interpreter and the RPATH of files as per the PATCHELF-PLAN.
The PATCHELF-PLAN elements are lists of: The PATCHELF-PLAN elements are lists of pairs:
- The file to patch. - The file to patch.
- The inputs (as strings) to include in the rpath, e.g. \"mesa\". - The inputs (as strings) to include in the rpath, e.g. \"mesa\".
It can also be an output, e.g. \"out\", or \"$ORIGIN\", which in RPATH
parlance means the library directory.
Both executables and dynamic libraries are accepted. Both executables and dynamic libraries are accepted.
The inputs are optional when the file is an executable." The inputs are optional when the file is an executable."
@ -90,6 +92,8 @@ The inputs are optional when the file is an executable."
(map (map
(lambda (input-or-output) (lambda (input-or-output)
(cond (cond
((string=? input-or-output "$ORIGIN")
"$ORIGIN")
((assoc-ref outputs input-or-output) ((assoc-ref outputs input-or-output)
(string-append (assoc-ref outputs input-or-output) "/lib")) (string-append (assoc-ref outputs input-or-output) "/lib"))
((assoc-ref inputs input-or-output) ((assoc-ref inputs input-or-output)