-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install H3 via native extension if it isn't present.
- Loading branch information
1 parent
6a59e96
commit 3e6fd3b
Showing
6 changed files
with
29 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "ext/h3/src"] | ||
path = ext/h3/src | ||
url = https://github.com/uber/h3.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,19 +24,9 @@ We have also suffixed predicate methods with a question mark, as per the Ruby co | |
|
||
This gem uses FFI to link directly into the H3 library (written in C). | ||
|
||
Before using the gem, you will need to install the C lib at https://github.com/uber/h3. | ||
The gem is installed as a native extension. It requires some dependencies to be present on the system first. | ||
|
||
Install the build dependencies as instructed here: https://github.com/uber/h3#install-build-time-dependencies | ||
|
||
Do *not* follow the Compilation Steps. Instead, use the following: | ||
|
||
git clone [email protected]:uber/h3.git h3_build | ||
cd h3_build | ||
cmake . -DBUILD_SHARED_LIBS=true | ||
make | ||
sudo make install | ||
|
||
The key difference is the `BUILD_SHARED_LIBS` option. | ||
Please install the build dependencies for your system as instructed here: https://github.com/uber/h3#install-build-time-dependencies | ||
|
||
## Installing | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require "mkmf" | ||
|
||
make_content = "make:\n" \ | ||
"\tcd src;" \ | ||
"\tcmake . -DBUILD_SHARED_LIBS=true;" \ | ||
"\tmake\n" \ | ||
"install:\n" \ | ||
"\tcd src; make install ; true\n" \ | ||
"clean:\n" \ | ||
"\t:\n" | ||
|
||
dummy_content = "make:\n" \ | ||
"\t:\n" \ | ||
"install:\n" \ | ||
"\t:\n" \ | ||
"clean:\n" \ | ||
"\t:\n" | ||
|
||
File.write('Makefile', have_library("h3") ? dummy_content : make_content) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec| | |
spec.email = "[email protected]" | ||
|
||
spec.required_ruby_version = "> 2.3" | ||
spec.files = `git ls-files`.split("\n") | ||
spec.files = `git ls-files --recurse-submodules`.split("\n") | ||
|
||
spec.add_runtime_dependency "ffi", "~> 1.9" | ||
spec.add_runtime_dependency "rgeo-geojson", "~> 2.1" | ||
|
@@ -19,4 +19,6 @@ Gem::Specification.new do |spec| | |
spec.add_development_dependency "rspec", "~> 3.8" | ||
spec.add_development_dependency "yard", "~> 0.9" | ||
spec.add_development_dependency "coveralls", "~> 0.8" | ||
|
||
spec.extensions << 'ext/h3/extconf.rb' | ||
end |