build-system: glib-or-gtk: Improve glib-or-gtk-cross-build style.

* guix/build-system/glib-or-gtk.scm
(glib-or-gtk-cross-build): Use with-imported-modules around the
glib-or-gtk-cross-build builder gexp.

Change-Id: I8eaa032ffc0a3f8dbf02c96a4ecee85475c32111
Signed-off-by: Christopher Baines <mail@cbaines.net>
This commit is contained in:
Nicolas Graves 2025-04-25 11:26:31 +02:00 committed by Christopher Baines
parent aa7b1abf2c
commit 4c4e29cebb
No known key found for this signature in database
GPG key ID: 5E28A33B0B84F577

View file

@ -225,55 +225,55 @@
disallowed-references) disallowed-references)
"Cross-build SOURCE with INPUTS. See GNU-BUILD for more details." "Cross-build SOURCE with INPUTS. See GNU-BUILD for more details."
(define builder (define builder
#~(begin (with-imported-modules imported-modules
(use-modules #$@(sexp->gexp modules)) #~(begin
(use-modules #$@(sexp->gexp modules))
(define %build-host-inputs (define %build-host-inputs
#+(input-tuples->gexp build-inputs)) #+(input-tuples->gexp build-inputs))
(define %build-target-inputs (define %build-target-inputs
(append #$(input-tuples->gexp host-inputs) (append #$(input-tuples->gexp host-inputs)
#+(input-tuples->gexp target-inputs))) #+(input-tuples->gexp target-inputs)))
(define %build-inputs (define %build-inputs
(append %build-host-inputs %build-target-inputs)) (append %build-host-inputs %build-target-inputs))
(define %outputs (define %outputs
#$(outputs->gexp outputs)) #$(outputs->gexp outputs))
(glib-or-gtk-build #:source #+source
#:system #$system
#:build #$build
#:target #$target
#:outputs %outputs
#:inputs %build-target-inputs
#:native-inputs %build-host-inputs
#:search-paths '#$(sexp->gexp
(map search-path-specification->sexp
search-paths))
#:native-search-paths '#$(sexp->gexp
(map search-path-specification->sexp
native-search-paths))
#:phases #$(if (pair? phases)
(sexp->gexp phases)
phases)
#:glib-or-gtk-wrap-excluded-outputs
#$glib-or-gtk-wrap-excluded-outputs
#:configure-flags #$configure-flags
#:make-flags #$make-flags
#:out-of-source? #$out-of-source?
#:tests? #$tests?
#:test-target #$test-target
#:parallel-build? #$parallel-build?
#:parallel-tests? #$parallel-tests?
#:validate-runpath? #$validate-runpath?
#:make-dynamic-linker-cache? #$make-dynamic-linker-cache?
#:patch-shebangs? #$patch-shebangs?
#:strip-binaries? #$strip-binaries?
#:strip-flags #$strip-flags
#:strip-directories
#$strip-directories)))
(glib-or-gtk-build #:source #+source
#:system #$system
#:build #$build
#:target #$target
#:outputs %outputs
#:inputs %build-target-inputs
#:native-inputs %build-host-inputs
#:search-paths '#$(sexp->gexp
(map search-path-specification->sexp
search-paths))
#:native-search-paths '#$(sexp->gexp
(map search-path-specification->sexp
native-search-paths))
#:phases #$(if (pair? phases)
(sexp->gexp phases)
phases)
#:glib-or-gtk-wrap-excluded-outputs
#$glib-or-gtk-wrap-excluded-outputs
#:configure-flags #$configure-flags
#:make-flags #$make-flags
#:out-of-source? #$out-of-source?
#:tests? #$tests?
#:test-target #$test-target
#:parallel-build? #$parallel-build?
#:parallel-tests? #$parallel-tests?
#:validate-runpath? #$validate-runpath?
#:make-dynamic-linker-cache? #$make-dynamic-linker-cache?
#:patch-shebangs? #$patch-shebangs?
#:strip-binaries? #$strip-binaries?
#:strip-flags #$strip-flags
#:strip-directories
#$strip-directories))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile)) (mlet %store-monad ((guile (package->derivation (or guile (default-guile))
system #:graft? #f))) system #:graft? #f)))
@ -281,7 +281,6 @@
#:system system #:system system
#:target target #:target target
#:graft? #f #:graft? #f
#:modules imported-modules
#:allowed-references allowed-references #:allowed-references allowed-references
#:disallowed-references disallowed-references #:disallowed-references disallowed-references
#:guile-for-build guile))) #:guile-for-build guile)))