├── .Rbuildignore ├── .gitignore ├── .travis.yml ├── DESCRIPTION ├── LICENSE ├── NAMESPACE ├── NEWS.md ├── R ├── commands.R ├── deps.R ├── download.R ├── json.R ├── onLoad.R ├── package.R ├── platform.R ├── sysreqs.R ├── urls.R └── utils.R ├── README.md ├── man ├── get_cran_deps.Rd ├── get_cran_sysreqs.Rd ├── sysreq_commands.Rd └── sysreqs.Rd └── tests ├── testthat.R └── testthat └── test.R /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^Makefile$ 4 | ^README.Rmd$ 5 | ^.travis.yml$ 6 | ^appveyor.yml$ 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | *.Rproj 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | ## Sample .travis.yml file for use with metacran/r-builder 2 | ## See https://github.com/metacran/r-builder for details. 3 | 4 | language: c 5 | sudo: required 6 | 7 | before_install: 8 | - curl -OL https://raw.githubusercontent.com/metacran/r-builder/master/pkg-build.sh 9 | - chmod 755 pkg-build.sh 10 | - ./pkg-build.sh bootstrap 11 | 12 | install: 13 | - ./pkg-build.sh install_deps 14 | 15 | script: 16 | - ./pkg-build.sh run_tests 17 | 18 | after_failure: 19 | - ./pkg-build.sh dump_logs 20 | 21 | notifications: 22 | email: 23 | on_success: change 24 | on_failure: change 25 | 26 | env: 27 | matrix: 28 | - RVERSION=oldrel 29 | - RVERSION=release 30 | - RVERSION=devel 31 | 32 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: sysreqs 2 | Title: Install SystemRequirements of Packages 3 | Version: 1.0.0.9000 4 | Author: Gabor Csardi 5 | Maintainer: Gabor Csardi 6 | Description: Automatically download and install system requirements of R packages. 7 | License: MIT + file LICENSE 8 | LazyData: true 9 | URL: https://github.com/r-hub/sysreqs 10 | BugReports: https://github.com/r-hub/sysreqs/issues 11 | RoxygenNote: 5.0.1.9000 12 | Suggests: 13 | testthat 14 | Imports: 15 | debugme, 16 | desc, 17 | tools, 18 | utils 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2016 2 | COPYRIGHT HOLDER: R Consortium 3 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(current_platform) 4 | export(detect_platform) 5 | export(sysreq_commands) 6 | export(sysreqs) 7 | importFrom(desc,description) 8 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | 2 | # 1.0.0 3 | 4 | First public release. 5 | -------------------------------------------------------------------------------- /R/commands.R: -------------------------------------------------------------------------------- 1 | 2 | #' Command(s) to install system requirements of a package, on a platform 3 | #' 4 | #' @inheritParams sysreqs 5 | #' @return Character scalar, a shell command to run to install 6 | #' the system requirements on a given platform. 7 | #' 8 | #' @export 9 | 10 | sysreq_commands <- function(desc, platform = current_platform(), 11 | soft = TRUE) { 12 | 13 | pkgs <- sysreqs(desc, platform, soft = soft) 14 | 15 | url <- make_url( 16 | sysreqs_platform_url, 17 | platform = platform 18 | ) 19 | 20 | cmd <- download_json(url)[["install-commands"]] 21 | 22 | pkgs <- unique(pkgs) 23 | 24 | scripts <- grep("^script: ", pkgs, value = TRUE) 25 | pkgs <- setdiff(pkgs, scripts) 26 | 27 | script_inst <- if (length(scripts)) { 28 | files <- gsub("^script: ", "", scripts) 29 | paste0( 30 | sprintf("bash <(curl -L -s %s/script/%s)", sysreqs_base_url, files), 31 | collapse = "\n" 32 | ) 33 | } 34 | 35 | pkg_inst <- if (length(pkgs)) { 36 | pkgs_str <- paste(pkgs, collapse = " ") 37 | sub("${sysreqs}", pkgs_str, cmd, fixed = TRUE) 38 | } 39 | 40 | if (length(script_inst) + length(pkg_inst) > 0) { 41 | str_trim(paste(pkg_inst, script_inst, sep = "\n")) 42 | } else { 43 | "" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /R/deps.R: -------------------------------------------------------------------------------- 1 | 2 | #' Recursive (hard) dependencies of CRAN packages 3 | #' 4 | #' @param packages Character vector of package names. 5 | #' @return A character vector of package names and versions, 6 | #' separated by a single dash. 7 | #' 8 | #' @keywords internal 9 | 10 | get_cran_deps <- function(packages) { 11 | 12 | if (length(packages) == 0) { 13 | character() 14 | } 15 | 16 | db <- utils::available.packages() 17 | 18 | deps <- tools::package_dependencies( 19 | packages, 20 | recursive = TRUE, 21 | which = c("Depends", "Imports", "LinkingTo"), 22 | db = db 23 | ) 24 | 25 | # Get rid of base packages 26 | deps <- unique(c(packages, unlist(deps, use.names = FALSE))) 27 | base <- rownames(utils::installed.packages(priority = "base")) 28 | deps <- setdiff(deps, base) 29 | 30 | deps 31 | } 32 | -------------------------------------------------------------------------------- /R/download.R: -------------------------------------------------------------------------------- 1 | 2 | download <- function(url, quiet = TRUE) { 3 | 4 | "!DEBUG Downloading `url`" 5 | path <- tempfile() 6 | 7 | status <- utils::download.file( 8 | url, 9 | path, 10 | method = download_method(), 11 | quiet = quiet, 12 | mode = "wb" 13 | ) 14 | 15 | if (status != 0) stop("Cannot download file from ", url, call. = FALSE) 16 | 17 | path 18 | } 19 | 20 | download_method <- function() { 21 | 22 | if (isTRUE(unname(capabilities("libcurl")))) { 23 | "libcurl" 24 | 25 | } else if (os_type() == "windows") { 26 | "wininet" 27 | 28 | } else { 29 | "auto" 30 | } 31 | } 32 | 33 | download_json <- function(url, quiet = TRUE) { 34 | 35 | path <- download(url, quiet = quiet) 36 | 37 | content <- fromJSONFile(path) 38 | 39 | unlink(path) 40 | 41 | content 42 | } 43 | -------------------------------------------------------------------------------- /R/json.R: -------------------------------------------------------------------------------- 1 | 2 | tokenize_json <- function(text) { 3 | text <- paste(text, collapse = "\n") 4 | 5 | ESCAPE <- '(\\\\[^u[:cntrl:]]|\\\\u[0-9a-fA-F]{4})' 6 | CHAR <- '[^[:cntrl:]"\\\\]' 7 | 8 | STRING <- paste0('"', CHAR, '*(', ESCAPE, CHAR, '*)*"') 9 | NUMBER <- "-?(0|[1-9][0-9]*)([.][0-9]*)?([eE][+-]?[0-9]*)?" 10 | KEYWORD <- 'null|false|true' 11 | SPACE <- '[[:space:]]+' 12 | 13 | match <- gregexpr( 14 | pattern = paste0( 15 | STRING, "|", NUMBER, "|", KEYWORD, "|", SPACE, "|", "." 16 | ), 17 | text = text, 18 | perl = TRUE 19 | ) 20 | 21 | grep("^\\s+$", regmatches(text, match)[[1]], value = TRUE, invert = TRUE) 22 | } 23 | 24 | throw <- function(...) { 25 | stop("JSON: ", ..., call. = FALSE) 26 | } 27 | 28 | fromJSONFile <- function(filename) { 29 | fromJSON(readLines(filename, warn = FALSE)) 30 | } 31 | 32 | fromJSON <- function(text) { 33 | 34 | tokens <- tokenize_json(text) 35 | token <- NULL 36 | ptr <- 1 37 | 38 | read_token <- function() { 39 | if (ptr <= length(tokens)) { 40 | token <<- tokens[ptr] 41 | ptr <<- ptr + 1 42 | } else { 43 | token <<- 'EOF' 44 | } 45 | } 46 | 47 | parse_value <- function(name = "") { 48 | if (token == "{") { 49 | parse_object() 50 | } else if (token == "[") { 51 | parse_array() 52 | } else if (token == "EOF" || (nchar(token) == 1 && ! token %in% 0:9)) { 53 | throw("EXPECTED value GOT ", token) 54 | } else { 55 | j2r(token) 56 | } 57 | } 58 | 59 | parse_object <- function() { 60 | res <- structure(list(), names = character()) 61 | 62 | read_token() 63 | 64 | ## Invariant: we are at the beginning of an element 65 | while (token != "}") { 66 | 67 | ## "key" 68 | if (grepl('^".*"$', token)) { 69 | key <- j2r(token) 70 | } else { 71 | throw("EXPECTED string GOT ", token) 72 | } 73 | 74 | ## : 75 | read_token() 76 | if (token != ":") { throw("EXPECTED : GOT ", token) } 77 | 78 | ## value 79 | read_token() 80 | res[key] <- list(parse_value()) 81 | 82 | ## } or , 83 | read_token() 84 | if (token == "}") { 85 | break 86 | } else if (token != ",") { 87 | throw("EXPECTED , or } GOT ", token) 88 | } 89 | read_token() 90 | } 91 | 92 | res 93 | } 94 | 95 | parse_array <- function() { 96 | res <- list() 97 | 98 | read_token() 99 | 100 | ## Invariant: we are at the beginning of an element 101 | while (token != "]") { 102 | ## value 103 | res <- c(res, list(parse_value())) 104 | 105 | ## ] or , 106 | read_token() 107 | if (token == "]") { 108 | break 109 | } else if (token != ",") { 110 | throw("EXPECTED , GOT ", token) 111 | } 112 | read_token() 113 | } 114 | 115 | res 116 | } 117 | 118 | read_token() 119 | parse_value(tokens) 120 | } 121 | 122 | j2r <- function(token) { 123 | if (token == "null") { 124 | NULL 125 | } else if (token == "true") { 126 | TRUE 127 | } else if (token == "false") { 128 | FALSE 129 | } else if (grepl('^".*"$', token)) { 130 | trimq(token) 131 | } else { 132 | as.numeric(token) 133 | } 134 | } 135 | 136 | trimq <- function(x) { 137 | sub('^"(.*)"$', "\\1", x) 138 | } 139 | -------------------------------------------------------------------------------- /R/onLoad.R: -------------------------------------------------------------------------------- 1 | 2 | .onLoad <- function(libname, pkgname) { 3 | debugme::debugme() 4 | } 5 | -------------------------------------------------------------------------------- /R/package.R: -------------------------------------------------------------------------------- 1 | 2 | #' Install SystemRequirements of Packages 3 | #' 4 | #' Automatically download and install system requirements of R packages. 5 | #' 6 | #' @docType package 7 | #' @name sysreqs 8 | NULL 9 | -------------------------------------------------------------------------------- /R/platform.R: -------------------------------------------------------------------------------- 1 | 2 | #' @export 3 | 4 | current_platform <- function() { 5 | env_var <- Sys.getenv("RHUB_PLATFORM") 6 | if (! identical(env_var, "")) { 7 | env_var 8 | } else { 9 | detect_platform() 10 | } 11 | } 12 | 13 | ## Tries to reliably detect CRAN platforms for now 14 | ## 2016-02-26 16:49 GMT 15 | ## 16 | ## r-devel-linux-x86_64-debian-gcc 17 | ## r-devel-linux-x86_64-fedora-clang 18 | ## r-devel-linux-x86_64-fedora-gcc 19 | ## r-devel-osx-x86_64-clang 20 | ## r-devel-windows-ix86+x86_64 21 | ## r-patched-linux-x86_64 22 | ## r-patched-solaris-sparc 23 | ## r-patched-solaris-x86 24 | ## r-release-linux-x86_64 25 | ## r-release-osx-x86_64-mavericks 26 | ## r-release-windows-ix86+x86_64 27 | ## r-oldrel-windows-ix86+x86_64 28 | 29 | #' @export 30 | 31 | detect_platform <- function() { 32 | 33 | rver <- detect_r_version() 34 | os <- detect_os() 35 | comp <- detect_compiler() 36 | arch <- detect_arch(os) 37 | pkgtype <- detect_pkgtype(os) 38 | 39 | platform <- paste( 40 | sep = "-", 41 | rver, 42 | os, 43 | arch 44 | ) 45 | 46 | ## r-devel-linux-x86_64-debian-gcc 47 | ## r-devel-linux-x86_64-fedora-clang 48 | ## r-devel-linux-x86_64-fedora-gcc 49 | if (rver == "r-devel" && os == "linux") { 50 | platform <- paste( 51 | sep = "-", 52 | platform, 53 | detect_linux_distrib(), 54 | comp 55 | ) 56 | } 57 | 58 | ## r-devel-osx-x86_64-clang 59 | if (rver == "r-devel" && os == "osx") { 60 | platform <- paste(platform, sep = "-", comp) 61 | } 62 | 63 | ## r-release-osx-x86_64-mavericks 64 | ## I am not completely sure what this is, btw. 65 | if (rver == "r-release" && os == "osx" && pkgtype == "mavericks") { 66 | platform <- paste(platform, sep = "-", "mavericks") 67 | } 68 | 69 | platform 70 | } 71 | 72 | ## This is dummy, not a real detection 73 | 74 | detect_arch <- function(os = detect_os()) { 75 | if (os == "linux") { 76 | "x86_64" 77 | } else if (os == "windows") { 78 | "ix86+x86_64" 79 | } else if (os == "osx") { 80 | "x86_64" 81 | } else if (os == "solaris") { 82 | .Platform$r_arch 83 | } else { 84 | NA_character_ 85 | } 86 | } 87 | 88 | ## Again, this is a dummy 89 | detect_pkgtype <- function(os = detect_os()) { 90 | if (os == "osx") { 91 | if (grepl("mavericks", .Platform$pkgType)) "mavericks" else "" 92 | } else { 93 | "" 94 | } 95 | } 96 | 97 | detect_r_version <- function() { 98 | 99 | release <- which_r_version("r-release") 100 | oldrel <- which_r_version("r-oldrel") 101 | myself <- my_r_version() 102 | 103 | if (grepl("Under development", R.version$status)) { 104 | "r-devel" 105 | } else if (grepl("Patched", R.version$status) && myself == release) { 106 | "r-patched" 107 | } else if (R.version$status == "RC") { 108 | NA_character_ 109 | } else if (R.version$status == "" && myself == release) { 110 | "r-release" 111 | } else if (R.version$status == "" && myself == oldrel) { 112 | "r-oldrel" 113 | } else { 114 | NA_character_ 115 | } 116 | } 117 | 118 | which_r_version <- function(str) { 119 | url <- make_url(rversions_url, version = str) 120 | download_json(url)[[1]]$version 121 | } 122 | 123 | my_r_version_string <- function(str) { 124 | paste(R.version$major, sep = ".", R.version$minor) 125 | } 126 | 127 | my_r_version <- function() { 128 | paste(R.version$major, sep = ".", R.version$minor) 129 | } 130 | 131 | detect_os <- function() { 132 | 133 | ostype <- os_type() 134 | sysname <- Sys.info()["sysname"] 135 | if (ostype == "windows") { 136 | "windows" 137 | } else if (sysname == "Darwin") { 138 | "osx" 139 | } else if (sysname == "Linux") { 140 | "linux" 141 | } else if (sysname == "Solaris") { 142 | "solaris" 143 | } else { 144 | stop("sysreqs is not supported on your platform") 145 | } 146 | } 147 | 148 | detect_compiler <- function(os = detect_os()) { 149 | if (os %in% c("windows", "solaris")) { 150 | "" 151 | } else { 152 | Makeconf <- readLines(file.path(R.home("etc"), "Makeconf")) 153 | ccline <- grep("^CC[ ]?=", Makeconf, value = TRUE) 154 | sub("^CC[ ]?=[ ]?", "", ccline) 155 | } 156 | } 157 | 158 | detect_linux_distrib <- function(os = detect_os()) { 159 | if (os != "linux") return(NA_character_) 160 | 161 | if (file.exists("/etc/lsb-release") && 162 | grepl("DISTRIB ID=Ubuntu", readLines("/etc/lsb-release"))) { 163 | "ubuntu" 164 | } else if (file.exists("/etc/debian_release")) { 165 | "debian" 166 | } else if (file.exists("/etc/fedora-release")) { 167 | "fedora" 168 | } else { 169 | NA_character_ 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /R/sysreqs.R: -------------------------------------------------------------------------------- 1 | 2 | #' Get the system requirements of a CRAN package 3 | #' 4 | #' @param package Package name. 5 | #' @param platform Platform string. Defaults to the current platform. 6 | #' @return All system dependencies on the current or the specified 7 | #' platform. 8 | #' 9 | #' @keywords internal 10 | 11 | get_cran_sysreqs <- function(package, platform = current_platform()) { 12 | 13 | if (!length(package)) return(character()) 14 | 15 | package <- paste(package, collapse = ",") 16 | url <- make_url(sysreqs_cran_url, package = package, platform = platform) 17 | 18 | unlist(download_json(url)) 19 | } 20 | 21 | 22 | #' System requirements of a local package 23 | #' 24 | #' @param desc Path to a \code{DESCRIPTION} file. 25 | #' @param platform Platform string, defaults to the current platform. 26 | #' @param soft Whether to include soft dependencies. 27 | #' @return All system dependencies on the current or the specified 28 | #' platform. 29 | #' 30 | #' @export 31 | #' @importFrom desc description 32 | 33 | sysreqs <- function(desc, platform = current_platform(), soft = TRUE) { 34 | dsc <- description$new(desc) 35 | 36 | sysreqs_field <- dsc$get("SystemRequirements") 37 | own_sysreqs <- if (is.na(sysreqs_field)) { 38 | character() 39 | } else { 40 | get_sysreqs(sysreqs_field, platform = platform) 41 | } 42 | 43 | deps <- dsc$get_deps() 44 | 45 | ## Remove soft dependencies if they are not wanted 46 | if (!soft) { 47 | deps <- deps[ deps$type %in% c("Depends", "Imports", "LinkingTo"),, drop = FALSE ] 48 | } 49 | 50 | ## We include the package itself, because it might have an override 51 | all_deps <- get_cran_deps(c(dsc$get("Package"), deps$package)) 52 | 53 | ## Get all sysreqs at once 54 | dep_sysreqs <- get_cran_sysreqs(all_deps, platform = platform) 55 | 56 | unique(c(own_sysreqs, dep_sysreqs) %||% character()) 57 | } 58 | 59 | 60 | get_sysreqs <- function(query, platform = current_platform()) { 61 | 62 | query <- as.character(query)[1] 63 | url <- make_url( 64 | sysreqs_url, 65 | query = encode_slash(utils::URLencode(query)), 66 | platform = platform 67 | ) 68 | 69 | unlist(download_json(url)) 70 | } 71 | -------------------------------------------------------------------------------- /R/urls.R: -------------------------------------------------------------------------------- 1 | 2 | sysreqs_base_url <- "https://sysreqs.r-hub.io" 3 | ## sysreqs_base_url <- "http://localhost:3000" # for local testing 4 | sysreqs_url <- paste0(sysreqs_base_url, "/map-platform/:platform/:query") 5 | sysreqs_cran_url <- paste0(sysreqs_base_url, "/pkg/:package/:platform") 6 | sysreqs_platform_url <- paste0(sysreqs_base_url, "/platform/get/:platform") 7 | rversions_url <- "http://rversions.r-pkg.org/:version" 8 | 9 | make_url <- function(url, ...) { 10 | params <- list(...) 11 | names <- names(params) 12 | 13 | for (i in seq_along(params)) { 14 | p <- params[[i]][1] 15 | url <- gsub(paste0(":", names[i], "\\b"), params[[i]][1], url) 16 | } 17 | 18 | url 19 | } 20 | -------------------------------------------------------------------------------- /R/utils.R: -------------------------------------------------------------------------------- 1 | 2 | os_type <- function() { 3 | .Platform$OS.type 4 | } 5 | 6 | `%||%` <- function(l, r) { if (is.null(l)) r else l } 7 | 8 | encode_slash <- function(x) { 9 | gsub("/", "/", x, fixed = TRUE) 10 | } 11 | 12 | str_trim <- function(x) { 13 | sub( 14 | "^\\s+", 15 | "", 16 | sub("\\s+$", "", x, perl = TRUE), 17 | perl = TRUE 18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # sysreqs 3 | 4 | > Install SystemRequirements of Packages 5 | 6 | [![Project Status: WIP - Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](http://www.repostatus.org/badges/latest/wip.svg)](http://www.repostatus.org/#wip) 7 | [![Linux Build Status](https://travis-ci.org/r-hub/sysreqs.svg?branch=master)](https://travis-ci.org/r-hub/sysreqs) 8 | [![Windows Build status](https://ci.appveyor.com/api/projects/status/github/r-hub/sysreqs?svg=true)](https://ci.appveyor.com/project/r-hub/sysreqs) 9 | [![](http://www.r-pkg.org/badges/version/sysreqs)](http://www.r-pkg.org/pkg/sysreqs) 10 | [![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/sysreqs)](http://www.r-pkg.org/pkg/sysreqs) 11 | 12 | 13 | Automatically download and install system requirements of R packages. 14 | 15 | ## Installation 16 | 17 | ```r 18 | devtools::install_github("r-hub/sysreqs") 19 | ``` 20 | 21 | ## Usage 22 | 23 | ```r 24 | library(sysreqs) 25 | ``` 26 | 27 | ## License 28 | 29 | MIT © R Consortium 30 | -------------------------------------------------------------------------------- /man/get_cran_deps.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/deps.R 3 | \name{get_cran_deps} 4 | \alias{get_cran_deps} 5 | \title{Recursive (hard) dependencies of CRAN packages} 6 | \usage{ 7 | get_cran_deps(packages) 8 | } 9 | \arguments{ 10 | \item{packages}{Character vector of package names.} 11 | } 12 | \value{ 13 | A character vector of package names and versions, 14 | separated by a single dash. 15 | } 16 | \description{ 17 | Recursive (hard) dependencies of CRAN packages 18 | } 19 | \keyword{internal} 20 | 21 | -------------------------------------------------------------------------------- /man/get_cran_sysreqs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sysreqs.R 3 | \name{get_cran_sysreqs} 4 | \alias{get_cran_sysreqs} 5 | \title{Get the system requirements of a CRAN package} 6 | \usage{ 7 | get_cran_sysreqs(package, platform = current_platform()) 8 | } 9 | \arguments{ 10 | \item{package}{Package name.} 11 | 12 | \item{platform}{Platform string. Defaults to the current platform.} 13 | } 14 | \value{ 15 | All system dependencies on the current or the specified 16 | platform. 17 | } 18 | \description{ 19 | Get the system requirements of a CRAN package 20 | } 21 | \keyword{internal} 22 | 23 | -------------------------------------------------------------------------------- /man/sysreq_commands.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/commands.R 3 | \name{sysreq_commands} 4 | \alias{sysreq_commands} 5 | \title{Command(s) to install system requirements of a package, on a platform} 6 | \usage{ 7 | sysreq_commands(desc, platform = current_platform(), soft = TRUE) 8 | } 9 | \arguments{ 10 | \item{desc}{Path to a \code{DESCRIPTION} file.} 11 | 12 | \item{platform}{Platform string, defaults to the current platform.} 13 | 14 | \item{soft}{Whether to include soft dependencies.} 15 | } 16 | \value{ 17 | Character scalar, a shell command to run to install 18 | the system requirements on a given platform. 19 | } 20 | \description{ 21 | Command(s) to install system requirements of a package, on a platform 22 | } 23 | 24 | -------------------------------------------------------------------------------- /man/sysreqs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/package.R, R/sysreqs.R 3 | \docType{package} 4 | \name{sysreqs} 5 | \alias{sysreqs} 6 | \alias{sysreqs-package} 7 | \alias{sysreqs} 8 | \title{Install SystemRequirements of Packages} 9 | \usage{ 10 | sysreqs(desc, platform = current_platform(), soft = TRUE) 11 | } 12 | \arguments{ 13 | \item{desc}{Path to a \code{DESCRIPTION} file.} 14 | 15 | \item{platform}{Platform string, defaults to the current platform.} 16 | 17 | \item{soft}{Whether to include soft dependencies.} 18 | } 19 | \value{ 20 | All system dependencies on the current or the specified 21 | platform. 22 | } 23 | \description{ 24 | Automatically download and install system requirements of R packages. 25 | 26 | System requirements of a local package 27 | } 28 | 29 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(sysreqs) 3 | 4 | test_check("sysreqs") 5 | -------------------------------------------------------------------------------- /tests/testthat/test.R: -------------------------------------------------------------------------------- 1 | 2 | context("sysreqs") 3 | 4 | test_that("sysreqs works", { 5 | 6 | expect_true(TRUE) 7 | 8 | }) 9 | --------------------------------------------------------------------------------