Guile module packaging guidelines

When attempting to fix the guile bindings in the gnutls package (c.f. gnutls: fix guile bindings by Thra11 · Pull Request #80206 · NixOS/nixpkgs · GitHub), I didn’t find any documentation about which paths NixOS uses for site packages. Typically, a guile module may take up to three configure flags specifying where to install site packages:
--with-guile-site-dir (typical non-NixOS value: /usr/share/guile/site/2.2)
--with-guile-site-ccache-dir (typical non-NixOS value: /usr/lib/guile/2.2/site-ccache)
--with-guile-site-dir (typical non-NixOS value: /usr/lib/guile/2.2/extensions)

As far as I can tell, for guile to find the files, they must be in one of the subdirectories specified in the guile setup hook:

Assuming the shell hook remains unmodified, there is still the possibility that the 3 types of files can be placed in subdirectories of the specified paths. I don’t know enough about the files in question to know whether having everything in a single directory could cause file conflicts. Most other distros keep them in 3 separate directories.

I propose that we:

  1. Decide/confirm which paths to use for each of the 3 directories
    a. Do we put everything in ${out}/share/guile/site (no ${out}/lib/guile)?
    b. If so, do we separate the 3 different types into subdirectories of share/guile/site?
    c. How do we know whether to use share/guile/site/2.2 instead of share/guile/site?

  2. Add a section to Nixpkgs Users and Contributors Guide

  3. Update any existing packages to follow the guidelines (depending on the chosen policy, there may not be any)

1 Like