Problem: Guix package definition also installs source files

I have written a package definition for the Texinfo version of the
R7RS-Small standard document
. Now I’ve found that its source files
and the compiled r7rs-small.info output appear directly under my
~/.guix-profile/, e.g. ~/.guix-profile/r7rs-small.info and
~/.guix-profile/appendix-a.texinfo.

What did I do wrong in the definition?

It seems you have not declared the #:install-plan field in the (arguments ...). This is where you declare which files to copy. I have not used this build system myself, but I think it will just copy everything by default if you do not specify an #:install-plan.

I think you probably want to include this argument:

(arguments
 (list
  ;; ... your other arguments ...
  #:install-plan
  #~(list (string-append (getcwd) "/doc/r7rs-small/r7rs-small.info")
          (string-append #$output "/share/info"))
  ;; ... your other arguments ...
  )

I am not 100% sure about this, but I hope this gives you an idea of what to do next. In the documentation for copy-build-system it says this:

To further simplify the file installation process, an #:install-plan argument is exposed to let the packager specify which files go where. The install plan is a list of (source target [filters]). filters are optional.

Examples:

  • ("foo/bar" "share/my-app/"): Install bar to share/my-app/bar.
  • ("foo/bar" "share/my-app/baz"): Install bar to share/my-app/baz.
  • (“foo/” “share/my-app”): Install the content of foo inside share/my-app, e.g., install foo/sub/file to share/my-app/sub/file.
  • ("foo/" "share/my-app" #:include ("sub/file")): Install only foo/sub/file to share/my-app/sub/file.
  • ("foo/sub" "share/my-app" #:include ("file")): Install foo/sub/file to share/my-app/file.

By the way, thanks for letting me know about the existence of this Infodoc version of R7RS-small! I have been using the HTML version I found somwhere, but Infodoc is better integrated into Emacs and is much easier for me to use.

Just sent a patch:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70467

It seems like the team is overworked and underpaid, so it’ll take some time to get into the official Guix channel…

1 Like

Oh, also patched mine own Guix Kakafarm Channel’s r7rs-small-texinfo. I am thinking maybe I should write other targets, like PDF, HTML, EPUB, so the package names will be r7rs-small-pdf, r7rs-small-html, r7rs-small-epub, or somesuch.

1 Like