gnu: toys: Wrap Guile search paths.

* gnu/packages/package-management.scm (toys)[arguments]<#:phases>: Wrap
Guile search paths.

Change-Id: Ia43318cf81d00e728ed636d2860cdf9609f2d4ed
This commit is contained in:
jgart
2026-04-23 00:21:56 -04:00
parent 96b80b008e
commit 9cf150b28e

View File

@@ -817,7 +817,33 @@ high-performance computing} clusters.")
(list
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'register-guix-extension
(add-after 'unpack 'set-load-paths-in-entry-point
(lambda _
(define load-path
(cons (string-append #$output
"/share/guile/site/"
(target-guile-effective-version))
(parse-path (getenv "GUILE_LOAD_PATH"))))
(define load-compiled-path
(cons (string-append #$output
"/lib/guile/"
(target-guile-effective-version)
"/site-ccache")
(parse-path (getenv "GUILE_LOAD_COMPILED_PATH"))))
(define search-paths-header
`(begin
(set! %load-path
(append (list ,@load-path) %load-path))
(set! %load-compiled-path
(append (list ,@load-compiled-path)
%load-compiled-path))))
(substitute* "guix/extensions/toys.scm"
(("^\\(define-module \\(guix extensions toys\\)")
(string-append
(with-output-to-string
(lambda () (write search-paths-header)))
"\n(define-module (guix extensions toys)")))))
(add-after 'set-load-paths-in-entry-point 'register-guix-extension
(lambda* (#:key outputs #:allow-other-keys)
(let ((ext-path (string-append #$output "/share/guix/extensions")))
(mkdir-p ext-path)