Skip to content

Commit

Permalink
Merge branch 'release-0_9' of github.com:grpc/grpc into release-0_9-npn
Browse files Browse the repository at this point in the history
  • Loading branch information
jboeuf committed Jun 25, 2015
2 parents 85581ed + 103b694 commit 6e46cef
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 30 deletions.
47 changes: 19 additions & 28 deletions src/ruby/ext/grpc/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,6 @@
LIBDIR = RbConfig::CONFIG['libdir']
INCLUDEDIR = RbConfig::CONFIG['includedir']

if ENV.key? 'GRPC_ROOT'
GRPC_ROOT = ENV['GRPC_ROOT']
else
grpc_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..'))
if File.exist?(File.join(grpc_root, 'include/grpc/grpc.h'))
GRPC_ROOT = grpc_root
else
GRPC_ROOT = nil
end
end

if ENV.key? 'CONFIG'
GRPC_CONFIG = ENV['CONFIG']
else
GRPC_CONFIG = 'opt'
end

if (ENV.key? 'GRPC_LIB_DIR') && (!GRPC_ROOT.nil?)
GRPC_LIB_DIR = File.join(GRPC_ROOT, ENV['GRPC_LIB_DIR'])
else
GRPC_LIB_DIR = File.join(File.join(GRPC_ROOT, 'libs'), GRPC_CONFIG)
end

HEADER_DIRS = [
# Search /opt/local (Mac source install)
'/opt/local/include',
Expand All @@ -77,12 +54,26 @@
LIBDIR
]

unless GRPC_ROOT.nil?
HEADER_DIRS.unshift File.join(GRPC_ROOT, 'include')
LIB_DIRS.unshift GRPC_LIB_DIR
unless File.exist?(File.join(GRPC_LIB_DIR, 'libgrpc.a'))
system("make -C #{GRPC_ROOT} static_c CONFIG=#{GRPC_CONFIG}")
# Check to see if GRPC_ROOT is defined or available
grpc_root = ENV['GRPC_ROOT']
if grpc_root.nil?
r = File.expand_path(File.join(File.dirname(__FILE__), '../../../..'))
grpc_root = r if File.exist?(File.join(r, 'include/grpc/grpc.h'))
end

# When grpc_root is available attempt to build the grpc core.
unless grpc_root.nil?
grpc_config = ENV['GRPC_CONFIG'] || 'opt'
if ENV.key?('GRPC_LIB_DIR')
grpc_lib_dir = File.join(grpc_root, ENV['GRPC_LIB_DIR'])
else
grpc_lib_dir = File.join(File.join(grpc_root, 'libs'), grpc_config)
end
unless File.exist?(File.join(grpc_lib_dir, 'libgrpc.a'))
system("make -C #{grpc_root} static_c CONFIG=#{grpc_config}")
end
HEADER_DIRS.unshift File.join(grpc_root, 'include')
LIB_DIRS.unshift grpc_lib_dir
end

def crash(msg)
Expand Down
2 changes: 1 addition & 1 deletion src/ruby/grpc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.license = 'BSD-3-Clause'

s.required_ruby_version = '>= 2.0.0'
s.requirements << 'libgrpc ~> 0.6.0 needs to be installed'
s.requirements << 'libgrpc ~> 0.9.1 needs to be installed'

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- spec/*`.split("\n")
Expand Down
2 changes: 1 addition & 1 deletion src/ruby/lib/grpc/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@

# GRPC contains the General RPC module.
module GRPC
VERSION = '0.9.0'
VERSION = '0.9.4'
end

0 comments on commit 6e46cef

Please sign in to comment.