diff --git a/DESCRIPTION b/DESCRIPTION index 28daedf..5234bf0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: V8 Type: Package Title: Embedded JavaScript and WebAssembly Engine for R -Version: 4.2.2.9000 +Version: 4.3.0 Authors@R: c( person("Jeroen", "Ooms", role = c("aut", "cre"), email = "jeroen@berkeley.edu", comment = c(ORCID = "0000-0002-4035-0289")), @@ -32,3 +32,4 @@ RoxygenNote: 7.2.3 Roxygen: list(load = "installed", markdown = TRUE) Language: en-US Encoding: UTF-8 +Biarch: true diff --git a/NEWS b/NEWS index 39a54c9..78c587c 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ 4.3.0 + - MacOS: update libv8 to 11.2 + - Windows: use libv8 version 9.1 on all R >= 4.0, drop support for Win2008/Vista - Add feature test for V8_ENABLE_SANDBOX, required by some V8 10.8+ (#144) - Unbundle 3rd party JS libs that are only needed for examples. diff --git a/configure.win b/configure.win old mode 100644 new mode 100755 index e69de29..054a64b --- a/configure.win +++ b/configure.win @@ -0,0 +1,6 @@ +#!/bin/sh + +# Temp fixups R-3.6 or CRAN legacy Vista server +if [ "${R_VERSION:0:1}" = "3" ] || [ "$LOCAL_SOFT" = "d:/Compiler/gcc-4.9.3/local330" ]; then +cp -f tools/legacy.win src/Makevars.win +fi diff --git a/src/Makevars.ucrt b/src/Makevars.ucrt deleted file mode 100644 index 8e79677..0000000 --- a/src/Makevars.ucrt +++ /dev/null @@ -1,17 +0,0 @@ -CXX_STD = CXX17 -RWINLIB =../windows/ucrt64 -PKG_CPPFLAGS = -I$(RWINLIB)/include -DV8_COMPRESS_POINTERS -PKG_LIBS = \ - -L$(RWINLIB)/lib \ - -lv8_monolith \ - -lws2_32 -lwinmm -ldbghelp -lshlwapi -lssp -lz - -all: clean winlibs - -clean: - rm -f $(SHLIB) $(OBJECTS) - -winlibs: - "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/ucrtlibs.R" - -.PHONY: all winlibs clean diff --git a/src/Makevars.win b/src/Makevars.win index 608c72e..26e1ee8 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -1,13 +1,10 @@ -VERSION = 6.2.414.50-vista -CXX_STD = CXX11 -RWINLIB =../windows/libv8-$(VERSION) -PKG_CPPFLAGS = -I$(RWINLIB)/include -DV8_ENABLE_CHECKS +CXX_STD = CXX17 +RWINLIB =../windows/mingw$(WIN) +PKG_CPPFLAGS = -I$(RWINLIB)/include $(subst $(WIN),,-DV8_COMPRESS_POINTERS64) PKG_LIBS = \ - -L$(RWINLIB)/lib${subst gcc ,-,${R_COMPILED_BY}}${R_ARCH} \ - -L$(RWINLIB)/lib${R_ARCH} \ - -lv8_base -lv8_libplatform -lv8_nosnapshot \ - -lv8_libbase -lv8_libsampler -lv8_builtins_setup -lv8_builtins_generators \ - -lws2_32 -lwinmm -ldbghelp -lshlwapi + -L$(RWINLIB)/lib \ + -lv8_monolith \ + -lws2_32 -lwinmm -ldbghelp -lshlwapi -lssp -lz all: clean winlibs @@ -15,6 +12,6 @@ clean: rm -f $(SHLIB) $(OBJECTS) winlibs: - "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" $(VERSION) + "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" .PHONY: all winlibs clean diff --git a/tools/legacy.win b/tools/legacy.win new file mode 100644 index 0000000..514c9f4 --- /dev/null +++ b/tools/legacy.win @@ -0,0 +1,20 @@ +VERSION = 6.2.414.50-vista +CXX_STD = CXX11 +RWINLIB =../windows/libv8-$(VERSION) +PKG_CPPFLAGS = -I$(RWINLIB)/include -DV8_ENABLE_CHECKS +PKG_LIBS = \ + -L$(RWINLIB)/lib${subst gcc ,-,${R_COMPILED_BY}}${R_ARCH} \ + -L$(RWINLIB)/lib${R_ARCH} \ + -lv8_base -lv8_libplatform -lv8_nosnapshot \ + -lv8_libbase -lv8_libsampler -lv8_builtins_setup -lv8_builtins_generators \ + -lws2_32 -lwinmm -ldbghelp -lshlwapi + +all: clean winlibs + +clean: + rm -f $(SHLIB) $(OBJECTS) + +winlibs: + "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/oldlibs.R" $(VERSION) + +.PHONY: all winlibs clean diff --git a/tools/oldlibs.R b/tools/oldlibs.R new file mode 100644 index 0000000..b95831e --- /dev/null +++ b/tools/oldlibs.R @@ -0,0 +1,13 @@ +# Build against mingw-w64 build of libv8 +VERSION <- commandArgs(TRUE) +LIBDIR <- paste0("../windows/libv8-", VERSION) +if(!file.exists(paste0(LIBDIR, "/include/v8.h"))){ + if(getRversion() < "3.3.0") stop("This library requires R 3.3 or newer") + download.file(sprintf("https://github.com/rwinlib/libv8/archive/v%s.zip", VERSION), "v8.zip", quiet = TRUE) + dir.create("../windows", showWarnings = FALSE) + unzip("v8.zip", exdir = "../windows") + setwd(LIBDIR) + unzip("lib-4.9.3.zip") + if(getRversion() >= "3.6.0") unzip("lib.zip") + unlink("v8.zip") +} diff --git a/tools/ucrtlibs.R b/tools/ucrtlibs.R deleted file mode 100644 index 702da53..0000000 --- a/tools/ucrtlibs.R +++ /dev/null @@ -1,7 +0,0 @@ -# Build against UCRT build of libv8 -if(!file.exists('../windows/ucrt64/include/v8.h')){ - download.file('https://github.com/jeroen/V8/releases/download/v3.6.0/v8-9.1.269.38-win-ucrt.pkg.tar.xz', "ucrt64.tar.xz", quiet = TRUE) - dir.create("../windows", showWarnings = FALSE) - untar('ucrt64.tar.xz', exdir = "../windows", tar = 'internal') - unlink('ucrt64.tar.xz') -} diff --git a/tools/winlibs.R b/tools/winlibs.R index b95831e..1dda28c 100644 --- a/tools/winlibs.R +++ b/tools/winlibs.R @@ -1,13 +1,16 @@ -# Build against mingw-w64 build of libv8 -VERSION <- commandArgs(TRUE) -LIBDIR <- paste0("../windows/libv8-", VERSION) -if(!file.exists(paste0(LIBDIR, "/include/v8.h"))){ - if(getRversion() < "3.3.0") stop("This library requires R 3.3 or newer") - download.file(sprintf("https://github.com/rwinlib/libv8/archive/v%s.zip", VERSION), "v8.zip", quiet = TRUE) +# Download a suitable libv8 build +if(grepl('Windows Server 2008', osVersion)){ + stop("Windows Vista/2008 is no longer supported") +} +if(!file.exists('../windows/ucrt64/include/v8.h')){ + cdn <- ifelse(isTRUE(grepl('ucrt', R.version$crt)), + 'https://github.com/jeroen/V8/releases/download/v3.6.0/v8-9.1.269.38-win-ucrt.pkg.tar.xz', + 'https://github.com/jeroen/V8/releases/download/v3.6.0/v8-9.1.269.38-win-msvcrt.tar.xz') + download.file(cdn, "libv8.tar.xz", quiet = TRUE) dir.create("../windows", showWarnings = FALSE) - unzip("v8.zip", exdir = "../windows") - setwd(LIBDIR) - unzip("lib-4.9.3.zip") - if(getRversion() >= "3.6.0") unzip("lib.zip") - unlink("v8.zip") + untar('libv8.tar.xz', exdir = "../windows", tar = 'internal') + unlink('libv8.tar.xz') + if(isTRUE(grepl('ucrt', R.version$crt))){ + file.rename("../windows/ucrt64", "../windows/mingw64") + } }