From 5d00a06bc97241483ac564de531216d6f62fb490 Mon Sep 17 00:00:00 2001 From: Simon Garnier Date: Mon, 8 Jan 2024 14:12:04 +0100 Subject: [PATCH] Fix for non-standard Rtools installation paths. --- CRAN-SUBMISSION | 3 --- R/install.R | 8 ++++++-- docs/articles/install.html | 19 ++++++++++--------- docs/pkgdown.yml | 4 ++-- vignettes/install.Rmd | 10 +++++----- vignettes/install.html | 19 ++++++++++--------- 6 files changed, 33 insertions(+), 30 deletions(-) delete mode 100644 CRAN-SUBMISSION diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION deleted file mode 100644 index c201369..0000000 --- a/CRAN-SUBMISSION +++ /dev/null @@ -1,3 +0,0 @@ -Version: 4.80.1 -Date: 2023-10-31 20:16:13 UTC -SHA: a232d31f9896a90915891173e4d284ac9f8f7892 diff --git a/R/install.R b/R/install.R index db4d4ee..9d1c463 100644 --- a/R/install.R +++ b/R/install.R @@ -72,6 +72,9 @@ defaultOpenCVPath <- function() { config$source_dir <- paste0(config$tmp_dir, "\\opencv-", version, "\\") config$contrib_dir <- paste0(config$tmp_dir, "\\opencv_contrib-", version, "\\modules") config$build_dir <- paste0(config$source_dir, "build") + + ix <- grepl("path", names(config)) | grepl("dir", names(config)) + config[ix] <- lapply(config[ix], function(st) gsub("\\\\", "/", utils::shortPathName(st))) } else if (config$os_type == "unix") { config$install_path <- install_path config$pkg_path <- find.package("ROpenCVLite") @@ -86,12 +89,13 @@ defaultOpenCVPath <- function() { config$source_dir <- paste0(config$tmp_dir, "/opencv-", version, "/") config$contrib_dir <- paste0(config$tmp_dir, "/opencv_contrib-", version, "/modules") config$build_dir <- paste0(config$source_dir, "build") + + ix <- grepl("path", names(config)) | grepl("dir", names(config)) + config[ix] <- lapply(config[ix], normalizePath, mustWork = FALSE, winslash = "/") } else { stop("Unsupported OS type.") } - ix <- grepl("path", names(config)) | grepl("dir", names(config)) - config[ix] <- lapply(config[ix], normalizePath, mustWork = FALSE, winslash = "/") config } diff --git a/docs/articles/install.html b/docs/articles/install.html index af0c179..d8a3655 100644 --- a/docs/articles/install.html +++ b/docs/articles/install.html @@ -162,14 +162,14 @@

If you have the rig utility installed on your computer, you can install Rtools from a terminal running PowerShell:

-
# For Rtools40
-rig add rtools40
+
# For Rtools40
+rig add rtools40
 
 # For Rtools42
-rig add rtools42
+rig add rtools42
 
 # For Rtools43
-rig add rtools43
+rig add rtools43
@@ -178,7 +178,7 @@

If you have the winget utility installed on your computer, you can install Rtools from a terminal running PowerShell:

-
winget install RProject.Rtools
+
winget install RProject.Rtools

Note: Only Rtools42 seems to be available through winget at the moment.

@@ -224,15 +224,16 @@

If you have the winget utility installed on your computer, you can install Cmake from a terminal running PowerShell:

-
winget install cmake
+
winget install cmake
Option 3
-

You can manually download the -CMakeinstaller for Windows at [https://cmake.org/download/](https://cmake.org/download/). Make sure to tell the installer to addCMake` -to your “PATH” during the installation process.

+

You can manually download the CMake installer for +Windows at https://cmake.org/download/. Make +sure to tell the installer to add CMake to your “PATH” +during the installation process.


diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 7f658c2..11623c5 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,10 +1,10 @@ -pandoc: 3.1.11 +pandoc: 3.1.11.1 pkgdown: 2.0.7 pkgdown_sha: ~ articles: install: install.html usage: usage.html -last_built: 2023-12-31T07:35Z +last_built: 2024-01-08T13:09Z urls: reference: https://swarm-lab.github.io/ROpenCVLite/reference article: https://swarm-lab.github.io/ROpenCVLite/articles diff --git a/vignettes/install.Rmd b/vignettes/install.Rmd index 4a22577..b25dc0d 100644 --- a/vignettes/install.Rmd +++ b/vignettes/install.Rmd @@ -67,7 +67,7 @@ with `Rtools42` and `Rtools43`. If you have the [`rig`](https://github.com/r-lib/rig) utility installed on your computer, you can install `Rtools` from a terminal running PowerShell: -```{powershell eval=FALSE} +```{bash eval=FALSE} # For Rtools40 rig add rtools40 @@ -84,7 +84,7 @@ If you have the [`winget`](https://learn.microsoft.com/en-us/windows/package-man utility installed on your computer, you can install `Rtools` from a terminal running PowerShell: -```{powershell eval=FALSE} +```{bash eval=FALSE} winget install RProject.Rtools ``` @@ -110,7 +110,7 @@ install `Cmake` on Windows: ##### **Option 1** -Use the convenience function provided by the `installr` library: +Use the convenience function provided by the `installr` library: ```{r eval=FALSE} if (!require("installr")) @@ -128,13 +128,13 @@ If you have the [`winget`](https://learn.microsoft.com/en-us/windows/package-man utility installed on your computer, you can install `Cmake` from a terminal running PowerShell: -```{powershell eval=FALSE} +```{bash eval=FALSE} winget install cmake ``` ##### **Option 3** -You can manually download the CMake` installer for Windows at +You can manually download the `CMake` installer for Windows at [https://cmake.org/download/](https://cmake.org/download/). Make sure to tell the installer to add `CMake` to your "PATH" during the installation process. diff --git a/vignettes/install.html b/vignettes/install.html index d6db397..edd459d 100644 --- a/vignettes/install.html +++ b/vignettes/install.html @@ -404,21 +404,21 @@
Option 2

If you have the rig utility installed on your computer, you can install Rtools from a terminal running PowerShell:

-
# For Rtools40
-rig add rtools40
+
# For Rtools40
+rig add rtools40
 
 # For Rtools42
-rig add rtools42
+rig add rtools42
 
 # For Rtools43
-rig add rtools43
+rig add rtools43
Option 3

If you have the winget utility installed on your computer, you can install Rtools from a terminal running PowerShell:

-
winget install RProject.Rtools
+
winget install RProject.Rtools

Note: Only Rtools42 seems to be available through winget at the moment.

@@ -456,13 +456,14 @@
Option 2

If you have the winget utility installed on your computer, you can install Cmake from a terminal running PowerShell:

-
winget install cmake
+
winget install cmake
Option 3
-

You can manually download the -CMakeinstaller for Windows at [https://cmake.org/download/](https://cmake.org/download/). Make sure to tell the installer to addCMake` -to your “PATH” during the installation process.

+

You can manually download the CMake installer for +Windows at https://cmake.org/download/. Make +sure to tell the installer to add CMake to your “PATH” +during the installation process.