summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Kehayias <john.kehayias@protonmail.com>2025-02-04 21:33:30 -0500
committerJohn Kehayias <john.kehayias@protonmail.com>2025-02-09 14:11:39 -0500
commit26778f221b0eda26eb3bd4a2801bfaca99f37c41 (patch)
tree755de4d5fc8438e0ffde7d567557e40f867032ba
parent1df78871489a343f9a9cb4b292b407c30d16f77d (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.scm15
1 files changed, 13 insertions, 2 deletions
diff --git a/nonguix/build-system/chromium-binary.scm b/nonguix/build-system/chromium-binary.scm
index 874acda..fa22cd9 100644
--- a/nonguix/build-system/chromium-binary.scm
+++ b/nonguix/build-system/chromium-binary.scm
@@ -54,7 +54,12 @@
54 #~(let ((patchelf-inputs 54 #~(let ((patchelf-inputs
55 (list #$@(map car inputs)))) 55 (list #$@(map car inputs))))
56 (map (lambda (file) 56 (map (lambda (file)
57 (cons file (list patchelf-inputs))) 57 ;; Either an entry in WRAPPER-PLAN is just a string which can be
58 ;; used directly, or it is a list where the second element is a
59 ;; list of additional inputs for patchelf-plan.
60 (if (list? file)
61 (cons (car file) (list (append patchelf-inputs (cadr file))))
62 (cons file (list patchelf-inputs))))
58 #$wrapper-plan))) 63 #$wrapper-plan)))
59 64
60(define* (lower name 65(define* (lower name
@@ -163,7 +168,13 @@
163 (substitutable? #t) 168 (substitutable? #t)
164 allowed-references 169 allowed-references
165 disallowed-references) 170 disallowed-references)
166 "Build SOURCE using binary-build-system." 171 "Build SOURCE using binary-build-system. WRAPPER-PLAN is a list of strings for
172files which patchelf will add the INPUTS (which implicitly includes the base
173packages needed for chromium-based binaries) to RPATH and wrap with needed
174environment variables. Optionally, an entry can be a list with the first
175entry the file to be patched and the second a list of additional inputs for
176patchelf, like PATCHELF-PLAN in binary-build-system. PATCHELF-PLAN itself is
177ignored if WRAPPER-PLAN is not '()."
167 (define builder 178 (define builder
168 (with-imported-modules imported-modules 179 (with-imported-modules imported-modules
169 #~(begin 180 #~(begin