Revision 43cce49fd6d517edc8bd701bf640457663eb2a58 authored by Jameson Nash on 20 November 2020, 20:26:04 UTC, committed by Jameson Nash on 20 November 2020, 20:26:04 UTC
Refs #38462
1 parent 5be3e27
Vagrantfile
# Vagrantfile for building Windows Julia via MSYS2 or Cygwin
$script_cygwin = <<SCRIPT
# change the following to 32 for 32-bit Julia
$bits = "64"
$arch = "x86_$bits".Replace("x86_32", "i686")
$setup = "setup-$arch.exe".Replace("i686", "x86")
$cyginstall = "C:\\cygwin$bits"
mkdir -Force $cyginstall | Out-Null
(new-object net.webclient).DownloadFile(
"https://cygwin.com/$setup", "$cyginstall\\$setup")
foreach ($pkg in @("git,make,curl,patch,python,gcc-g++,m4,cmake,p7zip",
"mingw64-$arch-gcc-g++,mingw64-$arch-gcc-fortran")) {
& "$cyginstall\\$setup" -q -n -R $cyginstall -l $cyginstall\\packages `
-s https://mirrors.kernel.org/sourceware/cygwin -g -P $pkg | Where-Object `
-FilterScript {$_ -notlike "Installing file *"} | Write-Output
}
& "$cyginstall\\bin\\sh" -lc "if ! [ -e julia$bits ]; then git clone \\
git://github.com/JuliaLang/julia.git julia$bits; fi && cd julia$bits && git pull && \\
echo 'XC_HOST = $arch-w64-mingw32' > Make.user && make cleanall && \\
make -j2 testall && make win-extras binary-dist"
SCRIPT
$script_msys2 = <<SCRIPT
# change the following to 32 for 32-bit Julia
$bits = "64"
$arch = "x86_$bits".Replace("x86_32", "i686")
# change the date in the following for future msys2 releases
$msys2tarball = "msys2-base-$arch-20150916.tar"
$msys2install = "C:\\msys$bits"
# install chocolatey, cmake, and python2
iex ((new-object net.webclient).DownloadString("https://chocolatey.org/install.ps1"))
choco install -y cmake
choco install -y python2
# pacman is picky, reinstall msys2 from scratch
foreach ($dir in @("etc", "usr", "var")) {
if (Test-Path "$msys2install\\$dir") {
rm -Recurse -Force $msys2install\\$dir
}
}
mkdir -Force $msys2install | Out-Null
(new-object net.webclient).DownloadFile(
"https://chocolatey.org/7za.exe",
"$msys2install\\7za.exe")
(new-object net.webclient).DownloadFile(
"https://sourceforge.net/projects/msys2/files/Base/$arch/$msys2tarball.xz",
"$msys2install\\$msys2tarball.xz")
cd C:\\
& "msys$bits\\7za.exe" x -y msys$bits\\$msys2tarball.xz
& "msys$bits\\7za.exe" x -y $msys2tarball | Out-Null
rm $msys2tarball, msys$bits\\$msys2tarball.xz, msys$bits\\7za.exe
& "$msys2install\\usr\\bin\\sh" -lc "pacman --noconfirm --force --needed -Sy \\
bash pacman pacman-mirrors msys2-runtime"
& "$msys2install\\usr\\bin\\sh" -lc "pacman --noconfirm -Syu && \\
pacman --noconfirm -S diffutils git m4 make patch tar p7zip msys/openssh"
& "$msys2install\\usr\\bin\\sh" -lc "if ! [ -e julia$bits ]; then
git clone git://github.com/JuliaLang/julia.git julia$bits; fi && cd julia$bits && git pull && \\
if ! [ -e usr/$arch-w64-mingw32 ]; then contrib/windows/get_toolchain.sh $bits; fi && \\
export PATH=`$PWD/usr/$arch-w64-mingw32/sys-root/mingw/bin:`$PATH:/c/tools/python2 && \\
echo 'override CMAKE=/c/Program\\ Files\\ \\(x86\\)/CMake/bin/cmake' > Make.user && \\
make cleanall && make -j2 testall && make win-extras binary-dist"
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "kensykora/windows_2012_r2_standard"
config.vm.provider :virtualbox do |vb|
# Use VBoxManage to customize the VM. For example to change memory:
vb.memory = 2048
end
# change the following to $script_msys2 to build with MSYS2 instead of Cygwin
config.vm.provision :shell, privileged: false, :inline => $script_cygwin
end
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...