-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
Feature Request
It would be great if desc had capabilities to add system requirements to the DESCRIPTION file.
Even better would be a way to ensure that the sysreq is compatible with the rstudio/r-system-requirements database and, if not found in the database an encouraging message to add it to the sysreq db.
Inspired by Posit Package Manager build issue with extendr packages: extendr/rextendr#457
Motivation
In {rextendr} we add "Cargo (Rust's package manager), rustc >= 1.65.0" with a custom function that's a little scary (below). (source)
This function will not effectively handle adding xz as a system requirement to existing DESCRIPTION files
update_description <- function(field, value, desc_path) {
cli::cli_alert_info("Setting {.var {field}} to {.str {value}} in the {.file DESCRIPTION} file.")
desc::desc_set(field, value, file = desc_path)
}
update_sys_reqs <- function(desc_path) {
cur <- "Cargo (Rust's package manager), rustc"
prev <- stringi::stri_trim_both(desc::desc_get("SystemRequirements", file = desc_path)[[1]])
if (is.na(prev)) {
update_description("SystemRequirements", cur, desc_path = desc_path)
} else if (!identical(cur, prev)) {
cli::cli_ul(
c(
"The SystemRequirements field in the {.file DESCRIPTION} file is already set.",
"Please update it manually if needed."
)
)
}
}Metadata
Metadata
Assignees
Labels
No labels