Browse Source

Updated the LLVM packaging scripts to use tar.xz for non-Windows builds.

pull/600/head
Joao Matos 10 years ago
parent
commit
f75b3e1a35
  1. 4
      .travis.yml
  2. 24
      build/scripts/LLVM.lua
  3. 4
      build/scripts/Provision.lua

4
.travis.yml

@ -18,8 +18,8 @@ install: @@ -18,8 +18,8 @@ install:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install -y mono-devel p7zip-full; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install wget p7zip; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install -y mono-devel; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install wget xz; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then wget -O mono.pkg http://download.mono-project.com/archive/nightly/macos-10-x86/mono-MDK.pkg; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then sudo installer -pkg "mono.pkg" -target /; fi
- wget https://nuget.org/nuget.exe

24
build/scripts/LLVM.lua

@ -70,10 +70,18 @@ function extract_7z(archive, dest_dir) @@ -70,10 +70,18 @@ function extract_7z(archive, dest_dir)
return execute(string.format("7z x %s -o%s -y", archive, dest_dir), true)
end
function extract_tar_xz(archive, dest_dir)
execute("mkdir -p " .. dest_dir, true)
return execute(string.format("tar xJf %s -C %s", archive, dest_dir), true)
end
local use_7zip = os.is("windows")
local archive_ext = use_7zip and ".7z" or ".tar.xz"
function download_llvm()
local base = "https://dl.dropboxusercontent.com/u/194502/CppSharp/llvm/"
local pkg_name = get_llvm_package_name()
local archive = pkg_name .. ".7z"
local archive = pkg_name .. archive_ext
-- check if we already have the file downloaded
if not os.isfile(archive) then
@ -82,7 +90,11 @@ function download_llvm() @@ -82,7 +90,11 @@ function download_llvm()
-- extract the package
if not os.isdir(pkg_name) then
extract_7z(archive, pkg_name)
if use_7zip then
extract_7z(archive, pkg_name)
else
extract_tar_xz(archive, pkg_name)
end
end
end
@ -240,11 +252,15 @@ function package_llvm(conf, llvm, llvm_build) @@ -240,11 +252,15 @@ function package_llvm(conf, llvm, llvm_build)
end
function archive_llvm(dir)
local archive = dir .. ".7z"
local archive = dir .. archive_ext
if os.isfile(archive) then os.remove(archive) end
local cwd = os.getcwd()
os.chdir(dir)
execute("7z a " .. path.join("..", archive) .. " *")
if use_7zip then
execute("7z a " .. path.join("..", archive) .. " *")
else
execute("tar cJf " .. path.join("..", archive) .. " *")
end
os.chdir(cwd)
if is_vagrant() then
os.copyfile(archive, "/cppsharp")

4
build/scripts/Provision.lua

@ -72,8 +72,6 @@ function provision_linux() @@ -72,8 +72,6 @@ function provision_linux()
-- Build tools
sudo("apt-get install -y git build-essential clang")
sudo("apt-get install -y p7zip-full")
-- Mono
sudo("apt-get install -y mono-devel")
@ -92,8 +90,6 @@ function brew_install(pkg) @@ -92,8 +90,6 @@ function brew_install(pkg)
end
function provision_osx()
brew_install("p7zip")
if compile_llvm then
execute("brew cask install virtualbox vagrant")
end

Loading…
Cancel
Save