summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Neidhardt <mail@ambrevar.xyz>2020-02-27 14:27:36 +0100
committerPierre Neidhardt <mail@ambrevar.xyz>2020-02-27 14:28:52 +0100
commitd1f687b10cb2482d1a3eedca16b0b3c012fc8b9f (patch)
treebd04865867452aed5f840b205ff63e3bf6e3e85c
parent0dd7fd26928bcd0284655a206bc1df4b86c6087d (diff)
nonguix: Add support for $ORIGIN in RPATH.
* nonguix/build-system/binary.scm (patchelf): Do it.
-rw-r--r--nonguix/build/binary-build-system.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/nonguix/build/binary-build-system.scm b/nonguix/build/binary-build-system.scm
index 984f38c..71753e1 100644
--- a/nonguix/build/binary-build-system.scm
+++ b/nonguix/build/binary-build-system.scm
@@ -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)
"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 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.
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
(lambda (input-or-output)
(cond
+ ((string=? input-or-output "$ORIGIN")
+ "$ORIGIN")
((assoc-ref outputs input-or-output)
(string-append (assoc-ref outputs input-or-output) "/lib"))
((assoc-ref inputs input-or-output)