From 6deee3b466168b86dacc74d021f1653e2dd25993 Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Thu, 21 Nov 2024 12:36:20 -0600 Subject: [PATCH] PopOS white list --- inst/tools/workaround.R | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/inst/tools/workaround.R b/inst/tools/workaround.R index 1d5cc31..d4aa0b2 100644 --- a/inst/tools/workaround.R +++ b/inst/tools/workaround.R @@ -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)