diff --git a/build-support/bin/thrift/linux/x86_64/0.11.0/build-thrift.sh b/build-support/bin/thrift/linux/x86_64/0.11.0/build-thrift.sh new file mode 100755 index 0000000..1ccae29 --- /dev/null +++ b/build-support/bin/thrift/linux/x86_64/0.11.0/build-thrift.sh @@ -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 diff --git a/build-support/bin/thrift/linux/x86_64/0.11.0/build.sh b/build-support/bin/thrift/linux/x86_64/0.11.0/build.sh new file mode 100755 index 0000000..da1d839 --- /dev/null +++ b/build-support/bin/thrift/linux/x86_64/0.11.0/build.sh @@ -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 diff --git a/build-support/bin/thrift/mac/10.10/0.11.0 b/build-support/bin/thrift/mac/10.10/0.11.0 new file mode 120000 index 0000000..e4b7137 --- /dev/null +++ b/build-support/bin/thrift/mac/10.10/0.11.0 @@ -0,0 +1 @@ +../10.14/0.11.0 \ No newline at end of file diff --git a/build-support/bin/thrift/mac/10.11/0.11.0 b/build-support/bin/thrift/mac/10.11/0.11.0 new file mode 120000 index 0000000..e4b7137 --- /dev/null +++ b/build-support/bin/thrift/mac/10.11/0.11.0 @@ -0,0 +1 @@ +../10.14/0.11.0 \ No newline at end of file diff --git a/build-support/bin/thrift/mac/10.12/0.11.0 b/build-support/bin/thrift/mac/10.12/0.11.0 new file mode 120000 index 0000000..e4b7137 --- /dev/null +++ b/build-support/bin/thrift/mac/10.12/0.11.0 @@ -0,0 +1 @@ +../10.14/0.11.0 \ No newline at end of file diff --git a/build-support/bin/thrift/mac/10.13/0.11.0 b/build-support/bin/thrift/mac/10.13/0.11.0 new file mode 120000 index 0000000..e4b7137 --- /dev/null +++ b/build-support/bin/thrift/mac/10.13/0.11.0 @@ -0,0 +1 @@ +../10.14/0.11.0 \ No newline at end of file diff --git a/build-support/bin/thrift/mac/10.14/0.11.0/build-thrift.sh b/build-support/bin/thrift/mac/10.14/0.11.0/build-thrift.sh new file mode 100755 index 0000000..46c421a --- /dev/null +++ b/build-support/bin/thrift/mac/10.14/0.11.0/build-thrift.sh @@ -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 diff --git a/build-support/bin/thrift/mac/10.14/0.11.0/build.sh b/build-support/bin/thrift/mac/10.14/0.11.0/build.sh new file mode 100755 index 0000000..a9eeb9d --- /dev/null +++ b/build-support/bin/thrift/mac/10.14/0.11.0/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +readonly result="$(./build-thrift.sh 0.11.0 3.2 20140715)" +cp "$result" ./thrift diff --git a/build-support/bin/thrift/mac/10.8/0.11.0 b/build-support/bin/thrift/mac/10.8/0.11.0 new file mode 120000 index 0000000..e4b7137 --- /dev/null +++ b/build-support/bin/thrift/mac/10.8/0.11.0 @@ -0,0 +1 @@ +../10.14/0.11.0 \ No newline at end of file diff --git a/build-support/bin/thrift/mac/10.9/0.11.0 b/build-support/bin/thrift/mac/10.9/0.11.0 new file mode 120000 index 0000000..e4b7137 --- /dev/null +++ b/build-support/bin/thrift/mac/10.9/0.11.0 @@ -0,0 +1 @@ +../10.14/0.11.0 \ No newline at end of file diff --git a/utils.v1.bash b/utils.v1.bash index 22961e3..54d8244 100644 --- a/utils.v1.bash +++ b/utils.v1.bash @@ -82,6 +82,9 @@ function do_extract { *.tar.gz) tar zxf "$archive_path" ;; + *.tgz) + tar zxf "$archive_path" + ;; *) die "Unrecognized file extension for compressed archive at '${archive_path}'." ;;