Created
October 10, 2016 15:12
-
-
Save tmcw/267087dc673ec0c27456fd52c7e43603 to your computer and use it in GitHub Desktop.
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
class OsrmBackend < Formula | |
desc "High performance routing engine" | |
homepage "http://project-osrm.org/" | |
url "https://github.com/Project-OSRM/osrm-backend/archive/v5.4.0.tar.gz" | |
sha256 "6393745fe8250ad0387b1fe3f4a2218cf692528acb55a4e0198ba5fbe1c81231" | |
depends_on "cmake" => :build | |
depends_on "node" => :build | |
depends_on "boost" | |
depends_on "cmake" | |
depends_on "libstxxl" | |
depends_on "libxml2" | |
depends_on "libzip" | |
depends_on "lua51" | |
depends_on "luabind" | |
depends_on "tbb" | |
def install | |
mkdir "build" do | |
system "cmake", "..", *std_cmake_args | |
system "make" | |
system "make", "install" | |
end | |
end | |
test do | |
(testpath/"test.osm").write <<-EOS.undent | |
<?xml version="1.0" encoding="UTF-8"?> | |
<osm version="0.6" generator="CGImap 0.0.2"> | |
<bounds minlat="54.0889580" minlon="12.2487570" maxlat="54.0913900" maxlon="12.2524800"/> | |
<node id="1" lat="54.0901746" lon="12.2482632" user="SvenHRO" uid="46882" visible="true" version="1" changeset="676636" timestamp="2008-09-21T21:37:45Z"/> | |
<node id="2" lat="54.0906309" lon="12.2441924" user="PikoWinter" uid="36744" visible="true" version="1" changeset="323878" timestamp="2008-05-03T13:39:23Z"/> | |
<node id="3" lat="52.0906309" lon="12.2441924" user="PikoWinter" uid="36744" visible="true" version="1" changeset="323878" timestamp="2008-05-03T13:39:23Z"/> | |
<way id="10" user="Masch" uid="55988" visible="true" version="5" changeset="4142606" timestamp="2010-03-16T11:47:08Z"> | |
<nd ref="1"/> | |
<nd ref="2"/> | |
<tag k="highway" v="unclassified"/> | |
</way> | |
<way id="11" user="Masch" uid="55988" visible="true" version="5" changeset="4142606" timestamp="2010-03-16T11:47:08Z"> | |
<nd ref="1"/> | |
<nd ref="3"/> | |
<tag k="highway" v="unclassified"/> | |
</way> | |
</osm> | |
EOS | |
(testpath/"tiny-profile.lua").write <<-EOS.undent | |
speed_profile = { | |
["primary"] = 36, | |
["secondary"] = 18, | |
["tertiary"] = 12, | |
["steps"] = 6, | |
["default"] = 24 | |
} | |
function limit_speed(speed, limits) | |
end | |
function node_function (node, result) | |
end | |
function way_function (way, result) | |
end | |
EOS | |
safe_system "#{bin}/osrm-extract", "test.osm", "--profile", "tiny-profile.lua" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment