Skip to content

Commit

Permalink
Support Rtools44
Browse files Browse the repository at this point in the history
Closes #183.
  • Loading branch information
gaborcsardi committed Mar 17, 2024
1 parent 616592a commit 518d65e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# pkgbuild (development version)

* pkgbuild now supports R 4.4.x and Rtools44 (#183).

# pkgbuild 1.4.3

* pkgbuild now does not need the crayon, rprojroot and prettyunits
Expand Down
31 changes: 28 additions & 3 deletions R/rtools.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,38 @@ has_rtools <- function(debug = FALSE) {
return(FALSE)
}

# R 4.4.0 or later on ARM64
if (getRversion() >= "4.4.0" && grepl("aarch", R.version$platform)) {
rtools44_aarch64_home <- Sys.getenv("RTOOLS44_AARCH64_HOME", "C:\rtools44-aarch64")
if (file.exists(file.path(rtools44_aarch64_home, "usr", "bin"))) {
if (debug) {
cat("Found in Rtools 4.4 (aarch64) installation folder\n")
}
rtools_path_set(rtools(rtools44_aarch64_home, "4.4"))
return(TRUE)
}
return(FALSE)
}

# R 4.4.0 or later
if (getRversion() >= "4.4.0") {
rtools44_home <- Sys.getenv("RTOOLS44_HOME", "C:\\rtools44")
if (file.exists(file.path(rtools44_home, "usr", "bin"))) {
if (debug) {
cat("Found in Rtools 4.4 installation folder\n")
}
rtools_path_set(rtools(rtools44_home, "4.4"))
return(TRUE)
}
return(FALSE)
}

# R 4.3.0 or later on ARM64
if (grepl("aarch", R.version$platform)) {
if (getRversion() >= "4.3.0" && grepl("aarch", R.version$platform)) {
rtools43_aarch64_home <- Sys.getenv("RTOOLS43_AARCH64_HOME", "C:\rtools43-aarch64")
if (file.exists(file.path(rtools43_aarch64_home, "usr", "bin"))) {
if (debug) {
cat("Found in Rtools 4.3 installation folder\n")
cat("Found in Rtools 4.3 (aarch64) installation folder\n")
}
rtools_path_set(rtools(rtools43_aarch64_home, "4.3"))
return(TRUE)
Expand All @@ -56,7 +82,6 @@ has_rtools <- function(debug = FALSE) {
return(FALSE)
}


# R 4.2.x or later and ucrt?
ucrt <- is_ucrt()
if (ucrt) {
Expand Down

0 comments on commit 518d65e

Please sign in to comment.