Skip to content

Commit 6d28067

Browse files
Junhewk Kimclaude
authored andcommitted
Fix Windows build: use mode='wb' and fix cache dir for 64-bit R
R 4.2+ on Windows has empty R_ARCH (not /x64), so use MECAB_ARCH for the cache directory. Also add mode='wb' to download.file for proper binary transfer on Windows. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2d3ef0d commit 6d28067

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Makevars.win

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ all: libmecab $(SHLIB)
3636
## the opening '@' ensures operations are executed 'quietly'
3737
## in order to see commands as they happens add a 'v' to the tar and cp commands
3838
libmecab:
39-
@if [ ! -d ../mecab/win$(R_ARCH) ]; then mkdir -p ../mecab/win$(R_ARCH); fi
40-
@if [ ! -f ../mecab/win$(R_ARCH)/mecab$(MECAB_ARCH)_$(MECAB_LANG).tar.gz ]; then `"$(R_HOME)/bin$(R_ARCH_BIN)/Rscript.exe" -e "download.file(url='https://github.com/junhewk/RcppMeCab/releases/download/0.0.1.0/mecab$(MECAB_ARCH)_$(MECAB_LANG).tar.gz', destfile='../mecab/win$(R_ARCH)/mecab$(MECAB_ARCH)_$(MECAB_LANG).tar.gz', quiet=TRUE)"`; fi
41-
@tar xfz ../mecab/win$(R_ARCH)/mecab$(MECAB_ARCH)_$(MECAB_LANG).tar.gz
39+
@if [ ! -d ../mecab/win$(MECAB_ARCH) ]; then mkdir -p ../mecab/win$(MECAB_ARCH); fi
40+
@if [ ! -f ../mecab/win$(MECAB_ARCH)/mecab$(MECAB_ARCH)_$(MECAB_LANG).tar.gz ]; then `"$(R_HOME)/bin$(R_ARCH_BIN)/Rscript.exe" -e "download.file(url='https://github.com/junhewk/RcppMeCab/releases/download/0.0.1.0/mecab$(MECAB_ARCH)_$(MECAB_LANG).tar.gz', destfile='../mecab/win$(MECAB_ARCH)/mecab$(MECAB_ARCH)_$(MECAB_LANG).tar.gz', mode='wb', quiet=TRUE)"`; fi
41+
@tar xfz ../mecab/win$(MECAB_ARCH)/mecab$(MECAB_ARCH)_$(MECAB_LANG).tar.gz
4242
@if [ ! -d ../inst/libs$(R_ARCH) ]; then mkdir -p ../inst/libs$(R_ARCH); fi
4343
@cp libmecab$(SHLIB_EXT) ../inst/libs$(R_ARCH)
4444
@rm libmecab$(SHLIB_EXT)

0 commit comments

Comments
 (0)