-
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.
Add build script for Thrift 0.11.0 (#83)
- Loading branch information
1 parent
c803d9f
commit 6075ed4
Showing
11 changed files
with
213 additions
and
0 deletions.
There are no files selected for viewing
97 changes: 97 additions & 0 deletions
97
build-support/bin/thrift/linux/x86_64/0.11.0/build-thrift.sh
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,97 @@ | ||
#!/bin/bash | ||
|
||
source "$(git rev-parse --show-toplevel)/utils.v1.bash" | ||
|
||
set_strict_mode | ||
|
||
function build_bison { | ||
local -r extracted_dirname="bison-${BISON_VERSION}" | ||
local -r archive_filename="${extracted_dirname}.tar.gz" | ||
local -r release_url="http://ftp.gnu.org/gnu/bison/${archive_filename}" | ||
|
||
local -r downloaded_archive="$(curl_file_with_fail "$release_url" "$archive_filename")" | ||
local -r source_extracted_abs="$(extract_for "$downloaded_archive" "$extracted_dirname")" | ||
|
||
with_pushd >&2 "$source_extracted_abs" sh ./configure --prefix="$source_extracted_abs/$INSTALL_PREFIX" | ||
with_pushd >&2 "$source_extracted_abs" make install | ||
|
||
export PATH="$source_extracted_abs/$INSTALL_PREFIX/bin:$PATH" | ||
} | ||
|
||
function build_byacc { | ||
local -r extracted_dirname="byacc-${BYACC_VERSION}" | ||
local -r archive_filename="${extracted_dirname}.tgz" | ||
local -r release_url="https://www.mirrorservice.org/sites/lynx.invisible-island.net/byacc/${archive_filename}" | ||
|
||
local -r downloaded_archive="$(curl_file_with_fail "$release_url" "$archive_filename")" | ||
local -r source_extracted_abs="$(extract_for "$downloaded_archive" "$extracted_dirname")" | ||
|
||
with_pushd >&2 "$source_extracted_abs" sh ./configure --prefix="$source_extracted_abs/$INSTALL_PREFIX" | ||
with_pushd >&2 "$source_extracted_abs" make install | ||
|
||
export PATH="$source_extracted_abs/$INSTALL_PREFIX/bin:$PATH" | ||
} | ||
|
||
function build_thrift { | ||
local -r extracted_dirname="thrift-${THRIFT_VERSION}" | ||
local -r archive_filename="${extracted_dirname}.tar.gz" | ||
local -r release_url="http://archive.apache.org/dist/thrift/${THRIFT_VERSION}/${archive_filename}" | ||
|
||
local -r downloaded_archive="$(curl_file_with_fail "$release_url" "$archive_filename")" | ||
local -r source_extracted_abs="$(extract_for "$downloaded_archive" "$extracted_dirname")" | ||
|
||
# NB: The configure --wthout-* flags just disable building any runtime libs | ||
# for the generated code. We only want the codegen side of things. | ||
with_pushd >&2 "$source_extracted_abs" \ | ||
sh ./configure \ | ||
--disable-shared \ | ||
--without-cpp \ | ||
--without-c_glib \ | ||
--without-csharp \ | ||
--without-erlang \ | ||
--without-java \ | ||
--without-erlang \ | ||
--without-lua \ | ||
--without-python \ | ||
--without-perl \ | ||
--without-php \ | ||
--without-php_extension \ | ||
--without-qt4 \ | ||
--without-qt5 \ | ||
--without-dart \ | ||
--without-ruby \ | ||
--without-haskell \ | ||
--without-go \ | ||
--without-nodejs \ | ||
--without-rs \ | ||
--without-haxe \ | ||
--without-dotnetcore \ | ||
--without-d | ||
with_pushd >&2 "$source_extracted_abs" make clean | ||
with_pushd >&2 "$source_extracted_abs" make LDFLAGS="-all-static" | ||
|
||
echo "$source_extracted_abs/compiler/cpp/thrift" | ||
} | ||
|
||
## Interpret arguments and execute build. | ||
|
||
readonly THRIFT_VERSION="$1" | ||
readonly BISON_VERSION="$2" | ||
readonly BYACC_VERSION="$3" | ||
readonly INSTALL_PREFIX=install_dir | ||
|
||
case "$(uname)" in | ||
Darwin) | ||
with_pushd "$(mkdirp_absolute_path "bison-${BISON_VERSION}-osx")" build_bison | ||
with_pushd "$(mkdirp_absolute_path "byacc-${BYACC_VERSION}-osx")" build_byacc | ||
with_pushd "$(mkdirp_absolute_path "thrift-${THRIFT_VERSION}-osx")" build_thrift | ||
;; | ||
Linux) | ||
with_pushd "$(mkdirp_absolute_path "bison-${BISON_VERSION}-linux")" build_bison | ||
with_pushd "$(mkdirp_absolute_path "byacc-${BYACC_VERSION}-linux")" build_byacc | ||
with_pushd "$(mkdirp_absolute_path "thrift-${THRIFT_VERSION}-linux")" build_thrift | ||
;; | ||
*) | ||
die "make does not support building for '$(uname)'" | ||
;; | ||
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,6 @@ | ||
#!/bin/bash | ||
|
||
yum install -y flex flex-devel | ||
|
||
readonly result="$(./build-thrift.sh 0.11.0 2.5.1 20140715)" | ||
cp "$result" ./thrift |
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.14/0.11.0 |
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.14/0.11.0 |
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.14/0.11.0 |
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.14/0.11.0 |
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,97 @@ | ||
#!/bin/bash | ||
|
||
source "$(git rev-parse --show-toplevel)/utils.v1.bash" | ||
|
||
set_strict_mode | ||
|
||
function build_bison { | ||
local -r extracted_dirname="bison-${BISON_VERSION}" | ||
local -r archive_filename="${extracted_dirname}.tar.gz" | ||
local -r release_url="http://ftp.gnu.org/gnu/bison/${archive_filename}" | ||
|
||
local -r downloaded_archive="$(curl_file_with_fail "$release_url" "$archive_filename")" | ||
local -r source_extracted_abs="$(extract_for "$downloaded_archive" "$extracted_dirname")" | ||
|
||
with_pushd >&2 "$source_extracted_abs" sh ./configure --prefix="$source_extracted_abs/$INSTALL_PREFIX" | ||
with_pushd >&2 "$source_extracted_abs" make install | ||
|
||
export PATH="$source_extracted_abs/$INSTALL_PREFIX/bin:$PATH" | ||
} | ||
|
||
function build_byacc { | ||
local -r extracted_dirname="byacc-${BYACC_VERSION}" | ||
local -r archive_filename="${extracted_dirname}.tgz" | ||
local -r release_url="https://www.mirrorservice.org/sites/lynx.invisible-island.net/byacc/${archive_filename}" | ||
|
||
local -r downloaded_archive="$(curl_file_with_fail "$release_url" "$archive_filename")" | ||
local -r source_extracted_abs="$(extract_for "$downloaded_archive" "$extracted_dirname")" | ||
|
||
with_pushd >&2 "$source_extracted_abs" sh ./configure --prefix="$source_extracted_abs/$INSTALL_PREFIX" | ||
with_pushd >&2 "$source_extracted_abs" make install | ||
|
||
export PATH="$source_extracted_abs/$INSTALL_PREFIX/bin:$PATH" | ||
} | ||
|
||
function build_thrift { | ||
local -r extracted_dirname="thrift-${THRIFT_VERSION}" | ||
local -r archive_filename="${extracted_dirname}.tar.gz" | ||
local -r release_url="http://archive.apache.org/dist/thrift/${THRIFT_VERSION}/${archive_filename}" | ||
|
||
local -r downloaded_archive="$(curl_file_with_fail "$release_url" "$archive_filename")" | ||
local -r source_extracted_abs="$(extract_for "$downloaded_archive" "$extracted_dirname")" | ||
|
||
# NB: The configure --without-* flags just disable building any runtime libs | ||
# for the generated code. We only want the codegen side of things. | ||
with_pushd >&2 "$source_extracted_abs" \ | ||
sh ./configure \ | ||
--disable-shared \ | ||
--without-cpp \ | ||
--without-c_glib \ | ||
--without-csharp \ | ||
--without-erlang \ | ||
--without-java \ | ||
--without-erlang \ | ||
--without-lua \ | ||
--without-python \ | ||
--without-perl \ | ||
--without-php \ | ||
--without-php_extension \ | ||
--without-qt4 \ | ||
--without-qt5 \ | ||
--without-dart \ | ||
--without-ruby \ | ||
--without-haskell \ | ||
--without-go \ | ||
--without-nodejs \ | ||
--without-rs \ | ||
--without-haxe \ | ||
--without-dotnetcore \ | ||
--without-d | ||
with_pushd >&2 "$source_extracted_abs" make clean | ||
with_pushd >&2 "$source_extracted_abs" make LDFLAGS="-all-static" | ||
|
||
echo "$source_extracted_abs/compiler/cpp/thrift" | ||
} | ||
|
||
## Interpret arguments and execute build. | ||
|
||
readonly THRIFT_VERSION="$1" | ||
readonly BISON_VERSION="$2" | ||
readonly BYACC_VERSION="$3" | ||
readonly INSTALL_PREFIX=install_dir | ||
|
||
case "$(uname)" in | ||
Darwin) | ||
with_pushd "$(mkdirp_absolute_path "bison-${BISON_VERSION}-osx")" build_bison | ||
with_pushd "$(mkdirp_absolute_path "byacc-${BYACC_VERSION}-osx")" build_byacc | ||
with_pushd "$(mkdirp_absolute_path "thrift-${THRIFT_VERSION}-osx")" build_thrift | ||
;; | ||
Linux) | ||
with_pushd "$(mkdirp_absolute_path "bison-${BISON_VERSION}-linux")" build_bison | ||
with_pushd "$(mkdirp_absolute_path "byacc-${BYACC_VERSION}-linux")" build_byacc | ||
with_pushd "$(mkdirp_absolute_path "thrift-${THRIFT_VERSION}-linux")" build_thrift | ||
;; | ||
*) | ||
die "make does not support building for '$(uname)'" | ||
;; | ||
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,4 @@ | ||
#!/bin/bash | ||
|
||
readonly result="$(./build-thrift.sh 0.11.0 3.2 20140715)" | ||
cp "$result" ./thrift |
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.14/0.11.0 |
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.14/0.11.0 |
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