build-system: guile: Make #:documentation-file-regexp configurable.

* guix/build/guile-build-system.scm
  (install-documentation): Unset documentation-file-regexp keyword
  default.
  (%documentation-file-regexp): Move variable to...
* guix/build-system/guile.scm
  (%documentation-file-regexp): New variable.
  (guile-build, guile-cross-build): Use it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Nicolas Graves 2025-07-08 11:01:21 +02:00 committed by Ludovic Courtès
parent 9cd3b961e4
commit 8897360fb3
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 9 additions and 7 deletions

View file

@ -33,6 +33,10 @@
;; Regexp to match Scheme files.
"\\.(scm|sls)$")
(define %documentation-file-regexp
;; Regexp to match README files and the likes.
"^(README.*|.*\\.html|.*\\.org|.*\\.md)$")
(define %guile-build-system-modules
;; Build-side modules imported by default.
`((guix build guile-build-system)
@ -85,6 +89,7 @@
(source-directory ".")
not-compiled-file-regexp
(scheme-file-regexp %scheme-file-regexp)
(documentation-file-regexp %documentation-file-regexp)
;; FIXME: Turn on parallel building of Guile modules by
;; default after the non-determinism issues in the Guile byte
;; compiler are resolved (see bug #20272).
@ -104,6 +109,7 @@
#:source #+source
#:source-directory #$source-directory
#:scheme-file-regexp #$scheme-file-regexp
#:documentation-file-regexp #$documentation-file-regexp
#:not-compiled-file-regexp #$not-compiled-file-regexp
#:parallel-build? #$parallel-build?
#:compile-flags #$compile-flags
@ -136,6 +142,7 @@
(phases '%standard-phases)
(source-directory ".")
(scheme-file-regexp %scheme-file-regexp)
(documentation-file-regexp %documentation-file-regexp)
not-compiled-file-regexp
;; FIXME: Turn on parallel building of Guile
;; modules by default after the non-determinism
@ -169,6 +176,7 @@
#:source-directory #$source-directory
#:scheme-file-regexp #$scheme-file-regexp
#:not-compiled-file-regexp #$not-compiled-file-regexp
#:documentation-file-regexp #$documentation-file-regexp
#:parallel-build? #$parallel-build?
#:compile-flags #$compile-flags
#:inputs %build-target-inputs

View file

@ -66,10 +66,6 @@ determined."
;; Regexp to match Scheme files.
"\\.(scm|sls)$")
(define %documentation-file-regexp
;; Regexp to match README files and the likes.
"^(README.*|.*\\.html|.*\\.org|.*\\.md)$")
(define* (set-locale-path #:key inputs native-inputs
#:allow-other-keys)
"Set 'GUIX_LOCPATH'."
@ -212,9 +208,7 @@ installed; this is useful for files that are meant to be included."
#:max-processes (if parallel-build? (parallel-job-count) 1)
#:report-progress report-build-progress))))
(define* (install-documentation #:key outputs
(documentation-file-regexp
%documentation-file-regexp)
(define* (install-documentation #:key outputs documentation-file-regexp
#:allow-other-keys)
"Install files that match DOCUMENTATION-FILE-REGEXP."
(let* ((out (assoc-ref outputs "out"))