Skip to content

Commit

Permalink
PopOS white list
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Nov 21, 2024
1 parent 7551076 commit 6deee3b
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions inst/tools/workaround.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,24 @@ for (f in c("src/RcppExports.cpp")) {
writeLines(l, f)
}
}

if (.Platform$OS.type == "windows" && !file.exists("src/Makevars.win")
|| (R.version$os == "linux-musl")) {
writeLines(gsub("@ISYSTEM@", "I",
gsub("@CXX14STD@", "CXX14STD = -std=c++1y",
suppressWarnings(readLines("src/Makevars.in")))),
"src/Makevars.win")
.in <- suppressWarnings(readLines("src/Makevars.in"))
if (.Platform$OS.type == "windows") {
.makevars <- file("src/Makevars.win", "wb")
.i <- "I"
} else {
writeLines(gsub("@ISYSTEM@", "isystem",
gsub("@CXX14STD@", "CXX14STD = -std=gnu++14",
suppressWarnings(readLines("src/Makevars.in")))),
"src/Makevars")
.makevars <- file("src/Makevars", "wb")
if (file.exists("/etc/os-release")) {
.os <- readLines("/etc/os-release")
if (any(grepl("Pop!_OS", .os, fixed=TRUE))) {
.i <- "isystem"
} else {
.i <- "I"
}
} else {
.i <- "I"
}
}

writeLines(gsub("@ISYSTEM@", .i, .in),
.makevars)
close(.makevars)

0 comments on commit 6deee3b

Please sign in to comment.