mirror of https://github.com/mono/CppSharp.git
c-sharpdotnetmonobindingsbridgecclangcpluspluscppsharpglueinteropparserparsingpinvokeswigsyntax-treevisitorsxamarinxamarin-bindings
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
113 lines
3.2 KiB
113 lines
3.2 KiB
# -*- mode: ruby -*- |
|
# vi: set ft=ruby : |
|
|
|
$script = <<SCRIPT |
|
SCRIPT |
|
|
|
Vagrant.configure(2) do |config| |
|
# For a complete reference, please see the online documentation at |
|
# https://docs.vagrantup.com. |
|
|
|
config.vm.box = "ubuntu/trusty64" |
|
|
|
#load external box config |
|
external = File.read 'vmsettings.cfg' |
|
eval external |
|
|
|
# this function fixes errors with ubuntu interactive shell |
|
config.vm.provision "fix-no-tty", type: "shell" do |s| |
|
s.privileged = false |
|
s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile" |
|
end |
|
|
|
#this section runs as root |
|
config.vm.provision "shell", privileged: true , inline: <<-SHELL |
|
|
|
# Add Repos |
|
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF |
|
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list |
|
|
|
sudo add-apt-repository ppa:george-edison55/cmake-3.x |
|
apt-get update |
|
|
|
# Build tools |
|
apt-get install -y git build-essential clang cmake ninja-build |
|
|
|
apt-get install -y p7zip-full |
|
|
|
# Mono |
|
apt-get install -y mono-devel |
|
|
|
SHELL |
|
|
|
#this section runs as normal user |
|
config.vm.provision "shell", privileged: false , inline: <<-SHELL |
|
function mkcd () { mkdir -p "$@" && cd "$@"; } |
|
|
|
git clone https://github.com/mono/CppSharp.git |
|
|
|
cd CppSharp/deps/ |
|
|
|
git clone https://github.com/llvm-mirror/llvm.git |
|
|
|
cd llvm/ |
|
|
|
llvm_commit=`cat ../../build/LLVM-commit` |
|
git reset --hard $llvm_commit |
|
|
|
cd tools/ |
|
|
|
git clone https://github.com/llvm-mirror/clang.git |
|
|
|
cd clang/ |
|
|
|
clang_commit=`cat ../../../../build/Clang-commit` |
|
git reset --hard $clang_commit |
|
|
|
mkcd ../../build |
|
|
|
cmake -G Ninja -DCLANG_BUILD_EXAMPLES=false -DCLANG_INCLUDE_DOCS=false -DCLANG_INCLUDE_TESTS=false -DCLANG_INCLUDE_DOCS=false -DCLANG_BUILD_EXAMPLES=false -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_INCLUDE_EXAMPLES=false -DLLVM_INCLUDE_DOCS=false -DLLVM_INCLUDE_TESTS=false .. |
|
|
|
ninja |
|
|
|
# make the output package |
|
cd .. |
|
if [ -d "out" ]; then rm -rf out; fi |
|
mkdir out |
|
mkdir -p out/tools/clang |
|
mkdir -p out/tools/clang/lib/CodeGen |
|
mkdir -p out/build/ |
|
mkdir -p out/build/lib |
|
mkdir -p out/build/tools/clang |
|
mkdir -p out/build/tools/clang/lib |
|
|
|
cp -R include/ out/ |
|
cp -R build/include/ out/build |
|
cp build/lib/*.a out/build/lib |
|
|
|
cp -R tools/clang/include/ out/tools/clang |
|
cp -R tools/clang/lib/CodeGen/*.h out/tools/clang/lib/CodeGen |
|
cp -R build/tools/clang/include/ out/build/tools/clang |
|
|
|
rm out/build/lib/libllvm*ObjCARCOpts*.a |
|
rm out/build/lib/libclang*ARC*.a |
|
rm out/build/lib/libclang*Matchers*.a |
|
rm out/build/lib/libclang*Rewrite*.a |
|
rm out/build/lib/libclang*StaticAnalyzer*.a |
|
rm out/build/lib/libclang*Tooling*.a |
|
|
|
7z a llvm_linux_x86_64.7z ./out/* |
|
|
|
# upload to dropbox |
|
curl "https://raw.githubusercontent.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh" -o dropbox_uploader.sh |
|
|
|
echo APPKEY= > ~/.dropbox_uploader |
|
echo APPSECRET= >> ~/.dropbox_uploader |
|
echo ACCESS_LEVEL=sandbox >> ~/.dropbox_uploader |
|
echo OAUTH_ACCESS_TOKEN= >> ~/.dropbox_uploader |
|
echo OAUTH_ACCESS_TOKEN_SECRET= >> ~/.dropbox_uploader |
|
|
|
./dropbox_uploader.sh upload llvm_linux_x86_64.7z llvm_linux_x86_64.7z |
|
|
|
SHELL |
|
end
|
|
|