From d1f687b10cb2482d1a3eedca16b0b3c012fc8b9f Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Thu, 27 Feb 2020 14:27:36 +0100 Subject: nonguix: Add support for $ORIGIN in RPATH. * nonguix/build-system/binary.scm (patchelf): Do it. --- nonguix/build/binary-build-system.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3