Subject: bug#26559: [PATCH] build: emacs: Install only a subset of files.

From: Alex Kost <[email-masked]>
Date: Sat, 22 Apr 2017 22:57:05 +0300

Arun Isaac (2017-04-19 13:05 +0530) wrote:

> * guix/build/emacs-build-system.scm (install): Install files matching
>   #:include while excluding files matching #:exclude.
> * guix/build-system/emacs.scm (emacs-build): Add keyword arguments #:include
>   and #:exclude.
> ---
>  guix/build-system/emacs.scm       |  6 ++++++
>  guix/build/emacs-build-system.scm | 24 +++++++++++++++++++++---
>  2 files changed, 27 insertions(+), 3 deletions(-)
>
> diff --git a/guix/build-system/emacs.scm b/guix/build-system/emacs.scm
> index a7982002b..e6c021c7e 100644
> --- a/guix/build-system/emacs.scm
> +++ b/guix/build-system/emacs.scm
> @@ -83,6 +83,10 @@
>                        (phases '(@ (guix build emacs-build-system)
>                                    %standard-phases))
>                        (outputs '("out"))
> +                      (include ''(".*.el$" ".*.el.in$" "^dir$"
> +                                 ".*.info$" ".*.texi$" ".*.texinfo$"
> +                                 "doc/dir" "doc/*.info$" "doc/*.texi$" "doc/*.texinfo$"))

I think only ".*.el$", ".*.info$", and probably "doc/*.info$" are needed
here.  The rest regexps look useless to me.

Note, however, that 'move-doc' procedure should be adjusted to find info
in "doc" subdir (for "doc/*.info$" regex).

> +                      (exclude ''("^.dir-locals.el$" "^test.el$" "^tests.el$" ".*-test.el$" ".*-tests.el$"))
Don't forget to add ".*-pkg.el" here.

[...]
> -(define* (install #:key outputs #:allow-other-keys)
> +(define* (install #:key outputs
> +                  (include '(".*.el$" ".*.el.in$" "^dir$"
> +                             ".*.info$" ".*.texi$" ".*.texinfo$"
> +                             "^doc/dir" "^doc/*.info$" "^doc/*.texi$" "^doc/*.texinfo$"))
> +                  (exclude '("^.dir-locals.el$" "^test.el$" "^tests.el$" ".*-test.el$" ".*-tests.el$"))

It doesn't look right that these regexps are duplicated in 2 places.
I'm not very familiar with build systems, but what if the
'include'/'exclude' arguments of 'install' procedure would simply be
empty lists?  I think it wouldn't do harm if you leave these regexps
only in 'emacs-build' procedure or would it?

-- 
Alex