sparsam 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/ext/extconf.rb +59 -1
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d2c1375a7b3b2819de7f3ee0ad85fa964fc86345ab6ae109e18a033be94178c
4
- data.tar.gz: f47b19af1fc8810c9e06864a11c6bbfd6b78635c430c9ba2e10d578d4f3f01c4
3
+ metadata.gz: 34cdf5f3a73cda371b8a1275369af0063e525d0951f44c23a12e02e6dfa3c519
4
+ data.tar.gz: f5d7efaf6389491e9ceab33839b828fb26757d8b84b8cc3ba9cf87b509716e13
5
5
  SHA512:
6
- metadata.gz: 978c4060ced319ba2d1a24462d1c3bc917bd42f049ea591f67023631895467df7c1917734b461b9ec7c2f210f014cce5b9cd95a820a74e9d432492c80ec133fa
7
- data.tar.gz: 948ae683123165a6e4c85537b252f882fd10e1c6f481b3641799d0635067804aaf47743aecfaca267a764bd2a4ca4ec3495a5a294871e65ab7c953efd8d6d2cb
6
+ metadata.gz: c2482ca31e496f3e1fb2597eaf7eb8f83e2f5545d7b2f8165840c5b394b4f63ce522bff6c2d18e11287803cc739ad279b97cf45f97efa1bbdd2f29c5594c8fc2
7
+ data.tar.gz: 62c14e98d040e76fdf6d9a886c0b138e25f0e8b9b901445b000f6c9fed12947c7537749a24f5601fc84d4e920b6b18b816fbcbe946aa525242de57d269698abd
data/ext/extconf.rb CHANGED
@@ -7,12 +7,70 @@ if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
7
7
  $CPPFLAGS += $CXXFLAGS
8
8
  end
9
9
 
10
+ brew = find_executable('brew')
11
+
12
+ # Automatically use homebrew to discover thrift package if it is
13
+ # available and not disabled via --disable-homebrew.
14
+ use_homebrew = enable_config('homebrew', brew)
15
+
16
+ if use_homebrew
17
+ $stderr.puts "Using #{brew} to locate thrift and boost packages"
18
+ $stderr.puts '(disable Homebrew integration via --disable-homebrew)'
19
+
20
+ thrift_package = with_config('homebrew-thrift-package', 'thrift@0.9')
21
+ $stderr.puts "looking for Homebrew thrift package '#{thrift_package}'"
22
+ $stderr.puts '(change Homebrew thrift package name via --with-homebrew-thrift-package=<package>)'
23
+
24
+ thrift_prefix = `#{brew} --prefix #{thrift_package}`.strip
25
+
26
+ unless File.exists?(thrift_prefix)
27
+ $stderr.puts "#{thrift_prefix} does not exist"
28
+ $stderr.puts "To resolve, `brew install #{thrift_package}` or pass"
29
+ $stderr.puts '--with-homebrew-thrift-package=<package> to this build to specify'
30
+ $stderr.puts 'an alternative thrift package to build against. e.g.:'
31
+ $stderr.puts
32
+ $stderr.puts ' $ bundle config --global build.sparsam --with-homebrew-thrift-package=mythrift'
33
+
34
+ raise "Homebrew package #{thrift_package} not installed"
35
+ end
36
+
37
+ $stderr.puts "using Homebrew thrift at #{thrift_prefix}"
38
+ $CFLAGS << " -I#{thrift_prefix}/include"
39
+ $CXXFLAGS << " -I#{thrift_prefix}/include"
40
+ $CPPFLAGS << " -I#{thrift_prefix}/include"
41
+ $LDFLAGS << " -L#{thrift_prefix}/lib"
42
+
43
+ # Also add boost to the includes search path if it is installed.
44
+ boost_package = with_config('homebrew-boost-package', 'boost')
45
+ $stderr.puts "looking for Homebrew boost package '#{boost_package}'"
46
+ $stderr.puts '(change Homebrew boost package name via --with-homebrew-boost-package=<package>)'
47
+
48
+ boost_prefix = `#{brew} --prefix #{boost_package}`.strip
49
+
50
+ if File.exists?(boost_prefix)
51
+ $stderr.puts("using Homebrew boost at #{boost_prefix}")
52
+ $CFLAGS << " -I#{boost_prefix}/include"
53
+ $CXXFLAGS << " -I#{boost_prefix}/include"
54
+ $CPPFLAGS << " -I#{boost_prefix}/include"
55
+ else
56
+ $stderr.puts 'Homebrew boost not found; assuming boost is in default search paths'
57
+ end
58
+ end
59
+
10
60
  have_func("strlcpy", "string.h")
11
- have_library("thrift")
61
+
62
+ unless have_library("thrift")
63
+ raise 'thrift library not found; aborting since compile would fail'
64
+ end
65
+
12
66
  libs = ['-lthrift']
13
67
 
14
68
  libs.each do |lib|
15
69
  $LOCAL_LIBS << "#{lib} "
16
70
  end
17
71
 
72
+ # Ideally we'd validate boost as well. But boost is header only and
73
+ # mkmf's have_header() doesn't work with C++ headers.
74
+ # https://bugs.ruby-lang.org/issues/4924
75
+
18
76
  create_makefile 'sparsam_native'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sparsam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airbnb Thrift Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-20 00:00:00.000000000 Z
11
+ date: 2022-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0'
166
166
  requirements: []
167
- rubygems_version: 3.0.3
167
+ rubygems_version: 3.0.3.1
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: Ruby bindings for Apache Thrift