Skip to content

Commit 19501e3

Browse files
committed
Fix parallel make
1 parent 7ca97b4 commit 19501e3

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

.github/workflows/R-CMD-check.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ jobs:
5050
needs: check
5151

5252
- uses: r-lib/actions/check-r-package@v2
53+
env:
54+
MAKEFLAGS: -j4

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: opencv
22
Type: Package
33
Title: Bindings to 'OpenCV' Computer Vision Library
4-
Version: 0.5.0
4+
Version: 0.5.1
55
Authors@R: c(
66
person("Jeroen", "Ooms", role = c("aut", "cre"), email = "[email protected]",
77
comment = c(ORCID = "0000-0002-4035-0289")),

src/Makevars.in

+5
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
PKG_CPPFLAGS=@cflags@
22
PKG_LIBS=@libs@
3+
4+
all: cleanup
5+
6+
cleanup: $(SHLIB)
7+
@rm -Rf ../.deps

src/Makevars.win

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ $(info using $(PKG_CONFIG_NAME) from Rtools)
88
PKG_CPPFLAGS := $(shell $(PKG_CONFIG) --cflags $(PKG_CONFIG_NAME)) $(STATIC_CFLAGS)
99
OPENCVDATA := $(shell $(PKG_CONFIG) --variable=prefix $(PKG_CONFIG_NAME))/share/opencv4
1010
else
11-
RWINLIB = ../windows/opencv
11+
RWINLIB = ../.deps/opencv
1212
PKG_CPPFLAGS = -I$(RWINLIB)/include/opencv4 $(STATIC_CFLAGS)
1313
OLDLIBDIR = lib${subst gcc,,${COMPILED_BY}}${R_ARCH}
1414
PKG_LIBS = \
@@ -21,16 +21,16 @@ PKG_LIBS = \
2121
OPENCVDATA = $(RWINLIB)/share
2222
endif
2323

24-
all: $(SHLIB) copydata
24+
all: copydata
2525

26-
$(OBJECTS): $(RWINLIB)
26+
$(OBJECTS): | $(RWINLIB)
2727

2828
$(RWINLIB):
2929
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R"
3030

31-
copydata:
31+
copydata: | $(RWINLIB)
3232
rm -Rf ../inst/share && mkdir -p ../inst
3333
cp -Rf $(OPENCVDATA) ../inst/share
3434

35-
clean:
36-
rm -f $(SHLIB) $(OBJECTS)
35+
cleanup: $(SHLIB)
36+
@rm -Rf $(RWINLIB)

tools/winlibs.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
if(!file.exists("../windows/opencv/include/opencv4/opencv2/opencv.hpp")){
2-
unlink("../windows", recursive = TRUE)
1+
if(!file.exists("../.deps/opencv/include/opencv4/opencv2/opencv.hpp")){
2+
unlink("../.deps", recursive = TRUE)
33
url <- if(grepl("aarch", R.version$platform)){
44
"https://github.com/r-windows/bundles/releases/download/opencv-4.8.1/opencv-4.8.1-clang-aarch64.tar.xz"
55
} else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){
@@ -10,9 +10,9 @@ if(!file.exists("../windows/opencv/include/opencv4/opencv2/opencv.hpp")){
1010
"https://github.com/rwinlib/opencv/archive/refs/tags/v4.8.1.tar.gz"
1111
}
1212
download.file(url, basename(url), quiet = TRUE)
13-
dir.create("../windows", showWarnings = FALSE)
14-
untar(basename(url), exdir = "../windows", tar = 'internal')
13+
dir.create("../.deps", showWarnings = FALSE)
14+
untar(basename(url), exdir = "../.deps", tar = 'internal')
1515
unlink(basename(url))
16-
setwd("../windows")
16+
setwd("../.deps")
1717
file.rename(list.files(), 'opencv')
1818
}

0 commit comments

Comments
 (0)