2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Protobuf < Formula
|
2010-01-31 03:16:52 +00:00
|
|
|
homepage 'http://code.google.com/p/protobuf/'
|
2013-03-04 21:15:59 +00:00
|
|
|
url 'http://protobuf.googlecode.com/files/protobuf-2.5.0.tar.bz2'
|
|
|
|
sha1 '62c10dcdac4b69cc8c6bb19f73db40c264cb2726'
|
2011-03-26 06:25:28 +00:00
|
|
|
|
2012-08-12 17:58:48 +00:00
|
|
|
option :universal
|
2013-10-12 11:02:44 +00:00
|
|
|
option :cxx11
|
2012-08-12 17:58:48 +00:00
|
|
|
|
2013-10-03 02:56:04 +00:00
|
|
|
depends_on :python => :optional
|
|
|
|
|
2012-03-18 20:33:24 +00:00
|
|
|
fails_with :llvm do
|
|
|
|
build 2334
|
|
|
|
end
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2009-09-21 19:24:04 +00:00
|
|
|
def install
|
2012-01-29 05:19:48 +00:00
|
|
|
# Don't build in debug mode. See:
|
2013-12-14 18:13:11 +00:00
|
|
|
# https://github.com/Homebrew/homebrew/issues/9279
|
2012-01-29 05:19:48 +00:00
|
|
|
# http://code.google.com/p/protobuf/source/browse/trunk/configure.ac#61
|
|
|
|
ENV.prepend 'CXXFLAGS', '-DNDEBUG'
|
2012-08-12 17:58:48 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
2013-10-12 11:02:44 +00:00
|
|
|
ENV.cxx11 if build.cxx11?
|
|
|
|
|
2010-04-07 05:58:35 +00:00
|
|
|
system "./configure", "--disable-debug", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}",
|
2010-01-31 03:16:52 +00:00
|
|
|
"--with-zlib"
|
|
|
|
system "make"
|
2009-09-21 19:24:04 +00:00
|
|
|
system "make install"
|
2011-12-06 22:02:19 +00:00
|
|
|
|
|
|
|
# Install editor support and examples
|
|
|
|
doc.install %w( editors examples )
|
2013-10-03 02:56:04 +00:00
|
|
|
|
|
|
|
if build.with? 'python'
|
2014-01-04 13:13:01 +00:00
|
|
|
chdir 'python' do
|
|
|
|
ENV['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'cpp'
|
|
|
|
ENV.append_to_cflags "-I#{include}"
|
|
|
|
ENV.append_to_cflags "-L#{lib}"
|
|
|
|
system 'python', 'setup.py', 'build'
|
|
|
|
system 'python', 'setup.py', 'install', "--prefix=#{prefix}",
|
|
|
|
'--single-version-externally-managed', '--record=installed.txt'
|
2013-10-03 02:56:04 +00:00
|
|
|
end
|
|
|
|
end
|
2011-12-06 22:02:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
Editor support and examples have been installed to:
|
2013-03-16 18:31:27 +00:00
|
|
|
#{doc}
|
2011-12-06 22:02:19 +00:00
|
|
|
EOS
|
2009-09-21 19:24:04 +00:00
|
|
|
end
|
2011-03-10 05:11:03 +00:00
|
|
|
end
|