diff options
author | John Kehayias <john.kehayias@protonmail.com> | 2025-02-04 21:33:30 -0500 |
---|---|---|
committer | John Kehayias <john.kehayias@protonmail.com> | 2025-02-09 14:11:39 -0500 |
commit | 26778f221b0eda26eb3bd4a2801bfaca99f37c41 (patch) | |
tree | 755de4d5fc8438e0ffde7d567557e40f867032ba | |
parent | 1df78871489a343f9a9cb4b292b407c30d16f77d (diff) |
nonguix: chromium-binary-build: Extend wrapper-plan syntax.
This commit is similar to a0079cf1bd8ef707ab9e15a0e249cbd34f157ae4 which
allowed patchelf-plan to take entries with an optional path. Here,
wrapper-plan is extended to allow for additional syntax (not just a list of
strings) similar to patchelf-plan. Now, entries can be a list, with the first
the string for the file to be patched and the second a list which is added to
the patchelf-plan.
This allows, for example, to patch RPATH to effectively have $ORIGIN for
binaries that need it, with an entry like `("bin/binary" (("out"
"/lib/Binary")))` common for some chromium-based packages. See followup
commits for these changes to reduce LD_LIBRARY_PATH wrapping in some packages.
* nonguix/build-system/chromium-binary.scm (build-patchelf-plan): Handle
entries in wrapper-plan which are a list so that the cdr is added to
patchelf-plan for the car.
(chromium-binary-build): Update doc string for this change and some basics
which were not documented.
-rw-r--r-- | nonguix/build-system/chromium-binary.scm | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/nonguix/build-system/chromium-binary.scm b/nonguix/build-system/chromium-binary.scm index 874acda3..fa22cd97 100644 --- a/nonguix/build-system/chromium-binary.scm +++ b/nonguix/build-system/chromium-binary.scm @@ -54,7 +54,12 @@ #~(let ((patchelf-inputs (list #$@(map car inputs)))) (map (lambda (file) - (cons file (list patchelf-inputs))) + ;; Either an entry in WRAPPER-PLAN is just a string which can be + ;; used directly, or it is a list where the second element is a + ;; list of additional inputs for patchelf-plan. + (if (list? file) + (cons (car file) (list (append patchelf-inputs (cadr file)))) + (cons file (list patchelf-inputs)))) #$wrapper-plan))) (define* (lower name @@ -163,7 +168,13 @@ (substitutable? #t) allowed-references disallowed-references) - "Build SOURCE using binary-build-system." + "Build SOURCE using binary-build-system. WRAPPER-PLAN is a list of strings for +files which patchelf will add the INPUTS (which implicitly includes the base +packages needed for chromium-based binaries) to RPATH and wrap with needed +environment variables. Optionally, an entry can be a list with the first +entry the file to be patched and the second a list of additional inputs for +patchelf, like PATCHELF-PLAN in binary-build-system. PATCHELF-PLAN itself is +ignored if WRAPPER-PLAN is not '()." (define builder (with-imported-modules imported-modules #~(begin |