Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #224: added sites managment. #229

Merged
merged 1 commit into from
Jul 19, 2024
Merged

Conversation

Ninjapouet
Copy link

@Ninjapouet Ninjapouet commented Jul 15, 2024

It adds a [sites] section in packages' description. In this section, one can declare the sites to use and what files must be installed in it. As we follow the general dune semantic, only the following root sites are available:

  • lib
  • bin
  • sbin
  • toplevel
  • share
  • etc
  • stublibs
  • doc
  • man

Each of those fields takes an array of site specification with the following fields:

  • root: a flag indicating if we use the root section or not (only for lib and share, default is false)
  • exec: a flag indicating if files installed in this site must have the executable flag set
  • dir: the directory name of the site
  • install: the files to be installed in this site.

The installation specification is a table with the following fields:

  • source: the source file, directory or glob to install
  • destination: where to install source
  • recursive: recursively install the subdirectories.

For example,

[[sites.share]]
dir = "www"
[[sites.share.install]]
source = "javascript/*.js"
destination = "js"

will install all javascript files in the javascript dir of the package into <prefix>/share/<package>/www/js directory.

The custom installed files are dynamically available at runtime through the module Sites. The module name can be changed
with the field name of section sites. The module itself exports an inner Sites module with values corresponding to the files
installed. With the previous example :

[sites]
name = "mysites"

Will provide the value Mysites.Sites.www which is a list of the installed javascript files.

@Ninjapouet
Copy link
Author

Missing documentation at least, this is just for general approval.

@Ninjapouet
Copy link
Author

This PR needs drom-share corresponding MR

@Ninjapouet
Copy link
Author

Added documentation.

@Ninjapouet Ninjapouet changed the base branch from master to next July 17, 2024 08:35
@Ninjapouet Ninjapouet added the enhancement New feature or request label Jul 17, 2024
@Ninjapouet
Copy link
Author

I'm not very satisfied with it because sites has meaning only for installing files so we need to handle both sites and installation rules.

@Ninjapouet
Copy link
Author

Added the installation rules.

@Ninjapouet
Copy link
Author

Changed version guard to 0.9.3, the future next version.

@Ninjapouet Ninjapouet linked an issue Jul 19, 2024 that may be closed by this pull request
@Ninjapouet Ninjapouet marked this pull request as ready for review July 19, 2024 08:59
@lefessan lefessan merged commit 865cffe into OCamlPro:next Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle sites
2 participants