Skip to content

Commit c2ae757

Browse files
authored
Merge pull request #48 from swarm-lab/develop
Develop
2 parents 3003806 + e82f9be commit c2ae757

File tree

6 files changed

+152
-24
lines changed

6 files changed

+152
-24
lines changed

.github/workflows/rhub.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
2+
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
3+
# You can update this file to a newer version using the rhub2 package:
4+
#
5+
# rhub::rhub_setup()
6+
#
7+
# It is unlikely that you need to modify this file manually.
8+
9+
name: R-hub
10+
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"
11+
12+
on:
13+
workflow_dispatch:
14+
inputs:
15+
config:
16+
description: 'A comma separated list of R-hub platforms to use.'
17+
type: string
18+
default: 'linux,windows,macos'
19+
name:
20+
description: 'Run name. You can leave this empty now.'
21+
type: string
22+
id:
23+
description: 'Unique ID. You can leave this empty now.'
24+
type: string
25+
26+
jobs:
27+
28+
setup:
29+
runs-on: ubuntu-latest
30+
outputs:
31+
containers: ${{ steps.rhub-setup.outputs.containers }}
32+
platforms: ${{ steps.rhub-setup.outputs.platforms }}
33+
34+
steps:
35+
# NO NEED TO CHECKOUT HERE
36+
- uses: r-hub/actions/setup@v1
37+
with:
38+
config: ${{ github.event.inputs.config }}
39+
id: rhub-setup
40+
41+
linux-containers:
42+
needs: setup
43+
if: ${{ needs.setup.outputs.containers != '[]' }}
44+
runs-on: ubuntu-latest
45+
name: ${{ matrix.config.label }}
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
config: ${{ fromJson(needs.setup.outputs.containers) }}
50+
container:
51+
image: ${{ matrix.config.container }}
52+
53+
steps:
54+
- uses: r-hub/actions/checkout@v1
55+
- uses: r-hub/actions/platform-info@v1
56+
with:
57+
token: ${{ secrets.RHUB_TOKEN }}
58+
job-config: ${{ matrix.config.job-config }}
59+
- uses: r-hub/actions/setup-deps@v1
60+
with:
61+
token: ${{ secrets.RHUB_TOKEN }}
62+
job-config: ${{ matrix.config.job-config }}
63+
- uses: r-hub/actions/run-check@v1
64+
with:
65+
token: ${{ secrets.RHUB_TOKEN }}
66+
job-config: ${{ matrix.config.job-config }}
67+
68+
other-platforms:
69+
needs: setup
70+
if: ${{ needs.setup.outputs.platforms != '[]' }}
71+
runs-on: ${{ matrix.config.os }}
72+
name: ${{ matrix.config.label }}
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
config: ${{ fromJson(needs.setup.outputs.platforms) }}
77+
78+
steps:
79+
- uses: r-hub/actions/checkout@v1
80+
- uses: r-hub/actions/setup-r@v1
81+
with:
82+
job-config: ${{ matrix.config.job-config }}
83+
token: ${{ secrets.RHUB_TOKEN }}
84+
- uses: r-hub/actions/platform-info@v1
85+
with:
86+
token: ${{ secrets.RHUB_TOKEN }}
87+
job-config: ${{ matrix.config.job-config }}
88+
- uses: r-hub/actions/setup-deps@v1
89+
with:
90+
job-config: ${{ matrix.config.job-config }}
91+
token: ${{ secrets.RHUB_TOKEN }}
92+
- uses: r-hub/actions/run-check@v1
93+
with:
94+
job-config: ${{ matrix.config.job-config }}
95+
token: ${{ secrets.RHUB_TOKEN }}

