-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmk.bat
48 lines (37 loc) · 1.83 KB
/
mk.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
::quantstack bacon bits
:: xproperty
set "XPROPERTY_VERSION=0.7.0"
set "XPROPERTY_TAR_FILE=%XPROPERTY_VERSION%.tar.gz"
set "XPROPERTY_URL=https://github.com/QuantStack/xproperty/archive/%XPROPERTY_TAR_FILE%"
:: xwidgets
set "XWIDGETS_VERSION=0.13.1"
set "XWIDGETS_TAR_FILE=%XWIDGETS_VERSION%.tar.gz"
set "XWIDGETS_URL=https://github.com/QuantStack/xwidgets/archive/%XWIDGETS_TAR_FILE%"
:: fetch headers and put them in inst\include
if not exist ".\inst\include" mkdir .\inst\include
:: fetch xtl headers
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest %XPROPERTY_URL% -OutFile %XPROPERTY_TAR_FILE%"
C:\Rtools\bin\tar -xzf %XPROPERTY_TAR_FILE%
C:\Rtools\bin\mv xproperty-%XPROPERTY_VERSION%\include\xproperty .\inst\include
C:\Rtools\bin\rm -rf xproperty-%XPROPERTY_VERSION% %XPROPERTY_TAR_FILE%
:: fetch xwidgets headers
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest %XWIDGETS_URL% -OutFile %XWIDGETS_TAR_FILE%"
C:\Rtools\bin\tar -xzf %XWIDGETS_TAR_FILE%
C:\Rtools\bin\mv xwidgets-%XWIDGETS_VERSION%\include\xwidgets .\inst\include
C:\Rtools\bin\rm -rf xwidgets-%XWIDGETS_VERSION% %XWIDGETS_TAR_FILE%
Rscript -e Rcpp::compileAttributes()
if %ERRORLEVEL% EQU 1 exit 1
::Rscript -e "install.packages('devtools',repo='https://cran.r-project.org')"
if %ERRORLEVEL% EQU 1 exit 1
:: install a version of roxygen2 that does not attempt to build the package...
::Rscript -e "devtools::install_version('roxygen2', version='6.0.1', repo='https://cran.r-project.org')"
if %ERRORLEVEL% EQU 1 exit 1
Rscript -e roxygen2::roxygenize()
if %ERRORLEVEL% EQU 1 exit 1
R CMD build .
if %ERRORLEVEL% EQU 1 exit 1
mkdir build
C:\Rtools\bin\mv jkwidgets*gz build
cd build
::R CMD INSTALL jkwidgets*gz
R CMD INSTALL --no-multiarch jkwidgets*gz