-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add build script for Thrift 0.11.0 #83
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9699adf
Add build script for Thrift 0.11.0
StephanErb 22fdc7b
Disable QT compiliation
StephanErb f257879
Extend extract utility to support .tgz endings
StephanErb fb7bf1a
Refactor Thrift 0.11.0 build script filesystem layout
StephanErb e6ff366
Fix typo in thrift comment
cosmicexplorer b1c38a7
Build Thrift with bison 3.2
StephanErb fc20e9d
Make MacOS 10.14 the canonical Thrift 0.11 build script location
StephanErb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this useful extension!