Skip to content

Commit

Permalink
protobuf: add native Python bindings
Browse files Browse the repository at this point in the history
Closes Homebrew/legacy-homebrew#23013.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
  • Loading branch information
Etienne Laurin authored and adamv committed Oct 5, 2013
1 parent 478e77c commit 764415a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Formula/protobuf.rb
Expand Up @@ -7,6 +7,8 @@ class Protobuf < Formula

option :universal

depends_on :python => :optional

fails_with :llvm do
build 2334
end
Expand All @@ -25,11 +27,25 @@ def install

# Install editor support and examples
doc.install %w( editors examples )

if build.with? 'python'
python do
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'
end
end
end
end

def caveats; <<-EOS.undent
Editor support and examples have been installed to:
#{doc}
#{python.standard_caveats if build.with? 'python'}
EOS
end
end

0 comments on commit 764415a

Please sign in to comment.