This repository has been archived by the owner on Oct 1, 2022. It is now read-only.
forked from r-windows/r-base-rtools40
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quick-build.sh
53 lines (42 loc) · 1.66 KB
/
quick-build.sh
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
49
50
51
52
53
#!/bin/sh
# Minimal example of building R for Windows.
# You must run this script inside the rtools40 shell.
# This builds and checks a single architecture (no manuals or installer)
# Used below: set this to 32 or 64
WIN=64
# Run script safely and emit some verbose output
set -e
set -x
# Put pdflatex on the path (needed only for CMD check)
export PATH="$PATH:/c/progra~1/MiKTeX/miktex/bin/x64:/c/progra~1/MiKTeX 2.9/miktex/bin/x64"
pdflatex --version
texindex --version
make --version
# get absolute paths
srcdir=$(dirname $(realpath $0))
# Install system libs
pacman -Syu --noconfirm
pacman -S --needed --noconfirm mingw-w64-{i686,x86_64}-{gcc,gcc-fortran}
pacman -S --needed --noconfirm mingw-w64-{i686,x86_64}-{icu,libtiff,libjpeg,libpng,pcre2,xz,bzip2,zlib}
pacman -S --needed --noconfirm mingw-w64-{i686,x86_64}-{cairo,tk,curl}
pacman -S --needed --noconfirm mingw-w64-{i686,x86_64}-openblas
# Download R-devel and extract (tarball contains recursive symlinks)
rm -Rf R-devel
curl -OL https://cran.r-project.org/src/base-prerelease/R-devel.tar.gz
MSYS="winsymlinks:lnk" tar -xf R-devel.tar.gz
cd R-devel
# Download a certificate bunle
curl https://curl.se/ca/cacert.pem > etc/curl-ca-bundle.crt
# Create the TCL bundle required by tcltk package
mkdir -p Tcl/{bin,bin64,lib,lib64}
${srcdir}/create-tcltk-bundle.sh
# Add custom patches here:
# patch -Np1 -i "${srcdir}/myfix.patch"
# Build just the core pieces (no manuals or installer)
cd "src/gnuwin32"
sed -e "s|@win@|${WIN}|" -e "s|@texindex@||" -e "s|@home32@||" "${srcdir}/MkRules.local.in" > MkRules.local
make all cairodevices recommended
# Optional: run checks
# make check-all
# Start RGUI to test
../../bin/x64/Rgui.exe &