Skip to content

Instantly share code, notes, and snippets.

@jeroen
Last active September 3, 2023 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeroen/30e03da1bd0155505c2b83c8baa7476a to your computer and use it in GitHub Desktop.
Save jeroen/30e03da1bd0155505c2b83c8baa7476a to your computer and use it in GitHub Desktop.
Build R-devel for aarch64 in msys2
#!/bin/sh
set -e
set -x
cd ~
export R_CRAN_WEB="https://cran.rstudio.com"
export CRAN_RSYNC='mirrors.nic.cz::CRAN'
# Some prereqs
pacman -S --needed --noconfirm wget git make perl curl texinfo texinfo-tex rsync unzip diffutils
if [ ! -d "aarch64-w64-mingw32.static.posix" ]; then
wget -Nq https://www.r-project.org/nosvn/winutf8/tmp/llvm16_ucrt3_full_aarch64.tar.zst
tar xf llvm16_ucrt3_full_aarch64.tar.zst
fi
# Put pdflatex on the path (needed only for CMD check)
export PATH="${PWD}/aarch64-w64-mingw32.static.posix/bin:$PATH:$(cygpath $LOCALAPPDATA)/Programs/MiKTeX/miktex/bin/x64"
echo "PATH: $PATH"
pdflatex --version
texindex --version
texi2any --version
make --version
perl --version
clang --version
rm -Rf R-devel
wget -Nq https://stat.ethz.ch/R/daily/R-devel.tar.gz
#export MSYS="winsymlinks:lnk"
tar xf R-devel.tar.gz || tar xf R-devel.tar.gz
# Download the TCL bundle required by tcltk package
wget -Nq https://www.r-project.org/nosvn/winutf8/ucrt3/Tcl-aarch64-5679-5684.zip
unzip Tcl-aarch64-5679-5684.zip -d R-devel
# Add custom flags to MkRules.local
echo "USE_LLVM = 1" > R-devel/src/gnuwin32/MkRules.local
echo "WIN =" >> R-devel/src/gnuwin32/MkRules.local
cd R-devel/src/gnuwin32
# Build just the installer
make distribution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment