-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See pantsbuild/pants#5991. This adds the binary I should have provided when we added the ability to download `BinaryTool`s from external urls, in the exact same way we do it within Pants.
- Loading branch information
1 parent
59d7345
commit 80a0051
Showing
7 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
source "$(git rev-parse --show-toplevel)/utils.v1.bash" | ||
|
||
set_strict_mode | ||
|
||
function fetch_llvm_binary_release_archive { | ||
local -r system_id="$1" | ||
|
||
local -r archive_dirname="clang+llvm-${LLVM_VERSION}-x86_64-${system_id}" | ||
local -r archive_filename="${archive_dirname}.tar.xz" | ||
local -r release_url="https://releases.llvm.org/${LLVM_VERSION}/${archive_filename}" | ||
|
||
curl_file_with_fail "$release_url" "$archive_filename" | ||
} | ||
|
||
readonly TARGET_PLATFORM="$1" LLVM_VERSION="$2" | ||
|
||
case "$TARGET_PLATFORM" in | ||
osx) | ||
with_pushd "$(mkdirp_absolute_path "llvm-${LLVM_VERSION}-osx")" \ | ||
fetch_llvm_binary_release_archive 'apple-darwin' | ||
;; | ||
linux) | ||
with_pushd "$(mkdirp_absolute_path "llvm-${LLVM_VERSION}-linux")" \ | ||
fetch_llvm_binary_release_archive 'linux-gnu-ubuntu-16.04' | ||
;; | ||
*) | ||
die "llvm does not support building for '${TARGET_PLATFORM}'" | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
readonly result="$(./build-llvm.sh linux 6.0.0)" | ||
|
||
cp "$result" ./llvm.tar.xz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
source "$(git rev-parse --show-toplevel)/utils.v1.bash" | ||
|
||
set_strict_mode | ||
|
||
function fetch_llvm_binary_release_archive { | ||
local -r system_id="$1" | ||
|
||
local -r archive_dirname="clang+llvm-${LLVM_VERSION}-x86_64-${system_id}" | ||
local -r archive_filename="${archive_dirname}.tar.xz" | ||
local -r release_url="https://releases.llvm.org/${LLVM_VERSION}/${archive_filename}" | ||
|
||
curl_file_with_fail "$release_url" "$archive_filename" | ||
} | ||
|
||
readonly TARGET_PLATFORM="$1" LLVM_VERSION="$2" | ||
|
||
case "$TARGET_PLATFORM" in | ||
osx) | ||
with_pushd "$(mkdirp_absolute_path "llvm-${LLVM_VERSION}-osx")" \ | ||
fetch_llvm_binary_release_archive 'apple-darwin' | ||
;; | ||
linux) | ||
with_pushd "$(mkdirp_absolute_path "llvm-${LLVM_VERSION}-linux")" \ | ||
fetch_llvm_binary_release_archive 'linux-gnu-ubuntu-16.04' | ||
;; | ||
*) | ||
die "llvm does not support building for '${TARGET_PLATFORM}'" | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
readonly result="$(./build-llvm.sh osx 6.0.0)" | ||
|
||
cp "$result" ./llvm.tar.xz |