forked from verifast/verifast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-windows.sh
49 lines (40 loc) · 1.93 KB
/
setup-windows.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
#!/bin/bash
# Installs OCaml and lablgtk on Windows. Called by setup-windows.bat.
set -e # Stop as soon as a command fails.
set -x # Print what is being executed.
. ./config.sh
dl_and_unzip() {
url="$1"
filename=$(basename "$url")
hash="$2"
sha="$3"
filter="$4"
if [ ! -e "verifast-downloads/$filename" ]; then
wget -P verifast-downloads --progress=dot:mega -c "$url"
echo "$hash *verifast-downloads/$filename" | sha"$sha"sum -c || exit 1
else
echo "Skipped downloading C:/verifast-downloads/$filename; file already exists"
fi
entry="$(tar t"$filter"f "verifast-downloads/$filename" | head -n 1)"
if [ ! -e $entry ]; then
tar x"$filter"f "verifast-downloads/$filename"
else
echo "Skipped extracting C:/verifast-downloads/$filename; file C:/$entry already exists"
fi
}
script_dir=$(pwd)
cd /cygdrive/c
dl_and_unzip https://github.com/verifast/vf-llvm-clang-build/releases/download/v2.0.5/vf-llvm-clang-build-$VF_LLVM_CLANG_BUILD_VERSION-Windows-MinGW-x86_64.tar.gz BA94B5A670F1C23D4F941F16D88D931ACFD7183273B50F6FEE17540FECE5472D 256 z
dl_and_unzip https://github.com/verifast/vfdeps-win/releases/download/23.04/vfdeps-e62a07d-win.txz 63a593c235fbcb4d86c4cbe821aca1a943873daadfbbc1af37f0bb3f 224 j
PATHCMD='export PATH="/cygdrive/c/vfdeps/bin:$PATH"'
if ! rustup show home; then
if [ ! -e "verifast-downloads/rustup-init.exe" ]; then
wget -O verifast-downloads/rustup-init.exe --progress=dot:mega https://win.rustup.rs/x86_64
fi
verifast-downloads/rustup-init.exe -y
PATHCMD="$PATHCMD:"'"'"`cygpath -u $USERPROFILE/.cargo/bin`"'"'
fi
cd $script_dir/src/cxx_frontend/ast_exporter
cmake -S . -B build -G Ninja -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_BUILD_TYPE=Release -DLLVM_INSTALL_DIR=/cygdrive/c/vf-llvm-clang-build-$VF_LLVM_CLANG_BUILD_VERSION -DVFDEPS=/cygdrive/c/vfdeps
echo "$PATHCMD" >> ~/.bash_profile
eval "$PATHCMD"