andrie / miniCRAN

R package to create internally consistent, mini version of CRAN
http://andrie.github.io/miniCRAN/
GNU General Public License v2.0
155 stars 43 forks source link

Support mac.binary.big-sur-arm64 #142

Closed vnijs closed 8 months ago

vnijs commented 3 years ago

I tried the below but makeRep doesn't work for ARM macOS packages

download <- makeRepo(pkgs, path = pth, type = "mac.binary.big-sur-arm64", Rversion = "4.1")

If you could update repoPrefix as below all should be well. Thanks

repoPrefix <- function(type, Rversion) {
  Rversion <- twodigitRversion(Rversion)

  if ((type == "mac.binary.el-capitan") && (numeric_version(Rversion) < "3.4")) {
    warning("Type mac.binary.el-capitan only valid for R >= 3.4")
  } else if ((type == "mac.binary.mavericks") && (numeric_version(Rversion) >= "3.4")) {
    warning("Type mac.binary.mavericks only valid for R < 3.4")
  }

  switch(
    type,
    "source" = "src/contrib",
    "win.binary" = sprintf("bin/windows/contrib/%s", Rversion),
    "mac.binary" = sprintf("bin/macosx/contrib/%s", Rversion),
    "mac.binary.el-capitan" = sprintf("bin/macosx/el-capitan/contrib/%s", Rversion),
    "mac.binary.big-sur-arm64" = sprintf("bin/macosx/big-sur-arm64/contrib/%s", Rversion),
    "mac.binary.leopard" = sprintf("bin/macosx/leopard/contrib/%s", Rversion),
    "mac.binary.mavericks" =  sprintf("bin/macosx/mavericks/contrib/%s", Rversion),
    stop("Type ", type, " not recognised.")
  )
}
vnijs commented 2 years ago

Minor update:

repoPrefix <- function(type, Rversion) {
  Rversion <- twodigitRversion(Rversion)

  if ((type == "mac.binary.big-sur-arm64") && (numeric_version(Rversion) < "4.1")) {
    warning("Type mac.binary.big-sur-arm64 only valid for R >= 4.1")
  } else if ((type == "mac.binary.el-capitan") && (numeric_version(Rversion) < "3.4")) {
    warning("Type mac.binary.el-capitan only valid for R >= 3.4")
  } else if ((type == "mac.binary.mavericks") && (numeric_version(Rversion) >= "3.4")) {
    warning("Type mac.binary.mavericks only valid for R < 3.4")
  }

  switch(type,
    "source" = "src/contrib",
    "win.binary" = sprintf("bin/windows/contrib/%s", Rversion),
    "mac.binary" = sprintf("bin/macosx/contrib/%s", Rversion),
    "mac.binary.el-capitan" = sprintf("bin/macosx/el-capitan/contrib/%s", Rversion),
    "mac.binary.big-sur-arm64" = sprintf("bin/macosx/big-sur-arm64/contrib/%s", Rversion),
    "mac.binary.leopard" = sprintf("bin/macosx/leopard/contrib/%s", Rversion),
    "mac.binary.mavericks" =  sprintf("bin/macosx/mavericks/contrib/%s", Rversion),
    stop("Type ", type, " not recognised.")
  )
}
maksymiuks commented 8 months ago

Hi @andrie, do you plan on addressing these changes to the infrastructure?

achubaty commented 8 months ago

@andrie this looks the same as PR #152, which was passing checks and likely ready to be merged

andrie commented 8 months ago

Thank you. I've merged #152 and am now slowly working to fix all the tests that broke because MRAN no longer exists.

maksymiuks commented 8 months ago

Thank you very much @andrie

If you need MRAN time machine functionality I suggest using Posit Package Manger public instance and its snapshots :)