2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-01 13:05:18 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Thrift < Formula
|
2011-08-30 23:13:57 +00:00
|
|
|
homepage 'http://thrift.apache.org'
|
2014-03-17 19:43:59 +00:00
|
|
|
|
|
|
|
stable do
|
|
|
|
url "http://archive.apache.org/dist/thrift/0.9.1/thrift-0.9.1.tar.gz"
|
|
|
|
sha1 "dc54a54f8dc706ffddcd3e8c6cd5301c931af1cc"
|
|
|
|
|
|
|
|
# These patches are 0.9.1-specific and can go away once a newer version is released
|
2014-03-17 20:30:08 +00:00
|
|
|
[
|
2014-03-17 19:43:59 +00:00
|
|
|
# Apply THRIFT-2201 fix from master to 0.9.1 branch (required for clang to compile with C++11 support)
|
2014-03-17 20:30:08 +00:00
|
|
|
%w{836d95f9f00be73c6936d407977796181d1a506c 4bc8c19c51f3d9f30799251a810dd1ca63c4bf1e},
|
2014-03-17 19:43:59 +00:00
|
|
|
# Apply THRIFT-667
|
2014-03-17 20:30:08 +00:00
|
|
|
%w{12c09f44cb291b1ecc4074cb3a55775b375fa8b2 3c449146e13727a9dbeb66e9826968b85a6d8869},
|
2014-03-17 19:43:59 +00:00
|
|
|
# Apply THRIFT-1755
|
2014-03-17 20:30:08 +00:00
|
|
|
%w{8cd3efe50a42975375e8ff3bc03306d9e4174314 5b45d692b2e6a4480d088485d4f011b9cd7fff52},
|
2014-03-17 19:43:59 +00:00
|
|
|
# Apply THRIFT-2045
|
2014-03-17 20:30:08 +00:00
|
|
|
%w{282e440c6de219b7b8f32b01cc7eb599f534f33f a5ab25621be48a803de7f0893ada1cdadaa1bc11},
|
|
|
|
%w{9f9cd10e813ef574dd5578d78ca26a9088383d3a 65db24f59989eab8b3b0a0f1393a52faa3cba7ee},
|
|
|
|
%w{e957675647d3d7caafe842aa85cbd987e91b21f9 478a5ad6b08a268460793112361726976fee8157},
|
2014-03-17 19:43:59 +00:00
|
|
|
# Apply THRIFT-2229 fix from master to 0.9.1 branch
|
2014-03-17 20:30:08 +00:00
|
|
|
%w{5f2d34e5ab33651059a085525b3adbab6a877e6f ff01eeca821a1d97485c9075c4d65f0c5eef4931},
|
|
|
|
].each do |name, sha|
|
2014-03-17 19:43:59 +00:00
|
|
|
patch do
|
|
|
|
url "https://git-wip-us.apache.org/repos/asf?p=thrift.git;a=patch;h=#{name}"
|
|
|
|
sha1 sha
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2009-09-01 13:05:18 +00:00
|
|
|
|
2014-02-18 22:49:03 +00:00
|
|
|
head do
|
|
|
|
url 'https://git-wip-us.apache.org/repos/asf/thrift.git'
|
2013-09-22 01:47:45 +00:00
|
|
|
|
|
|
|
depends_on :autoconf
|
|
|
|
depends_on :automake
|
|
|
|
depends_on :libtool
|
2014-01-14 08:43:26 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2013-09-22 01:47:45 +00:00
|
|
|
end
|
2012-06-09 01:34:14 +00:00
|
|
|
|
2012-09-05 15:47:06 +00:00
|
|
|
option "with-haskell", "Install Haskell binding"
|
|
|
|
option "with-erlang", "Install Erlang binding"
|
|
|
|
option "with-java", "Install Java binding"
|
|
|
|
option "with-perl", "Install Perl binding"
|
2014-01-14 08:43:26 +00:00
|
|
|
option "with-php", "Install PHP binding"
|
2012-09-05 15:47:06 +00:00
|
|
|
|
2009-10-04 23:36:13 +00:00
|
|
|
depends_on 'boost'
|
2013-01-21 09:33:56 +00:00
|
|
|
depends_on :python => :optional
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2009-09-01 13:05:18 +00:00
|
|
|
def install
|
2014-01-14 08:43:26 +00:00
|
|
|
system "./bootstrap.sh" unless build.stable?
|
2010-10-30 22:59:05 +00:00
|
|
|
|
2014-01-14 08:43:26 +00:00
|
|
|
exclusions = ["--without-ruby", "--without-tests", "--without-php_extension"]
|
2012-09-05 15:47:06 +00:00
|
|
|
|
2014-03-06 20:40:26 +00:00
|
|
|
exclusions << "--without-python" if build.without? "python"
|
|
|
|
exclusions << "--without-haskell" if build.without? "haskell"
|
|
|
|
exclusions << "--without-java" if build.without? "java"
|
|
|
|
exclusions << "--without-perl" if build.without? "perl"
|
|
|
|
exclusions << "--without-php" if build.without? "php"
|
|
|
|
exclusions << "--without-erlang" if build.without? "erlang"
|
2012-09-05 15:47:06 +00:00
|
|
|
|
2014-01-14 08:43:26 +00:00
|
|
|
ENV.cxx11 if MacOS.version >= :mavericks && ENV.compiler == :clang
|
|
|
|
|
|
|
|
# Don't install extensions to /usr:
|
|
|
|
ENV["PY_PREFIX"] = prefix
|
|
|
|
ENV["PHP_PREFIX"] = prefix
|
2013-01-21 09:33:56 +00:00
|
|
|
|
2010-10-30 22:59:05 +00:00
|
|
|
system "./configure", "--disable-debug",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--libdir=#{lib}",
|
2012-09-05 15:47:06 +00:00
|
|
|
*exclusions
|
2011-01-20 22:39:13 +00:00
|
|
|
ENV.j1
|
2009-09-01 13:05:18 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
end
|
2010-03-28 01:41:03 +00:00
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
def caveats
|
2014-01-04 13:17:08 +00:00
|
|
|
<<-EOS.undent
|
2014-01-14 08:43:26 +00:00
|
|
|
To install Ruby binding:
|
2012-08-23 04:23:14 +00:00
|
|
|
gem install thrift
|
2010-03-28 01:41:03 +00:00
|
|
|
|
2014-01-14 08:43:26 +00:00
|
|
|
To install PHP extension for e.g. PHP 5.5:
|
2014-04-10 10:21:31 +00:00
|
|
|
brew install homebrew/php/php55-thrift
|
2009-09-01 13:05:18 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|