nonguix: Add package-input-grafting.
* nonguix/utils.scm (package-input-grafting): New procedure.
This commit is contained in:
parent
566cf65f9c
commit
419f165cab
|
@ -11,7 +11,8 @@
|
||||||
#:use-module (guix utils)
|
#:use-module (guix utils)
|
||||||
#:use-module (guix packages)
|
#:use-module (guix packages)
|
||||||
#:use-module (gnu services)
|
#:use-module (gnu services)
|
||||||
#:export (with-transformation))
|
#:export (package-input-grafting
|
||||||
|
with-transformation))
|
||||||
|
|
||||||
(define-public (to32 package64)
|
(define-public (to32 package64)
|
||||||
"Build package for i686-linux.
|
"Build package for i686-linux.
|
||||||
|
@ -26,6 +27,34 @@ Only x86_64-linux and i686-linux are supported.
|
||||||
,@(package-arguments package64)))))
|
,@(package-arguments package64)))))
|
||||||
(_ package64)))
|
(_ package64)))
|
||||||
|
|
||||||
|
(define (package-input-grafting replacements)
|
||||||
|
"Return a procedure that, when passed a package, grafts its direct and
|
||||||
|
indirect dependencies, including implicit inputs, according to REPLACEMENTS.
|
||||||
|
REPLACEMENTS is a list of package pairs; the first element of each pair is the
|
||||||
|
package to replace, and the second one is the replacement.
|
||||||
|
|
||||||
|
Name and version of replacement packages will be padded to meet graft
|
||||||
|
requirement."
|
||||||
|
(package-input-rewriting
|
||||||
|
(map (match-lambda
|
||||||
|
((old . new)
|
||||||
|
`(,old . ,(package
|
||||||
|
(inherit old)
|
||||||
|
(replacement
|
||||||
|
(package
|
||||||
|
(inherit new)
|
||||||
|
(name
|
||||||
|
(string-pad-right
|
||||||
|
(package-name new)
|
||||||
|
(string-length (package-name old))
|
||||||
|
#\0))
|
||||||
|
(version
|
||||||
|
(string-pad-right
|
||||||
|
(package-version new)
|
||||||
|
(string-length (package-version old))
|
||||||
|
#\0))))))))
|
||||||
|
replacements)))
|
||||||
|
|
||||||
;; For concerns and direction of improvement, see this thread:
|
;; For concerns and direction of improvement, see this thread:
|
||||||
;; https://lists.gnu.org/archive/html/guix-devel/2024-06/msg00275.html
|
;; https://lists.gnu.org/archive/html/guix-devel/2024-06/msg00275.html
|
||||||
(define* (with-transformation proc obj #:optional (pred package?))
|
(define* (with-transformation proc obj #:optional (pred package?))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user