DESCRIPTION

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: ROpenCVLite
22
Type: Package
33
Title: Helper Package for Installing OpenCV with R
4-
Version: 4.90.1
5-
Date: 2024-01-20
4+
Version: 4.90.2
5+
Date: 2024-08-01
66
Authors@R: c(
77
person("Simon", "Garnier", email = "[email protected]", role = c("aut", "cre"),
88
comment = c(ORCID = "0000-0002-3886-3974")),
@@ -18,11 +18,10 @@ License: GPL-3
1818
LazyData: TRUE
1919
Imports:
2020
utils,
21-
pkgbuild,
2221
parallel
2322
SystemRequirements:
2423
cmake
25-
RoxygenNote: 7.3.0
24+
RoxygenNote: 7.3.2
2625
Biarch: false
2726
Encoding: UTF-8
2827
Depends:

NEWS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# ROpenCVLite 4.90.2
2+
3+
## New features
4+
5+
* N/A.
6+
7+
## Minor improvements and fixes
8+
9+
* Removes pkgbuild dependency.
10+
11+
---
12+
113
# ROpenCVLite 4.90.1
214

315
## New features

R/install.R

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,9 @@ defaultOpenCVPath <- function() {
3434
config$os <- gsub("\r", "", gsub("Caption=", "", system('wmic os get Caption,CSDVersion /value', intern = TRUE)[3]))
3535
config$core <- paste0("https://github.com/opencv/opencv/archive/", version, ".tar.gz")
3636
config$contrib <- paste0("https://github.com/opencv/opencv_contrib/archive/", version, ".tar.gz")
37-
config$rtools_path <- utils::shortPathName(pkgbuild::rtools_path()[1])
38-
39-
if (is.null(config$rtools_path))
40-
stop("Rtools is missing.")
41-
42-
config$rtools_path <- gsub("\\\\usr\\\\bin", "", config$rtools_path)
43-
config$rtools_version <- system(
44-
paste0("powershell (Get-Item ", config$rtools_path, "/unins000.exe).VersionInfo.ProductVersion"),
45-
intern = TRUE)
46-
config$rtools_version <- gsub(" ", "", config$rtools_version)
47-
48-
if (is.na(config$rtools_version))
49-
stop("Unsupported Rtools version.")
37+
rtools <- .findRtools()
38+
config$rtools_path <- rtools$path
39+
config$rtools_version <- rtools$version
5040

5141
if (config$rtools_version < "4.2") {
5242
config$cmake_path <- utils::shortPathName(system("where cmake.exe", intern = TRUE))

R/utils.R

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,34 @@ opencvConfig <- function(output = "libs", arch = NULL) {
218218
stop("output should be either 'libs' or 'cflags'")
219219
}
220220
}
221+
222+
223+
.findRtools <- function() {
224+
if (.Platform$OS.type != "windows") {
225+
stop("Rtools is Windows only.")
226+
}
227+
228+
if (version$major < 4) {
229+
stop("ROpenCVLite requires a R version > 4.0.")
230+
}
231+
232+
if (version$minor < 2) {
233+
rtools <- "rtools40"
234+
} else {
235+
rtools <- paste0("rtools", sub("\\D*(\\d+).*", "\\1", paste0(version$major, version$minor)))
236+
}
237+
238+
path <- strsplit(Sys.getenv("PATH"), ";")[[1]]
239+
ix <- grep(rtools, path)[1]
240+
rtools_path <- utils::shortPathName(sub(paste0("(", rtools, ").*"), "\\1", path[ix]))
241+
rtools_version <- system(
242+
paste0("powershell (Get-Item ", rtools_path, "/unins000.exe).VersionInfo.ProductVersion"),
243+
intern = TRUE
244+
)
245+
rtools_version <- gsub(" ", "", rtools_version)
246+
247+
if (is.na(rtools_version))
248+
stop("Rtools unavailable or unsupported Rtools version.")
249+
250+
list(path = unname(rtools_path), version = unname(rtools_version))
251+
}

cran-comments.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
## Test environments
22

3-
* local M1 OS X 14.2.1, R 4.0.5, 4.1.3, 4.2.3, 4.3.2, R devel
4-
* local Windows 10, R 4.0.5, 4.1.3, 4.2.3, 4.3.2, R devel
5-
* local Windows 11, R 4.0.5, 4.1.3, 4.2.3, 4.3.2, R devel
6-
* local Ubuntu 22.04, R 4.0.5, 4.1.3, 4.2.3, 4.3.2, R devel
3+
* local M1 OS X 14.2.1, R 4.0.5, 4.1.3, 4.2.3, 4.3.2, 4.4.1, R devel
4+
* local Windows 10, R 4.0.5, 4.1.3, 4.2.3, 4.3.2, 4.4.1, R devel
5+
* local Windows 11, R 4.0.5, 4.1.3, 4.2.3, 4.3.2, 4.4.1, R devel
6+
* local Ubuntu 24.04, R 4.0.5, 4.1.3, 4.2.3, 4.3.2, 4.4.1, R devel
77
* Github Actions "windows-latest (release)"
88
* Github Actions "macOS-latest (release)"
99
* Github Actions "ubuntu-latest (release)"
1010
* Github Actions "ubuntu-latest (devel)"
1111
* Github Actions "ubuntu-latest (oldrel-1)"
12-
* r-hub Windows Server 2022, R-devel, 64 bit
13-
* r-hub Ubuntu Linux 20.04.1 LTS, R-release, GCC
14-
* r-hub Fedora Linux, R-devel, clang, gfortran
12+
* r-hub ubuntu-latest on GitHub
13+
* r-hub macos-13 on GitHub
14+
* r-hub macos-latest on GitHub
15+
* r-hub windows-latest on GitHub
1516
* win-builder.r-project.org
1617

1718
## R CMD check results

0 commit comments

Comments
 (0)